New: ICE in default_secondary_reload, at targhooks.c:532 when building libgcc2.c as _divsc
5 answers - 3253 bytes -

I've come across the following whilst trying to build a gcc cross-compiler:
/
-isystem
/ -isystem
/ -g -DIN_GCC
-DCRSS_CMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g
-DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLAT_NT_NEEDED -Dinhibit_libc -I.
-I. -I//gcc/gcc -I//gcc/gcc/. -I//gcc/gcc//include
-I/libdecnumber -DL_divsc3 -fvisibility=hidden -DHIDE_EXPRTS -c
//gcc/gcc/libgcc2.c -o libgcc/./_divsc3.o
//gcc/gcc/libgcc2.c: In function ‘__divsc3’:
//gcc/gcc/libgcc2.c:1910: internal compiler error: in
default_secondary_reload, at targhooks.c:532
The compiler sources were pulled by Subversion from the gcc repository:
Path: .
URL:
Repository Root: svn://gcc.gnu.org/svn/gcc
Repository UUID:
Revision: 115899
Node Kind: directory
Schedule: normal
Last Changed Author: schwab
Last Changed Rev: 115899
Last Changed Date: 2006-08-03 10:28:37 +0100 (Thu, 03 Aug 2006)
Properties Last Updated: 2006-08-01 21:01:27 +0100 (Tue, 01 Aug 2006)
The binutils tools being used were:
warthog>./as
GNU assembler 2.14-frv-060512-1 20031112
And the tools necessary for the compiler can be obtained from:
http://people.redhat.com/~dhowells/frv/as
http://people.redhat.com/~dhowells/frv/ld
http://people.redhat.com/~dhowells/frv/ar
http://people.redhat.com/~dhowells/frv/ranlib
http://people.redhat.com/~dhowells/frv/nm
http://people.redhat.com/~dhowells/frv/objdump
http://people.redhat.com/~dhowells/frv/strip
in a huge tarball with lots of other stuff from:
I've reproduced this problem compiling gcc on on an SMP i686 box and a UP
x86_64 box. both boxes the native compiler was installed from the
gcc-4.1.1-1.fc5 Fedora Core 5 RPMs:
warthog>gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: /configure /usr /usr/share/man
/usr/share/info
,c++,objc,obj-c++,java,fortran,ada
/
Thread model: posix
gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)
warthog255>ssh hades gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: /configure /usr /usr/share/man
/usr/share/info
,c++,objc,obj-c++,java,fortran,ada
/
Thread model: posix
gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)
The partially built gcc claims its version to be:
warthog>./gcc/xgcc -v
Using built-in specs.
Target: frv-linux-gnu
Configured with: /gcc/configure /opt/frv-4.1
/opt/frv-4.1/frv-linux-gnu/bin/
/
Thread model: posix
gcc version 4.2.0 20060803 (experimental)
I configured the package with the configuration line you can see above and
then just ran "make".
The intermediate compiler can be used to trigger the bug with following
command line:
./gcc/xgcc -B./gcc -c wibble.c -o wibble.o
from within the build directory. wibble.c is the attached preprocessed and
stripped down version of libgcc2.c.
Note that adding:
#define __builtin_expect(X, Y) (X)
to the top of the file seems to make the problem go away.
David