This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Internal compiler error with egcs 2.91.34 on a 1MB+ function
- To: egcs-bugs at cygnus dot com
- Subject: Internal compiler error with egcs 2.91.34 on a 1MB+ function
- From: Andreas Jaeger <aj at arthur dot rhein-neckar dot de>
- Date: Sun, 7 Jun 1998 23:32:14 +0200 (CEST)
- CC: Ulrich Drepper <drepper at cygnus dot com>
I configured glibc 2.0.94 on my system running egcs 2.91.34, Linux
2.1.104 with:
../libc/configure --prefix=/usr/glibc/glibc-2.1 --disable-profile \
--without-cvs --enable-add-ons --enable-omitfp
Compiling the file nss/nsswitch.c with the following command line:
/opt/egcs/bin/gcc nsswitch.c -c -O -Wall -Winline -Wno-parentheses
-Wstrict-prototypes -Wwrite-strings -g -fPIC -g0 \
-fomit-frame-pointer -D__USE_STRING_INLINES \
-I. -I/usr/glibc/src/build-2.1/nss -I.. -I../include -I../libio \
-I/usr/glibc/src/build-2.1 -I../sysdeps/i386/elf \
-I../crypt/sysdeps/unix -I../linuxthreads/sysdeps/unix/sysv/linux \
-I../linuxthreads/sysdeps/pthread -I../linuxthreads/sysdeps/unix/sysv \
-I../linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/i386 \
-I../linuxthreads/sysdeps/pthread/no-cmpxchg \
-I../sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux \
-I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman \
-I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386 \
-I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../sysdeps/unix \
-I../sysdeps/posix -I../sysdeps/i386/i486 -I../sysdeps/i386/fpu \
-I../sysdeps/libm-i387 -I../sysdeps/i386 -I../sysdeps/wordsize-32 \
-I../sysdeps/ieee754 -I../sysdeps/libm-ieee754 -I../sysdeps/generic \
-D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -o \
/usr/glibc/src/build-2.1/nss/nsswitch.os
gives an internal compiler error:
gcc: Internal compiler error: program cc1 got fatal signal 11
After generating the .i file with -save-temps and running cc1 on it, I
got the following backtrace:
(gdb) r nsswitch.i -quiet -g0 -O99 -Wall -Winline -Wno-parentheses -Wstrict-prot
otypes -Wwrite-strings -version -fPIC -fomit-frame-pointer -o /tmp/ccZpQTKu.s
GNU C version egcs-2.91.34 19980605 (gcc2 ss-980502 experimental) (i486-pc-linux-gnu) compiled by GNU C version egcs-2.91.34 19980605 (gcc2 ss-980502 experimental).
Program received signal SIGSEGV, Segmentation fault.
init_alias_analysis () at ../../egcs-cvs/gcc/alias.c:1038
../../egcs-cvs/gcc/alias.c:1038: No such file or directory.
(gdb) bt
#0 init_alias_analysis () at ../../egcs-cvs/gcc/alias.c:1038
#1 0x814aa8d in schedule_insns (dump_file=0x0)
at ../../egcs-cvs/gcc/sched.c:4321
#2 0x8069371 in rest_of_compilation (decl=0x83b2a58)
at ../../egcs-cvs/gcc/toplev.c:3542
#3 0x80588da in finish_function (nested=0) at ../../egcs-cvs/gcc/c-decl.c:7124
#4 0x8049b97 in yyparse () at c-parse.y:348
#5 0x8067dae in compile_file (name=0xbffffb69 "nsswitch.i")
at ../../egcs-cvs/gcc/toplev.c:2552
#6 0x806a682 in main (argc=15, argv=0xbffff9f4, envp=0xbffffa34)
at ../../egcs-cvs/gcc/toplev.c:4398
#7 0x4002c432 in __libc_start_main (main=0x8069630 <main>, argc=15,
argv=0xbffff9f4, init=0x8048f10 <_init>, fini=0x8179f50 <_fini>,
rtld_fini=0x4000a720 <_dl_fini>) at ../sysdeps/generic/libc-start.c:74
The problem seems to be the function nss_lookup_function which has
expanded a size of a bit over 1 MB. Using -O0 instead of -O99 on the
.c file generates a much smaller .i file (154k instead of 1.3M) since
no functions are inlined - and succeeds.
I don't think it's wise to mail the whole 1.3M .i-file to egcs-bugs.
If anybody likes to look into this, please tell me and I can send you
the file directly. Since the compiler error happens with this large
function (I removed it and egcs compiled the file fine) I don't see
much chance to make the file much shorter:-(.
Andreas
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@alma.student.uni-kl.de