Bug 23442 - Compiler fails to build - internal compiler error: in do_SUBST, at combine.c:462
Summary: Compiler fails to build - internal compiler error: in do_SUBST, at combine.c:462
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.0.1
: P2 normal
Target Milestone: 4.2.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build, ice-on-valid-code
Depends on: 22001
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-17 13:46 UTC by Hamish Moffatt
Modified: 2006-08-30 21:38 UTC (History)
5 users (show)

See Also:
Host: x86_64-linux-gnu
Target: m68k-unknown-elf
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
The preprocessed source file causing the error (1.56 KB, application/octet-stream)
2006-03-21 21:30 UTC, Jens Arnold
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hamish Moffatt 2005-08-17 13:46:42 UTC
Attempting to build a cross-compiler for m68k-unknown-elf on x86_64-linux-gnu
fails with an internal error:

/home/hamish/projects/rockbox/gcc-4/orig/build/gcc/xgcc
-B/home/hamish/projects/rockbox/gcc-4/orig/build/gcc/
-B/home/hamish/m68k-amd64/m68k-elf/bin/ -B/home/hamish/m68k-amd64/m68k-elf/lib/
-isystem /home/hamish/m68k-amd64/m68k-elf/include -isystem
/home/hamish/m68k-amd64/m68k-elf/sys-include -O2  -DIN_GCC -DCROSS_COMPILE   -W
-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition  -isystem ./include   -g  -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc-4.0.1/gcc
-I../../gcc-4.0.1/gcc/. -I../../gcc-4.0.1/gcc/../include
-I../../gcc-4.0.1/gcc/../libcpp/include  -m68000 -DL_fixdfdi -c
../../gcc-4.0.1/gcc/libgcc2.c -o libgcc/m68000/_fixdfdi.o
../../gcc-4.0.1/gcc/libgcc2.c: In function '__fixdfdi':
../../gcc-4.0.1/gcc/libgcc2.c:1256: internal compiler error: in do_SUBST, at
combine.c:462

The host compiler is
gcc version 4.0.2 20050806 (prerelease) (Debian 4.0.1-4)

The same internal error occurs trying to build gcc-3.4.4,
using either gcc-4.0.2 or gcc-3.4.4.

The configure command was
../gcc-4.0.1/configure --prefix=$HOME/m68k-amd64 --target=m68k-unknown-elf
--enable-languages=c

Google found someone else had this problem with a sparc64 host:
http://www.rtems.com/ml/rtems-users/2005/june/msg00025.html
And someone else had this problem on x86_64 with gcc-3.4:
http://mailman.uclinux.org/pipermail/uclinux-dev/2005-June/033210.html

Hamish
Comment 1 Andrew Pinski 2005-08-17 15:08:55 UTC
Another report is in PR 22001 for m68k-rtems but I don't know what host it is on.

This might be a bug in the target files not understanding HWI as 64bits.
Comment 2 Jens Arnold 2006-03-21 21:11:47 UTC
This happens with *all* versions of m68k-elf-gcc I tried to build (3.3.6, 3.4.5, 3.4.6, 4.0.2, 4.0.3).

Host gcc:
gcc version 4.0.3 20060212 (prerelease) (Debian 4.0.2-9)

Example: m68k-elf-gcc 3.4.6, configured with: 
../../gcc-3.4.6/configure --target=m68k-elf --prefix=/opt/m68k --enable-languages=c

Result:
/home/jens/build/gcc/gcc/xgcc -B/home/jens/build/gcc/gcc/
-B/opt/m68k/m68k-elf/bin/ -B/opt/m68k/m68k-elf/lib/ -isystem /opt/m68k/m68k-elf/include -isystem /opt/m68k/m68k-elf/sys-include -O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../../gcc-3.4.6/gcc -I../../../gcc-3.4.6/gcc/. -I../../../gcc-3.4.6/gcc/../include   -m68000 -DL_fixdfdi -c ../../../gcc-3.4.6/gcc/libgcc2.c -o libgcc/m68000/_fixdfdi.o
../../../gcc-3.4.6/gcc/libgcc2.c: In function `__fixdfdi':
../../../gcc-3.4.6/gcc/libgcc2.c:1277: internal compiler error: in do_SUBST, at combine.c:447
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[2]: *** [libgcc/m68000/_fixdfdi.o] Fehler 1
make[2]: Leaving directory `/home/jens/build/gcc/gcc'
make[1]: *** [stmp-multilib] Fehler 2
make[1]: Leaving directory `/home/jens/build/gcc/gcc'
make: *** [all-gcc] Fehler 2

The line numbers vary with gcc versions, but it's always an ICE of xgcc in do_SUBST (combine.c), trying to compile _fixdfdi (libgcc2.c)
Comment 3 Jens Arnold 2006-03-21 21:30:14 UTC
Created attachment 11085 [details]
The preprocessed source file causing the error
Comment 4 Gabriel de Perthuis 2006-04-23 23:57:21 UTC
This is annoying, all of these fail:
3.4.5, 3.4.6, 4.0.3, 4.1.0
I've tried to build from i386-linux-gnu instead of x86_64-linux-gnu by passing
--host=i386 --target=m68k-elf to the configure script, to no avail.
Comment 5 Kazu Hirata 2006-05-08 16:44:51 UTC
Not reproducible.

I built a m68k-elf toolchain on x86_64-pc-linux-gnu and compiled the testcase.
No ICE was observed.
Comment 6 Luke Powell 2006-08-29 14:21:45 UTC
(In reply to comment #5)
> Not reproducible.
> 
> I built a m68k-elf toolchain on x86_64-pc-linux-gnu and compiled the testcase.
> No ICE was observed.
> 
I am also seeing this bug with v4.1.1. My configure line was
../gcc-4.1.1/configure --target=m68k-elf --prefix=/home/lpowell/m68k-gcc --disable-shared --with-gnu-as --with-gnu-ld --with-newlib --without-headers --enable-languages=c --with-local-prefix=/home/lpowell/m68k-gcc/m68k-elf

The final command and output was

/home/lpowell/build-gcc/./gcc/xgcc -B/home/lpowell/build-gcc/./gcc/ -B/home/lpowell/m68k-gcc/m68k-elf/bin/ -B/home/lpowell/m68k-gcc/m68k-elf/lib/ -isystem /home/lpowell/m68k-gcc/m68k-elf/include -isystem /home/lpowell/m68k-gcc/m68k-elf/sys-include -O2  -O2 -g -O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc-4.1.1/gcc -I../../gcc-4.1.1/gcc/. -I../../gcc-4.1.1/gcc/../include -I../../gcc-4.1.1/gcc/../libcpp/include  -m68000 -DL_fixdfdi -c ../../gcc-4.1.1/gcc/libgcc2.c -o libgcc/m68000/_fixdfdi.o
../../gcc-4.1.1/gcc/libgcc2.c: In function ‘__fixdfdi’:
../../gcc-4.1.1/gcc/libgcc2.c:1238: internal compiler error: in do_SUBST, at combine.c:470

My build gcc version is 4.1.1. I'm running on AMD x86-64, GNU/Linux 2.4.1.
Comment 7 Andrew Pinski 2006-08-30 21:38:16 UTC
*** Bug 28911 has been marked as a duplicate of this bug. ***