From Bugzilla Helper: User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.1 i586) gcc generates a segmentation fault whenever you use the -O switch for optimization. Reproducible: Always Steps to Reproduce: 1. Create a source file, or untar one 2. Run gcc -O{1+} 3. Watch internal error message. :( This is especially annoying, because almost every package out there uses the optimization flag (which is a good thing, really, unless your gcc is borked). Actual Results: me2v@reliant c_tidbits $ gcc -O2 ascii.c -o ascii In file included from /usr/include/stdio.h:631, from ascii.c:1: /usr/include/bits/stdio.h: In function `getc_unlocked': /usr/include/bits/stdio.h:58: Internal error: Segmentation fault. Please submit a full bug report. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. Also, when trying to build freetype rpm: mkdir /home/me2v/redhat/BUILD/freetype-2.0.1/obj/.libs gcc -pedantic -ansi -c -Wall -O2 -march=i386 -mcpu=i686 -I/home/me2v/redhat/BUILD/freetype-2.0.1/builds/unix -I/home/me2v/redhat/BUILD/freetype-2.0.1/include -I/home/me2v/redhat/BUILD/freetype-2.0.1/src /home/me2v/redhat/BUILD/freetype-2.0.1/src/base/ftsystem.c -fPIC -DPIC -o /home/me2v/redhat/BUILD/freetype-2.0.1/obj/.libs/ftsystem.lo In file included from /usr/include/string.h:359, from /home/me2v/redhat/BUILD/freetype-2.0.1/src/base/ftsystem.c:36: /usr/include/bits/string2.h: In function `__strcspn_c1': /usr/include/bits/string2.h:878: Internal error: Segmentation fault. Please submit a full bug report. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. make: *** [/home/me2v/redhat/BUILD/freetype-2.0.1/obj/ftsystem.lo] Error 1 error: Bad exit status from /var/tmp/rpm-tmp.71933 (%build) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.71933 (%build) Expected Results: I expect the program to compile successfully Using kgcc seems to work successfully (now--with the last 2 or 3 versions of glibc, before the current one, it generated the same seg. faults that gcc does). At least, I was able to recompile freetype using the current kgcc (current == rawhide, of course! =P ) Installed packages of interest: gcc-2.96-76 gcc-objc-2.96-76 kgcc-1.1.2-40 gcc-java-2.96-76 gcc-c++-2.96-76 libstdc++-devel-2.96-76 libstdc++-2.96-76 kgcc-1.1.2-40 glibc-2.2.2-3 glibc-common-2.2.2-3 glibc-profile-2.2.2-3 glibc-devel-2.2.2-3
Please post here the exact preprocessed source which gcc is falling on together with exact options (you get the preprocessed source e.g. by using -save-temps option). gcc-2.96-76 certainly does not segfault whenever -O1 and above is used, since it would otherwise not bootstrap, pass regression testing and rebuild the whole distribution (which uses mostly -O2 -mcpu=i686, but various other options for various packages as well) without trouble.
Created attachment 11681 [details] Preprocess output, generated with 'gcc -O2 -o hello1 -save-temps hello.c
I downloaded and recompiled gcc 2.96-75 (making stage1 with kgcc). It seems to be working OK, so far. I'm compiling evolution with it right now. I'll try rebuilding gcc 2.96-76 later this week, to see if it exhibits the same Internal Error as the binary distribution did. There may have been some weird interaction between glibc and the compiler--I didn't have this problem until I moved to the glibc 2.2.x libraries, from 2.1.92.
I cannot reproduce this with gcc 2.96-76 on the preprocessed source you provided, nor with 2.96-77.1.