Article View: gnu.gcc.bug
Article #2702bug in sparc gcc 1.35
From: Tom Quinn
Date: Wed, 31 May 1989 15:21
Date: Wed, 31 May 1989 15:21
52 lines
2081 bytes
2081 bytes
The following code will cause gcc to abort when compiled with the "-O
-fstrength-reduce" flags. This is gcc version 1.35 with a fix to
optabs.c on a Sun4/110 running SunOS 4.0.
Tom Quinn Canadian Institute for Theoretical Astrophysics
trq@moose.cita.utoronto.ca
UUCP - decvax!utgpu!moose!trq
BITNET - quinn@utorphys.bitnet
ARPA - trq%moose.cita.toronto.edu@relay.cs.net
The compile:
make stats.o CFLAGS="-g -v -O -fstrength-reduce"
gcc -g -v -O -fstrength-reduce -c stats.c -o stats.o
gcc version 1.35
/usr/local/lib/gcc-cpp -v -undef -D__GNUC__ -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__OPTIMIZE__ stats.c /tmp/cca13385.cpp
GNU CPP version 1.35
/usr/local/lib/gcc-cc1 /tmp/cca13385.cpp -quiet -dumpbase stats.c -fstrength-reduce -g -O -version -o /tmp/cca13385.s
GNU C version 1.35 (sparc) compiled by GNU C version 1.35.
gcc: Program cc1 got fatal signal 6.
The code:
------------------------------------------------------------------------
typedef unsigned int u_int;
union word {
u_int size;
union word *next;
union word *prev;
char *donothing;
long foo[2] ;
};
typedef union word Word;
extern int _malloc_scount[];
malloc_dumpstats(fd)
int fd;
{
int i;
char buf[128];
for (i = 1; i < 2*1024 ; i++) {
if(_malloc_scount[i] > 0) {
(void) sprintf(buf, "%d: %d\n", i * sizeof(Word),
_malloc_scount[i]);
(void) write(fd, buf, strlen(buf));
_malloc_scount[i] = 0;
}
}
if (_malloc_scount[0] > 0) {
(void) sprintf(buf, ">= %d: %d\n", 2*1024 * sizeof(Word),
_malloc_scount[0]);
(void) write(fd, buf, strlen(buf));
_malloc_scount[0] = 0;
}
}
Technical Details
Message-ID:
<8905311521.AA01861@moose.cita.utoronto.ca>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!MOOSE.CITA.UTORONTO.CA!trqShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!MOOSE.CITA.UTORONTO.CA!trq From: trq@MOOSE.CITA.UTORONTO.CA (Tom Quinn) Newsgroups: gnu.gcc.bug Subject: bug in sparc gcc 1.35 Message-ID: <8905311521.AA01861@moose.cita.utoronto.ca> Date: 31 May 89 15:21:13 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 52