Prerequisites: - gcc-4.7.2-r1 - ld.bfd linker (but ld.gold does not make a difference) - LTO flags /disabled/ - ccache /disabled/ - custom-cflags of firefox /disabled/ - custom-optimization of firefox /disabled/ - this is on x86 ATOM N270 platform I'll attach cave messages, output log, info and preprocessed source for 19.0.2, but tried 19.0 also - no difference. In short: <code> i686-pc-linux-gnu-g++ -o Stack.o -c -I./../../dist/system_wrappers_js -include /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/config/gcc_hidden.h -DENABLE_TYPEDARRAY_MOVE -DENABLE_YARR_JIT=1 -DMOZ_GLUE_IN_PROGRAM -DNO_NSPR_10_SUPPORT -DEXPORT_JS_API -DJS_HAS_CTYPES -DDLL_PREFIX=\"lib\" -DDLL_SUFFIX=\".so\" -DUSE_ZLIB -I/usr/lib/libffi-3.0.12/include -I. -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/../../mfbt/double-conversion -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src -I. -I./../../dist/include -I/usr/include/nspr -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/assembler -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/yarr -fPIC -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Werror=conversion-null -Wno-ctor-dtor-privacy -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros -Wcast-align -march=native -pipe -mno-avx -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -pthread -pipe -DNDEBUG -DTRIMMED -g -O2 -fomit-frame-pointer -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/Stack.o.pp /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/vm/Stack.cpp /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/vm/Stack.cpp: In member function 'js::StackIter& js::StackIter::operator++()': /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/vm/Stack.cpp:1541:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://bugs.gentoo.org/> for instructions. {standard input}: Assembler messages: {standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive make[5]: *** [Stack.o] Error 1 make[5]: Leaving directory `/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/js/src' make[4]: *** [libs_tier_js] Error 2 make[4]: Leaving directory `/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu' make[3]: Leaving directory `/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu' make[3]: *** [tier_js] Error 2 make[2]: *** [default] Error 2 make[2]: Leaving directory `/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu' make[1]: *** [realbuild] Error 2 make[1]: Leaving directory `/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release' make: *** [build] Error 2 /usr/libexec/paludis/utils/emake: emake returned error 2 !!! ERROR in www-client/firefox-19.0.2::gentoo: !!! In src_compile at line 6213 !!! emake failed </code> Greetings Reproducible: Always
Created attachment 341986 [details] output of /cave info firefox/
Created attachment 341988 [details] messages of /cave resolve -x firefox/
Created attachment 341990 [details] output of /cave resolve -x firefox/
Created attachment 341992 [details] preprocessed source for /LC_ALL=C i686-pc-linux-gnu-g++ -save-temps -o Stack.o [...] Stack.cpp/ gziped due to 1000kb limit
Created attachment 341994 [details] Stack.ii.gz (preprocessed source for /LC_ALL=C i686-pc-linux-gnu-g++ -save-temps -o Stack.o [...] Stack.cpp/
Created attachment 341996 [details] Stack.s (preprocessed source for /LC_ALL=C i686-pc-linux-gnu-g++ -save-temps -o Stack.o [...] Stack.cpp/
Please note that I recompiled whole system with gcc-4.7.2-r1, LTO and ld.gold enabled, about 700 packages on this platform with no unsolvable issues. Larger packages like GIMP built and work without problems. Note for testing firefox compile I did binutils-config --linker ld.bfd beforehand to ensure ld.bfd is used in all circumstances. Here is my complete /etc/paludis/bashrc for reference # paludis bashrc ARCH_CFLAGS="-march=native -O2 -fomit-frame-pointer -pipe -mfpmath=sse" ARCH_LDFLAGS="-Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common" CHOST="i686-pc-linux-gnu" CFLAGS="${ARCH_CFLAGS} -flto=1 -fuse-linker-plugin -floop-interchange -floop-strip-mine -floop-block" CXXFLAGS="${CFLAGS}" LDFLAGS="${CFLAGS} ${ARCH_LDFLAGS}" MAKEOPTS="-j1" case "${CATEGORY}/${PN}" in dev-util/anjuta) LDFLAGS="$LDFLAGS -lrt" ;;& sys-devel/binutils) EXTRA_ECONF="--enable-gold=default" ;;& sys-boot/grub) ;& DISABLE-GOLD-LINKER) LD="/usr/i686-pc-linux-gnu/binutils-bin/2.23.1/ld.bfd" ;;& app-text/rarian) ;& dev-lang/perl) ;& dev-lang/spidermonkey) ;& dev-libs/elfutils) ;& dev-libs/libaio) ;& media-libs/alsa-lib) ;& media-libs/mesa) ;& media-libs/netpbm) ;& media-video/ffmpeg) ;& sys-apps/pciutils) ;& sys-devel/llvm) ;& www-client/firefox) ;& x11-base/xorg-server) ;& x11-libs/cairo) ;& x11-misc/x11vnc) ;& DISABLE-LTO-FEATURES-OF-GCC) CFLAGS="${ARCH_CFLAGS}" CXXFLAGS="${CFLAGS}" LDFLAGS="${CFLAGS} ${ARCH_LDFLAGS}" ;;& esac
Also, this is not a RAM issue - the machine has 1GB physical with ~9GB configured as swap memory. I had top monitor RAM usage during the compile. While Stack.cpp is processed it maxes out at about a mere 189m (~18% relative). Thanks cmuelle8
A compile with gcc-4.6.3 on the same system, with otherwise unchanged prerequisites works.
(In reply to comment #8) > Also, this is not a RAM issue - the machine has 1GB physical with ~9GB > configured as swap memory. > > I had top monitor RAM usage during the compile. While Stack.cpp is > processed it maxes out at about a mere 189m (~18% relative). Could you check 'dmesg' or syslog for anything out of ordinary though? Your stack.ii compiles fine here, though I don't have atom to test it.
(In reply to comment #10) > > Could you check 'dmesg' or syslog for anything out of ordinary though? Your > stack.ii compiles fine here, though I don't have atom to test it. The machine is fine, I'm using the gcc-4.6.3 compiled version of FF 19.0.2 writing this right now. Dmesg/syslog report nothing suspicious. Also, I gave it a couple of tries before reporting - the error is reproducible, it errors out on the exact same file each time tried. Did you surely test with "-O2"? I noticed there is a difference between i686-pc-linux-gnu-g++ -fPIC -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Werror=conversion-null -Wno-ctor-dtor-privacy -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros -Wcast-align -march=native -pipe -mno-avx -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -pipe -DNDEBUG -DTRIMMED -g -O2 -fomit-frame-pointer -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -DMOZILLA_CLIENT -o Stack.o Stack.ii and i686-pc-linux-gnu-g++ -fPIC -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Werror=conversion-null -Wno-ctor-dtor-privacy -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros -Wcast-align -march=native -pipe -mno-avx -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -pipe -DNDEBUG -DTRIMMED -g -fomit-frame-pointer -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -DMOZILLA_CLIENT -o Stack.o Stack.ii but then, -O2 is a standard option set by some mozconfig eclass, so I suppose we find a fix or rework that eclass to not use -O2 for combination of firefox gcc-4.7.2 .. Greetings
$ echo "" | gcc -march=native -v -E - 2>&1 | grep cc1
(In reply to comment #12) > $ echo "" | gcc -march=native -v -E - 2>&1 | grep cc1 yields: /usr/libexec/gcc/i686-pc-linux-gnu/4.7.2/cc1 -E -quiet -v - -march=atom -mno-cx16 -msahf -mmovbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=atom
Reproduced on x86-64 with $ g++ -m32 -O2 -march=atom -o Stack.o Stack.ii
Also fails with gcc version 4.7.3-pre9999 20130314 (prerelease) commit eaf7c63943573e430f06d4001bdb2bc2941f666e (Gentoo 4.7.3_pre9999)
gdb --args gcc/cc1plus -m32 -mtune=atom -O2 ~xarth/Stack.ii Program received signal SIGSEGV, Segmentation fault. distance_non_agu_define_in_bb (regno1=3, regno2=4294967295, insn=0x7ffff059cd80, distance=2, start=<optimized out>, found=0x7fffffffdc7f "") at ../../gcc/config/i386/i386.c:16614 16614 if (prev == BB_HEAD (bb)) (gdb) bt #0 distance_non_agu_define_in_bb (regno1=3, regno2=4294967295, insn=0x7ffff059cd80, distance=2, start=<optimized out>, found=0x7fffffffdc7f "") at ../../gcc/config/i386/i386.c:16614 #1 0x00000000009c14d9 in distance_non_agu_define (insn=0x7ffff059cd80, regno2=4294967295, regno1=3) at ../../gcc/config/i386/i386.c:16668 #2 ix86_lea_outperforms (insn=0x7ffff059cd80, regno0=0, regno1=3, regno2=4294967295, split_cost=0) at ../../gcc/config/i386/i386.c:16838 #3 0x0000000000b5e27d in output_64 (operands=0x13da420, insn=0x7ffff059cd80) at ../../gcc/config/i386/i386.md:2169 #4 0x00000000006cd013 in final_scan_insn (insn=0x7ffff059cd80, file=0x143b460, optimize_p=<optimized out>, nopeepholes=<optimized out>, seen=0x7fffffffddec) at ../../gcc/final.c:2682 #5 0x00000000006cd8b6 in final (first=0x7ffff0d5b200, file=0x143b460, optimize_p=2) at ../../gcc/final.c:1786 #6 0x00000000006cdc36 in rest_of_handle_final () at ../../gcc/final.c:4319 #7 0x00000000007b25e8 in execute_one_pass (pass=0x1291dc0) at ../../gcc/passes.c:2084 #8 0x00000000007b2945 in execute_pass_list (pass=0x1291dc0) at ../../gcc/passes.c:2139 #9 0x00000000007b2957 in execute_pass_list (pass=0x1292b60) at ../../gcc/passes.c:2140 #10 0x00000000007b2957 in execute_pass_list (pass=0x1292bc0) at ../../gcc/passes.c:2140 #11 0x000000000088acc9 in tree_rest_of_compilation (fndecl=0x7ffff3f51f00) at ../../gcc/tree-optimize.c:422 #12 0x000000000063bb8a in cgraph_expand_function (node=0x7ffff1d25900) at ../../gcc/cgraphunit.c:1837 #13 0x000000000063d2fc in cgraph_expand_all_functions () at ../../gcc/cgraphunit.c:1904 #14 cgraph_optimize () at ../../gcc/cgraphunit.c:2218 #15 0x000000000063d84a in cgraph_finalize_compilation_unit () at ../../gcc/cgraphunit.c:1344 #16 0x00000000005192af in cp_write_global_declarations () at ../../gcc/cp/decl2.c:4053 #17 0x00000000008447c8 in compile_file () at ../../gcc/toplev.c:573 #18 do_compile () at ../../gcc/toplev.c:1941 #19 toplev_main (argc=5, argv=0x7fffffffe108) at ../../gcc/toplev.c:2017 #20 0x00007ffff716d6d5 in __libc_start_main () from /lib64/libc.so.6 #21 0x00000000004baf11 in _start ()
Fixed in trunk by: commit 8ee14c01c788aa62e6c8d827671f5f863ffc2acb Author: rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Thu Apr 19 12:44:07 2012 +0000 2012-04-19 Richard Guenther <rguenther@suse.de> * ira-int.h (ira_allocno_object_iter_cond): Avoid out-of-bound array access. http://gcc.gnu.org/viewcvs?view=revision&revision=186590 I'll reduce and file upstream bug asking to backport
(In reply to comment #17) > Fixed in trunk by: > > http://gcc.gnu.org/viewcvs?view=revision&revision=186590 > > I'll reduce and file upstream bug asking to backport I rebuilt gcc-4.7.2 to include the patch from that revision: --- ira-int.h 2012-01-19 21:46:31.000000000 +0100 +++ /root/Downloads/ira-int.h 2013-03-17 01:58:07.490876234 +0100 @@ -1138,8 +1138,13 @@ ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t a, ira_object_t *o) { - *o = ALLOCNO_OBJECT (a, i->n); - return i->n++ < ALLOCNO_NUM_OBJECTS (a); + int n = i->n++; + if (n < ALLOCNO_NUM_OBJECTS (a)) + { + *o = ALLOCNO_OBJECT (a, n); + return true; + } + return false; } /* Loop over all objects associated with allocno A. In each @@ -1416,3 +1421,6 @@ reg_costs[i] = val; } } + +extern rtx ira_create_new_reg (rtx); +extern int first_moveable_pseudo, last_moveable_pseudo; I checked twice for proper inclusion of the patch (and rebuilt gcc twice). However, a firefox compile with the patched gcc still errors out on the same occasion, same error. i686-pc-linux-gnu-g++ -o Stack.o -c -I./../../dist/system_wrappers_js -include /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/config/gcc_hidden.h -DENABLE_TYPEDARRAY_MOVE -DENABLE_YARR_JIT=1 -DMOZ_GLUE_IN_PROGRAM -DNO_NSPR_10_SUPPORT -DEXPORT_JS_API -DJS_HAS_CTYPES -DDLL_PREFIX=\"lib\" -DDLL_SUFFIX=\".so\" -DUSE_ZLIB -I/usr/lib/libffi-3.0.12/include -I. -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/../../mfbt/double-conversion -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src -I. -I./../../dist/include -I/usr/include/nspr -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/assembler -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/yarr -fPIC -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Werror=conversion-null -Wno-ctor-dtor-privacy -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros -Wcast-align -march=native -fomit-frame-pointer -pipe -mfpmath=sse -mno-avx -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -pthread -pipe -DNDEBUG -DTRIMMED -g -O2 -fomit-frame-pointer -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/Stack.o.pp /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/vm/Stack.cpp /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/vm/Stack.cpp: In member function 'js::StackIter& js::StackIter::operator++()': /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/vm/Stack.cpp:1541:1: internal compiler error: Segmentation fault Did you try with a complete gcc snapshot from trunk post commiting date, then trying to determine backwards which patch most probably fixed the issue? Or did you take the same route I did (using single patch on a version release)? In the former case I suppose it might be a different commit fixing the issue. I'm asking to determine wheter it's worth the effort to pull a gcc snapshot, one dating post April 2012. Thx
(In reply to comment #18) > (In reply to comment #17) > > Fixed in trunk by: > > > > http://gcc.gnu.org/viewcvs?view=revision&revision=186590 > > > > I'll reduce and file upstream bug asking to backport > > > I rebuilt gcc-4.7.2 to include the patch from that revision: > > --- ira-int.h 2012-01-19 21:46:31.000000000 +0100 > +++ /root/Downloads/ira-int.h 2013-03-17 01:58:07.490876234 +0100 > @@ -1138,8 +1138,13 @@ > ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t > a, > ira_object_t *o) > { > - *o = ALLOCNO_OBJECT (a, i->n); > - return i->n++ < ALLOCNO_NUM_OBJECTS (a); > + int n = i->n++; > + if (n < ALLOCNO_NUM_OBJECTS (a)) > + { > + *o = ALLOCNO_OBJECT (a, n); > + return true; > + } > + return false; > } > > /* Loop over all objects associated with allocno A. In each > @@ -1416,3 +1421,6 @@ > reg_costs[i] = val; > } > } > + > +extern rtx ira_create_new_reg (rtx); > +extern int first_moveable_pseudo, last_moveable_pseudo; > > > > I checked twice for proper inclusion of the patch (and rebuilt gcc twice). > However, a firefox compile with the patched gcc still errors out on the same > occasion, same error. > > i686-pc-linux-gnu-g++ -o Stack.o -c -I./../../dist/system_wrappers_js > -include > /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/ > config/gcc_hidden.h -DENABLE_TYPEDARRAY_MOVE -DENABLE_YARR_JIT=1 > -DMOZ_GLUE_IN_PROGRAM -DNO_NSPR_10_SUPPORT -DEXPORT_JS_API -DJS_HAS_CTYPES > -DDLL_PREFIX=\"lib\" -DDLL_SUFFIX=\".so\" -DUSE_ZLIB > -I/usr/lib/libffi-3.0.12/include -I. > -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/../. > ./mfbt/double-conversion > -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src -I. > -I./../../dist/include -I/usr/include/nspr > -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src > -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/ > assembler > -I/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/ > yarr -fPIC -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type > -Wtype-limits -Wempty-body -Werror=conversion-null -Wno-ctor-dtor-privacy > -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros > -Wcast-align -march=native -fomit-frame-pointer -pipe -mfpmath=sse -mno-avx > -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -pthread -pipe > -DNDEBUG -DTRIMMED -g -O2 -fomit-frame-pointer -DUSE_SYSTEM_MALLOC=1 > -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -DMOZILLA_CLIENT -include > ./js-confdefs.h -MD -MF .deps/Stack.o.pp > /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/vm/ > Stack.cpp > /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/vm/ > Stack.cpp: In member function 'js::StackIter& js::StackIter::operator++()': > /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/js/src/vm/ > Stack.cpp:1541:1: internal compiler error: Segmentation fault > > > > Did you try with a complete gcc snapshot from trunk post commiting date, > then trying to determine backwards which patch most probably fixed the > issue? Or did you take the same route I did (using single patch on a > version release)? No, I've run git bisect > In the former case I suppose it might be a different commit fixing the > issue. I'm asking to determine wheter it's worth the effort to pull a gcc > snapshot, one dating post April 2012. Could you compile gcc with debug flags (at least -g) and see if backtrace is the same as mine?
I've also tried to reduce your testcase, though it's a bit tricky and so far yielded invalid outcome, like ICE I've ended up with produced different backtrace...
Same problem here
(In reply to comment #19) > Could you compile gcc with debug flags (at least -g) and see if backtrace is > the same as mine? lgbox src # LC_ALL=C gdb --args /usr/libexec/gcc/i686-pc-linux-gnu/4.7.2/cc1plus -fpreprocessed Stack.ii -march=atom -mno-cx16 -msahf -mmovbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=atom -quiet -dumpbase Stack.ii -auxbase Stack -O2 -Wno-invalid-offsetof -version -o /tmp/ccIshfFi.s GNU gdb (Gentoo 7.5.1 p2) 7.5.1 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu". For bug reporting instructions, please see: <http://bugs.gentoo.org/>... Reading symbols from /usr/libexec/gcc/i686-pc-linux-gnu/4.7.2/cc1plus...done. (gdb) set environment COLLECT_GCC_OPTIONS '-v' '-march=native' '-O2' '-Wno-invalid-offsetof' (gdb) help show environment The environment to give the program, or one variable's value. With an argument VAR, prints the value of environment variable VAR to give the program being debugged. With no arguments, prints the entire environment to be given to the program. (gdb) show environment COLLECT_GCC_OPTIONS COLLECT_GCC_OPTIONS = '-v' '-march=native' '-O2' '-Wno-invalid-offsetof' (gdb) run Starting program: /usr/libexec/gcc/i686-pc-linux-gnu/4.7.2/cc1plus -fpreprocessed Stack.ii -march=atom -mno-cx16 -msahf -mmovbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=atom -quiet -dumpbase Stack.ii -auxbase Stack -O2 -Wno-invalid-offsetof -version -o /tmp/ccIshfFi.s warning: Could not load shared library symbols for linux-gate.so.1. Do you need "set solib-search-path" or "set sysroot"? GNU C++ (Gentoo 4.7.2-r1 p1.5, pie-0.5.5) version 4.7.2 (i686-pc-linux-gnu) compiled by GNU C version 4.7.2, GMP version 5.1.1, MPFR version 3.1.1-p2, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=90 --param ggc-min-heapsize=112470 GNU C++ (Gentoo 4.7.2-r1 p1.5, pie-0.5.5) version 4.7.2 (i686-pc-linux-gnu) compiled by GNU C version 4.7.2, GMP version 5.1.1, MPFR version 3.1.1-p2, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=90 --param ggc-min-heapsize=112470 Compiler executable checksum: ab6040dabab5fbc52f3336ab709c8b39 Program received signal SIGSEGV, Segmentation fault. 0x087a455f in distance_non_agu_define_in_bb (regno1=3, regno2=4294967295, insn=0xb35a7c18, distance=2, start=0xb35a79fc, found=0xbfffe85b) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.c:16502 16502 /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.c: No such file or directory. (gdb) bt #0 0x087a455f in distance_non_agu_define_in_bb (regno1=3, regno2=4294967295, insn=0xb35a7c18, distance=2, start=0xb35a79fc, found=0xbfffe85b) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.c:16502 #1 0x087a471d in distance_non_agu_define (regno1=3, regno2=4294967295, insn=0xb35a7c18) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.c:16560 #2 0x087a4b2e in ix86_lea_outperforms (insn=0xb35a7c18, regno0=0, regno1=3, regno2=4294967295, split_cost=0) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.c:16726 #3 0x087a4e56 in ix86_use_lea_for_mov (insn=0xb35a7c18, operands=0x90fd6e0 <recog_data>) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.c:16835 #4 0x089d8428 in output_64 (operands=0x90fd6e0 <recog_data>, insn=0xb35a7c18) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.md:2215 #5 0x08390705 in get_insn_template (code=64, insn=0xb35a7c18) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/final.c:1817 #6 0x083917cc in final_scan_insn (insn=0xb35a7c18, file=0x916a0b8, optimize_p=2, nopeepholes=0, seen=0xbfffea90) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/final.c:2682 #7 0x083905c7 in final (first=0xb35ac0e0, file=0x916a0b8, optimize_p=2) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/final.c:1786 #8 0x08393e2a in rest_of_handle_final () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/final.c:4319 #9 0x084d9f58 in execute_one_pass (pass=0x8fe8640 <pass_final>) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/passes.c:2084 #10 0x084da124 in execute_pass_list (pass=0x8fe8640 <pass_final>) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/passes.c:2139 #11 0x084da150 in execute_pass_list (pass=0x8fe8f80 <pass_postreload>) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/passes.c:2140 #12 0x084da150 in execute_pass_list (pass=0x8fe8f40 <pass_rest_of_compilation>) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/passes.c:2140 #13 0x086049a4 in tree_rest_of_compilation (fndecl=0xb58f9b00) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/tree-optimize.c:422 #14 0x082d7b34 in cgraph_expand_function (node=0xb44da3d8) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/cgraphunit.c:1837 #15 0x082d7d08 in cgraph_expand_all_functions () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/cgraphunit.c:1904 #16 0x082d8682 in cgraph_optimize () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/cgraphunit.c:2218 #17 0x082d6a55 in cgraph_finalize_compilation_unit () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/cgraphunit.c:1344 #18 0x08168b2d in cp_write_global_declarations () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/cp/decl2.c:4057 #19 0x085a2753 in compile_file () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/toplev.c:573 #20 0x085a46d9 in do_compile () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/toplev.c:1938 #21 0x085a4858 in toplev_main (argc=43, argv=0xbfffee14) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/toplev.c:2014 #22 0x08263bc8 in main (argc=43, argv=0xbfffee14) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/main.c:36 Sorry this has taken a while, since a) /usr/bin/gcc does not have any debug symbols one has to use "/usr/bin/gcc-4.7.2" to find out, if the compiler was indeed built using "-ggdb" .. b) /usr/bin/gcc-4.7.2 was not the process segfaulting, but gdb only attached to it, not its children by default - using "-v" flag to gcc-4.7.2 revealed which programm was run - used this to get a backtrace on cc1plus (see above for environment and args to cc1plus) I still wonder if there is some fancy option to gdb to let all childs started by a debugee be attached to gdb right away, without the detour of figuring out the segfaulting child by oneself and submitting that as an argument. Thx cmuelle8
The backtrace in comment #22 was produced with plain gcc-4.7.2-r1 from portage tree, the following one is from gcc-4.7.2-r1 with the patch applied suggested in comment #17 (ira-int.h). It does not seem to make a difference wrt the problem. lgbox src # LC_ALL=C gdb --args /usr/libexec/gcc/i686-pc-linux-gnu/4.7.2/cc1plus -fpreprocessed Stack.ii -march=atom -mno-cx16 -msahf -mmovbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=atom -quiet -dumpbase Stack.ii -auxbase Stack -O2 -Wno-invalid-offsetof -version -o /tmp/ccIshfFi.s GNU gdb (Gentoo 7.5.1 p2) 7.5.1 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu". For bug reporting instructions, please see: <http://bugs.gentoo.org/>... Reading symbols from /usr/libexec/gcc/i686-pc-linux-gnu/4.7.2/cc1plus...done. (gdb) set environment COLLECT_GCC_OPTIONS '-v' '-march=native' '-O2' '-Wno-invalid-offsetof' (gdb) run Starting program: /usr/libexec/gcc/i686-pc-linux-gnu/4.7.2/cc1plus -fpreprocessed Stack.ii -march=atom -mno-cx16 -msahf -mmovbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=atom -quiet -dumpbase Stack.ii -auxbase Stack -O2 -Wno-invalid-offsetof -version -o /tmp/ccIshfFi.s warning: Could not load shared library symbols for linux-gate.so.1. Do you need "set solib-search-path" or "set sysroot"? GNU C++ (Gentoo 4.7.2-r1 p1.5, pie-0.5.5) version 4.7.2 (i686-pc-linux-gnu) compiled by GNU C version 4.7.2, GMP version 5.1.1, MPFR version 3.1.1-p2, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=90 --param ggc-min-heapsize=112470 GNU C++ (Gentoo 4.7.2-r1 p1.5, pie-0.5.5) version 4.7.2 (i686-pc-linux-gnu) compiled by GNU C version 4.7.2, GMP version 5.1.1, MPFR version 3.1.1-p2, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=90 --param ggc-min-heapsize=112470 Compiler executable checksum: 8d4a4ff04a7e5f73aa4f5917a6a5ed0f Program received signal SIGSEGV, Segmentation fault. distance_non_agu_define_in_bb (regno1=regno1@entry=3, regno2=regno2@entry=4294967295, insn=insn@entry=0xb35a7c18, distance=distance@entry=2, start=0xb35a79fc, found=found@entry=0xbfffe9ef) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.c:16502 16502 /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.c: No such file or directory. (gdb) bt #0 distance_non_agu_define_in_bb (regno1=regno1@entry=3, regno2=regno2@entry=4294967295, insn=insn@entry=0xb35a7c18, distance=distance@entry=2, start=0xb35a79fc, found=found@entry=0xbfffe9ef) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.c:16502 #1 0x08646bd2 in distance_non_agu_define (insn=0xb35a7c18, regno2=4294967295, regno1=3) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.c:16560 #2 ix86_lea_outperforms (insn=0xb35a7c18, regno0=0, regno1=3, regno2=4294967295, split_cost=0) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.c:16726 #3 0x087d87fd in output_64 (operands=0x8da9300 <recog_data>, insn=0xb35a7c18) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/config/i386/i386.md:2215 #4 0x0831abb1 in final_scan_insn (insn=insn@entry=0xb35a7c18, file=file@entry=0x8e110b8, optimize_p=optimize_p@entry=2, nopeepholes=nopeepholes@entry=0, seen=seen@entry=0xbfffeadc) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/final.c:2682 #5 0x0831b474 in final (first=0xb35ac0e0, file=0x8e110b8, optimize_p=2) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/final.c:1786 #6 0x0831b81b in rest_of_handle_final () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/final.c:4319 #7 0x08413d14 in execute_one_pass (pass=pass@entry=0x8c8f520 <pass_final>) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/passes.c:2084 #8 0x0841407d in execute_pass_list (pass=0x8c8f520 <pass_final>) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/passes.c:2139 #9 0x08414090 in execute_pass_list (pass=0x8c8fde0 <pass_postreload>) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/passes.c:2140 #10 0x08414090 in execute_pass_list (pass=0x8c8fe20 <pass_rest_of_compilation>) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/passes.c:2140 #11 0x084f6b35 in tree_rest_of_compilation (fndecl=0xb58f9b00) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/tree-optimize.c:422 #12 0x0827cda5 in cgraph_expand_function (node=0xb44da3d8) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/cgraphunit.c:1837 #13 0x0827e6d5 in cgraph_expand_all_functions () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/cgraphunit.c:1904 #14 cgraph_optimize () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/cgraphunit.c:2218 #15 0x0827ec0f in cgraph_finalize_compilation_unit () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/cgraphunit.c:1344 #16 0x0814f6eb in cp_write_global_declarations () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/cp/decl2.c:4057 #17 0x084aea7a in compile_file () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/toplev.c:573 #18 do_compile () at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/toplev.c:1938 #19 toplev_main (argc=43, argv=0xbfffee14) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/toplev.c:2014 #20 0x08223e0c in main (argc=43, argv=0xbfffee14) at /var/tmp/paludis/sys-devel-gcc-4.7.2-r1/work/gcc-4.7.2/gcc/main.c:36
Created attachment 343068 [details] reduced case test Bisecting once again...
(In reply to comment #24) > Created attachment 343068 [details] > reduced case test > > Bisecting once again... Seems to be gone in trunk with following: a2b85e40cf2dd5a7174685077c7d54fc8a67ac45 is the first bad commit commit a2b85e40cf2dd5a7174685077c7d54fc8a67ac45 Author: vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Sat Apr 14 12:17:41 2012 +0000 2012-04-14 Tom de Vries <tom@codesourcery.com> * cfgcleanup.c (try_optimize_cfg): Replace call to delete_insn_chain by call to delete_insn. Remove code to reorder BASIC_BLOCK note and DELETED_LABEL note, and move it to ... * cfgrtl.c (delete_insn): ... here. Change return type to void. (delete_insn_and_edges): Likewise. (delete_insn_chain): Handle new return type of delete_insn. Delete chain backwards rather than forwards. * rtl.h (delete_insn, delete_insn_and_edges): Change return type to void. * cfglayout.c (fixup_reorder_chain): Delete unused label. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186451 138bc75d-0d04-0410-961f-82ee72b054a4
Thanks for digging into this and reporting the bug to the gcc guys. Let's hope for a backport in 4.7.3 Meanwhile I tried clang as well, but it's not a breeze either (put a link in "see also" field). Some patches I could figure out myself, so -O2 building works. Greetings
Same problem here. Using gcc-4.6.3 compiles firefox-19.0.2 successfully where 4.7.2 fails on my i686 Intel(R) Atom(TM) CPU N270 @ 1.60GHz with 1GB RAM and 4GB swap.
*** Bug 468472 has been marked as a duplicate of this bug. ***
I think you nailed the offending commit, but the fix seems to be just papering over the problem. Still present in 4.7.3 in any case.
*** Bug 484462 has been marked as a duplicate of this bug. ***
Same problem here. Can't compile postgresql-server-9.3.2: pgtz.c: In function ‘pg_tzenumerate_start’: pgtz.c:392:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://bugs.gentoo.org/> for instructions. {standard input}: Assembler messages: {standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
*** Bug 499898 has been marked as a duplicate of this bug. ***
*** Bug 503202 has been marked as a duplicate of this bug. ***
*** Bug 515714 has been marked as a duplicate of this bug. ***
*** Bug 525422 has been marked as a duplicate of this bug. ***
I can confirm that switching to gcc-4.8.3 from test branch solves the problem.
gcc-4.9 is stable now, so throwing away older bugs we don't plan on doing backports for as this should be fixed w/4.9+. please re-open if it's still an issue with 4.9.3+ though.