$ g++-4.3-20070907 -v Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4.3-20070907/configure --program-suffix=-4.3-20070907 --enable-language=c,c++ --prefix=/home/jack/opt --with-mpfr=/home/jack/opt Thread model: posix gcc version 4.3.0 20070907 (experimental) (GCC) $ g++-4.3-20070907 -fpic -O1 -c seed.i -o seed.o src/seed.cpp: In member function ‘virtual void Botan::SEED::enc(const Botan::byte*, Botan::byte*) const’: src/seed.cpp:52: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. Results with other flags: -fpic: OK -fPIC: OK -O1: FAIL -O2: OK -O1 -fpic: FAIL -O1 -fPIC: FAIL -O2 -fpic: FAIL -O2 -fPIC: FAIL
Created attachment 14363 [details] Testcase
Backtrace (command line args for cc1plus chosen by stracing g++) $ gdb /home/jack/opt/libexec/gcc/x86_64-unknown-linux-gnu/4.3.0/cc1plus Using host libthread_db library "/lib64/libthread_db.so.1". (gdb) run -fpreprocessed seed.i -quiet -dumpbase seed.i -mtune=generic -auxbase-strip seed.o -O1 -fpic -o /tmp/whatever.o Starting program: /home/jack/opt/libexec/gcc/x86_64-unknown-linux-gnu/4.3.0/cc1plus -fpreprocessed seed.i -quiet -dumpbase seed.i -mtune=generic -auxbase-strip seed.o -O1 -fpic -o /tmp/whatever.o Program received signal SIGSEGV, Segmentation fault. 0x00000000007a94f5 in reload_as_needed (live_known=1) at ../../gcc-4.3-20070907/gcc/reload1.c:4161 4161 if (p != insn && INSN_P (p) (gdb) backtrace #0 0x00000000007a94f5 in reload_as_needed (live_known=1) at ../../gcc-4.3-20070907/gcc/reload1.c:4161 #1 0x00000000007acb61 in reload (first=0x2b0f45955680, global=1) at ../../gcc-4.3-20070907/gcc/reload1.c:1146 #2 0x0000000000b39c96 in rest_of_handle_global_alloc () at ../../gcc-4.3-20070907/gcc/global.c:683 #3 0x0000000000761961 in execute_one_pass (pass=0x1001b60) at ../../gcc-4.3-20070907/gcc/passes.c:1115 #4 0x0000000000761b40 in execute_pass_list (pass=0x1001b60) at ../../gcc-4.3-20070907/gcc/passes.c:1168 #5 0x0000000000761b55 in execute_pass_list (pass=0xffd5a0) at ../../gcc-4.3-20070907/gcc/passes.c:1169 #6 0x000000000083de10 in tree_rest_of_compilation (fndecl=0x2b0f457c8400) at ../../gcc-4.3-20070907/gcc/tree-optimize.c:404 #7 0x00000000009acb80 in cgraph_expand_function (node=0x2b0f45810700) at ../../gcc-4.3-20070907/gcc/cgraphunit.c:1077 #8 0x00000000009aee20 in cgraph_optimize () at ../../gcc-4.3-20070907/gcc/cgraphunit.c:1146 #9 0x00000000004aafed in cp_write_global_declarations () at ../../gcc-4.3-20070907/gcc/cp/decl2.c:3302 #10 0x00000000007e48b7 in toplev_main (argc=Variable "argc" is not available. ) at ../../gcc-4.3-20070907/gcc/toplev.c:1058 #11 0x0000003a3d61c784 in __libc_start_main () from /lib64/libc.so.6 #12 0x0000000000403d79 in _start () #13 0x00007fffffb66e48 in ?? () #14 0x0000000000000000 in ?? () (gdb) print p $1 = 0x0 (gdb) print insn $2 = 0x2b0f459890f0 (gdb) print *insn $3 = {code = INSN, mode = VOIDmode, jump = 0, call = 0, unchanging = 0, volatil = 0, in_struct = 0, used = 0, frame_related = 0, return_val = 0, u = {fld = {{rt_int = 15, rt_uint = 15, rt_str = 0xafafafaf0000000f <Address 0xafafafaf0000000f out of bounds>, rt_rtx = 0xafafafaf0000000f, rt_rtvec = 0xafafafaf0000000f, rt_type = HImode, rt_addr_diff_vec_flags = {min_align = 15, base_after_vec = 0, min_after_vec = 0, max_after_vec = 0, min_after_base = 0, max_after_base = 0, offset_unsigned = 0, scale = 0}, rt_cselib = 0xafafafaf0000000f, rt_bit = 0xafafafaf0000000f, rt_tree = 0xafafafaf0000000f, rt_bb = 0xafafafaf0000000f, rt_mem = 0xafafafaf0000000f, rt_reg = 0xafafafaf0000000f, rt_constant = 0xafafafaf0000000f}}, hwint = {-5787213829993660401}, block_sym = {fld = {{rt_int = 15, rt_uint = 15, rt_str = 0xafafafaf0000000f <Address 0xafafafaf0000000f out of bounds>, rt_rtx = 0xafafafaf0000000f, rt_rtvec = 0xafafafaf0000000f, rt_type = HImode, rt_addr_diff_vec_flags = {min_align = 15, base_after_vec = 0, min_after_vec = 0, max_after_vec = 0, min_after_base = 0, max_after_base = 0, offset_unsigned = 0, scale = 0}, rt_cselib = 0xafafafaf0000000f, rt_bit = 0xafafafaf0000000f, rt_tree = 0xafafafaf0000000f, rt_bb = 0xafafafaf0000000f, rt_mem = 0xafafafaf0000000f, rt_reg = 0xafafafaf0000000f, rt_constant = 0xafafafaf0000000f}, {rt_int = 1167626240, rt_uint = 1167626240, rt_str = 0x2b0f45989000 "\005", rt_rtx = 0x2b0f45989000, rt_rtvec = 0x2b0f45989000, rt_type = 1167626240, rt_addr_diff_vec_flags = {min_align = 0, base_after_vec = 0, min_after_vec = 0, max_after_vec = 0, min_after_base = 0, max_after_base = 1, offset_unsigned = 0, scale = 152}, rt_cselib = 0x2b0f45989000, rt_bit = 0x2b0f45989000, rt_tree = 0x2b0f45989000, rt_bb = 0x2b0f45989000, rt_mem = 0x2b0f45989000, rt_reg = 0x2b0f45989000, rt_constant = 0x2b0f45989000}, {rt_int = 1157078704, rt_uint = 1157078704, rt_str = 0x2b0f44f79eb0 "\005", rt_rtx = 0x2b0f44f79eb0, rt_rtvec = 0x2b0f44f79eb0, rt_type = 1157078704, rt_addr_diff_vec_flags = {min_align = 176, base_after_vec = 0, min_after_vec = 1, max_after_vec = 1, min_after_base = 1, max_after_base = 1, offset_unsigned = 0, scale = 247}, rt_cselib = 0x2b0f44f79eb0, rt_bit = 0x2b0f44f79eb0, rt_tree = 0x2b0f44f79eb0, rt_bb = 0x2b0f44f79eb0, rt_mem = 0x2b0f44f79eb0, rt_reg = 0x2b0f44f79eb0, rt_constant = 0x2b0f44f79eb0}}, block = 0x2b0f45948900, offset = -5787213829993660410}, rv = {cl = 3, decimal = 1, sign = 1, signalling = 0, canonical = 0, uexp = 0, sig = {47344592130048, 47344581582512, 47344591866112}}, fv = {data = {low = 12659530243715891215, high = 47344592130048}, mode = 1157078704}}}
Seemingly fixed in 4.3.0 or 4.3.1, closing this pr. Tested attached testcase with $ g++ -v Using built-in specs. Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.1 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.1 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.1/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.1/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-cld --disable-libgcj --enable-languages=c,c++,objc,obj-c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.1-r1 p1.1' Thread model: posix gcc version 4.3.1 (Gentoo 4.3.1-r1 p1.1) All cases that had failed with the 20070907 snapshot worked fine.