This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
As of LAST_UPDATED Tue Jun 28 05:54:07 UTC 2005 on x86_64-linux: ... ../../xgcc -B../../ -c -g -O2 -fPIC -W -Wall -gnatpg a-strfix.adb -o a-strfix.o raised STORAGE_ERROR : stack overflow (or erroneous memory access) make[7]: *** [a-strfix.o] Error 1 make[7]: Leaving directory `/home/guerby/work/gcc/build/build-20050628T075528/gcc/ada/rts' make[6]: *** [gnatlib] Error 2 (gdb) r -quiet -dumpbase a-strfix.adb -O2 -W -Wall -fPIC -g -gnatpg -mtune=k8 -gnatO a-strfix.o a-strfix.adb -o /tmp/ccm3U70P.s Starting program: /home/guerby/work/gcc/build/build-20050628T075528/gcc/gnat1 -quiet -dumpbase a-strfix.adb -O2 -W -Wall -fPIC -g -gnatpg -mtune=k8 -gnatO a-strfix.o a-strfix.adb -o /tmp/ccm3U70P.s Program received signal SIGSEGV, Segmentation fault. is_gimple_variable (t=0x0) at /home/guerby/work/gcc/version-head/gcc/tree-gimple.c:239 239 return (TREE_CODE (t) == VAR_DECL (gdb) bt #0 is_gimple_variable (t=0x0) at /home/guerby/work/gcc/version-head/gcc/tree-gimple.c:239 #1 0x000000000064b4b9 in is_gimple_val (t=0x0) at /home/guerby/work/gcc/version-head/gcc/tree-gimple.c:357 #2 0x0000000000652b80 in force_gimple_operand (expr=0x0, stmts=0x7fbffff378, simple=0 '\0', var=0x2a960ee340) at /home/guerby/work/gcc/version-head/gcc/gimplify.c:4843 #3 0x00000000006d947d in rewrite_use_nonlinear_expr (data=0x7fbffff5c0, use=0x1361e10, cand=Variable "cand" is not available. ) at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-ivopts.c:5359 #4 0x00000000006dccce in rewrite_uses (data=0x7fbffff5c0) at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-ivopts.c:5711 #5 0x00000000006de53e in tree_ssa_iv_optimize_loop (data=0x7fbffff5c0, loop=Variable "loop" is not available. ) at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-ivopts.c:5935 #6 0x00000000006debb5 in tree_ssa_iv_optimize (loops=0x1294970) at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-ivopts.c:5972 #7 0x0000000000649e56 in execute_one_pass (pass=0xcb0320) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:714 #8 0x0000000000649fac in execute_pass_list (pass=0xcb0320) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:751 #9 0x0000000000649fbe in execute_pass_list (pass=0xcaff60) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:752 #10 0x0000000000649fbe in execute_pass_list (pass=0xcaa1a0) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:752 #11 0x000000000064a235 in tree_rest_of_compilation (fndecl=0x2a95a7a410) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:914 #12 0x00000000009939c6 in cgraph_expand_function (node=0x2a95df6c30) at /home/guerby/work/gcc/version-head/gcc/cgraphunit.c:1033 #13 0x0000000000995966 in cgraph_optimize () at /home/guerby/work/gcc/version-head/gcc/cgraphunit.c:1099 #14 0x000000000041b44a in gnat_parse_file (set_yydebug=Variable "set_yydebug" is not available. ) at /home/guerby/work/gcc/version-head/gcc/ada/misc.c:245 #15 0x0000000000922633 in toplev_main (argc=Variable "argc" is not available. ) at /home/guerby/work/gcc/version-head/gcc/toplev.c:966 #16 0x0000002a957963c1 in __libc_start_main () from /lib/libc.so.6 #17 0x0000000000402d2a in _start () at ../sysdeps/x86_64/elf/start.S:96 Works at -O0, fails at -O1 and -O2. It also works on x86-linux.
Also an ivopt SEGV during gnattools: ../../xgcc -c -I./ -I../rts -I. -I/home/guerby/work/gcc/version-head/gcc/ada -B../../ -g -O2 -gnatpg -gnata -I- /home/guerby/work/gcc/version-head/gcc/ada/vms_conv.adb raised STORAGE_ERROR : stack overflow (or erroneous memory access) gnatmake: "/home/guerby/work/gcc/version-head/gcc/ada/vms_conv.adb" compilation error make[3]: *** [../../gnat] Error 4 make[3]: Leaving directory `/home/guerby/work/gcc/build/build-20050628T091109/gcc/ada/tools' make[2]: *** [gnattools-native] Error 2 (gdb) r -I./ -I../rts -I. -I/home/guerby/work/gcc/version-head/gcc/ada -I- -quiet -dumpbase vms_conv.adb -O2 -g -gnatpg -gnata -mtune=k8 /home/guerby/work/gcc/version-head/gcc/ada/vms_conv.adb -o /tmp/ccQaWUK3.s Starting program: /home/guerby/work/gcc/build/build-20050628T091109/gcc/gnat1 -I./ -I../rts -I. -I/home/guerby/work/gcc/version-head/gcc/ada -I- -quiet -dumpbase vms_conv.adb -O2 -g -gnatpg -gnata -mtune=k8 /home/guerby/work/gcc/version-head/gcc/ada/vms_conv.adb -o /tmp/ccQaWUK3.s Program received signal SIGSEGV, Segmentation fault. 0x00000000007b1e92 in record_block_change (block=0x2a97115620) at /home/guerby/work/gcc/version-head/gcc/function.c:5463 5463 last_block = VARRAY_TOP_TREE (cfun->ib_boundaries_block); (gdb) bt #0 0x00000000007b1e92 in record_block_change (block=0x2a97115620) at /home/guerby/work/gcc/version-head/gcc/function.c:5463 #1 0x000000000077b281 in expand_expr_real (exp=0x2a973c4d20, target=0x0, tmode=DImode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at /home/guerby/work/gcc/version-head/gcc/expr.c:6423 #2 0x0000000000772d78 in expand_expr_real_1 (exp=0x2a97709b40, target=0x2a959bc400, tmode=Variable "tmode" is not available. ) at expr.h:489 #3 0x000000000077b185 in expand_expr_real (exp=0x2a97709b40, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at /home/guerby/work/gcc/version-head/gcc/expr.c:6431 #4 0x000000000077ba05 in expand_operands (exp0=0x2a97709b40, exp1=0x2a97425770, target=0x0, op0=0x7fbfffe488, op1=0x7fbfffe480, modifier=EXPAND_NORMAL) at expr.h:489 #5 0x00000000007726e6 in expand_expr_real_1 (exp=0x2a973c4e60, target=0x2a959bc400, tmode=Variable "tmode" is not available. ) at /home/guerby/work/gcc/version-head/gcc/expr.c:8384 #6 0x000000000077b185 in expand_expr_real (exp=0x2a973c4e60, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at /home/guerby/work/gcc/version-head/gcc/expr.c:6431 #7 0x0000000000776aa4 in expand_expr_real_1 (exp=Variable "exp" is not available. ) at expr.h:489 #8 0x000000000077b185 in expand_expr_real (exp=0x2a97709d40, target=0x0, tmode=DImode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at /home/guerby/work/gcc/version-head/gcc/expr.c:6431 #9 0x000000000077bdf3 in expand_expr_addr_expr_1 (exp=0x2a95bfccb0, target=0x0, tmode=DImode, modifier=EXPAND_NORMAL) at expr.h:489 #10 0x0000000000773f6a in expand_expr_real_1 (exp=Variable "exp" is not available. ) at /home/guerby/work/gcc/version-head/gcc/expr.c:6318 #11 0x000000000077b185 in expand_expr_real (exp=0x2a97709a80, target=0x0, tmode=SImode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at /home/guerby/work/gcc/version-head/gcc/expr.c:6431 #12 0x0000000000772d78 in expand_expr_real_1 (exp=0x2a97709a40, target=0x2a959bc400, tmode=Variable "tmode" is not available. ) at expr.h:489 #13 0x000000000077b185 in expand_expr_real (exp=0x2a97709a40, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at /home/guerby/work/gcc/version-head/gcc/expr.c:6431 #14 0x000000000077ba1a in expand_operands (exp0=0x2a97709bc0, exp1=0x2a97709a40, target=0x0, op0=0x7fbfffec88, op1=0x7fbfffec80, modifier=EXPAND_NORMAL) at expr.h:489 #15 0x00000000007726e6 in expand_expr_real_1 (exp=0x2a973c4d70, target=0x2a959bc400, tmode=Variable "tmode" is not available. ) at /home/guerby/work/gcc/version-head/gcc/expr.c:8384 #16 0x000000000077b185 in expand_expr_real (exp=0x2a973c4d70, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at /home/guerby/work/gcc/version-head/gcc/expr.c:6431 #17 0x000000000077ba05 in expand_operands (exp0=0x2a973c4d70, exp1=0x2a97709b80, target=0x0, op0=0x7fbfffee98, op1=0x7fbfffee90, modifier=EXPAND_NORMAL) at expr.h:489 #18 0x00000000007735e9 in expand_expr_real_1 (exp=Variable "exp" is not available. ) at /home/guerby/work/gcc/version-head/gcc/expr.c:7641 #19 0x000000000077b185 in expand_expr_real (exp=0x2a973c4dc0, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at /home/guerby/work/gcc/version-head/gcc/expr.c:6431 #20 0x000000000077ba05 in expand_operands (exp0=0x2a973c4dc0, exp1=0x2a9721fa80, target=0x0, op0=0x7fbffff0a8, op1=0x7fbffff0a0, modifier=EXPAND_NORMAL) at expr.h:489 #21 0x00000000007735e9 in expand_expr_real_1 (exp=Variable "exp" is not available. ) at /home/guerby/work/gcc/version-head/gcc/expr.c:7641 #22 0x000000000077b185 in expand_expr_real (exp=0x2a973c4e10, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at /home/guerby/work/gcc/version-head/gcc/expr.c:6431 #23 0x0000000000776aa4 in expand_expr_real_1 (exp=Variable "exp" is not available. ) at expr.h:489 #24 0x000000000077b185 in expand_expr_real (exp=0x2a97709c40, target=0x0, tmode=SImode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at /home/guerby/work/gcc/version-head/gcc/expr.c:6431 #25 0x00000000006d497d in computation_cost (expr=0x2a97709c40) at expr.h:489 #26 0x00000000006d9e7a in get_computation_cost_at (data=0x7fbffff570, use=0x1476080, cand=0x144c0d0, address_p=0 '\0', depends_on=0x7fbffff450, at=0x2a97459d00) at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-ivopts.c:3847 #27 0x00000000006dabfd in determine_use_iv_cost (data=0x7fbffff570, use=0x1476080, cand=0x144c0d0) at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-ivopts.c:4167 #28 0x00000000006db243 in determine_use_iv_costs (data=0x7fbffff570) at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-ivopts.c:4222 #29 0x00000000006de3ca in tree_ssa_iv_optimize_loop (data=0x7fbffff570, loop=Variable "loop" is not available. ) at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-ivopts.c:5920 #30 0x00000000006debb5 in tree_ssa_iv_optimize (loops=0x13f5b70) at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-ivopts.c:5972 #31 0x0000000000649e56 in execute_one_pass (pass=0xcb0320) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:714 #32 0x0000000000649fac in execute_pass_list (pass=0xcb0320) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:751 #33 0x0000000000649fbe in execute_pass_list (pass=0xcaff60) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:752 #34 0x0000000000649fbe in execute_pass_list (pass=0xcaa1a0) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:752 #35 0x000000000064a235 in tree_rest_of_compilation (fndecl=0x2a96b9b1a0) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:914 #36 0x00000000009939c6 in cgraph_expand_function (node=0x2a962df340) at /home/guerby/work/gcc/version-head/gcc/cgraphunit.c:1033 ---Type <return> to continue, or q <return> to quit--- #37 0x0000000000995966 in cgraph_optimize () at /home/guerby/work/gcc/version-head/gcc/cgraphunit.c:1099 #38 0x000000000041b44a in gnat_parse_file (set_yydebug=Variable "set_yydebug" is not available. ) at /home/guerby/work/gcc/version-head/gcc/ada/misc.c:245 #39 0x0000000000922633 in toplev_main (argc=Variable "argc" is not available. ) at /home/guerby/work/gcc/version-head/gcc/toplev.c:966 #40 0x0000002a957963c1 in __libc_start_main () from /lib/libc.so.6 #41 0x0000000000402d2a in _start () at ../sysdeps/x86_64/elf/start.S:96 Works at -O0 too.
-- Testcase for segfault in is_gimple_variable, compile with -O1: procedure Bug is package B is function "*" (L : Natural; R : String) return String; end B; package body B is function "*" (L : Natural; R : String) return String is Result : String (1 .. L * R'Length); P : Integer := 1; begin for J in 1 .. L loop Result (P .. P + R'Length - 1) := R; P := P + R'Length; end loop; return Result; end "*"; end B; use B; S : String := ""; begin S := 1 * ""; end Bug; -- Confirmed on x86_64.
segfault in is_gimple_variable caused by this patch: 2005-06-07 Sebastian Pop <pop@cri.ensmp.fr> PR 18403 and meta PR 21861. * Makefile.in (tree-chrec.o): Depend on CFGLOOP_H and TREE_FLOW_H. ...
Hmm, I cannot reproduce this with a cross compiler but that might be because I am using powerpc- darwin7.9.0's ada includes.
Disabling wrapv also enables a successfull Ada bootstrap. Index: misc.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/ada/misc.c,v retrieving revision 1.104 diff -u -r1.104 misc.c --- misc.c 28 Jun 2005 19:51:26 -0000 1.104 +++ misc.c 29 Jun 2005 06:12:29 -0000 @@ -339,6 +339,8 @@ /* Uninitialized really means uninitialized in Ada. */ flag_zero_initialized_in_bss = 0; + flag_wrapv = 1; + return CL_Ada; }
Some discussion about this problem: http://gcc.gnu.org/ml/gcc/2005-06/msg01276.html
The is_gimple_variable segfault seems as a duplicate of PR 21963 to me; could someone please check whether the patch for that PR fixes the problem (I cannot access x86_64 machine just now)?
It does.
For the record, after twenty hours of compilation on an Athlon 64 3000+ (x86_64-linux), a build with --enable-checking=all,gcac,fold,rtl detects something wrong in fold. I'm attaching the .i. LAST_UPDATED Wed Jun 29 19:44:45 UTC 2005 stage1/xgcc -Bstage1/ -B/home/guerby/work/gcc/install/install-20050629T214650/x86_64-unknown-linux-gnu/bin/ -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Werror -fno-common -DHAVE_CONFIG_H -I. -Iada -I/home/guerby/work/gcc/version-head/gcc -I/home/guerby/work/gcc/version-head/gcc/ada -I/home/guerby/work/gcc/version-head/gcc/../include -I/home/guerby/work/gcc/version-head/gcc/../libcpp/include /home/guerby/work/gcc/version-head/gcc/ada/adaint.c -o ada/adaint.o /home/guerby/work/gcc/version-head/gcc/ada/adaint.c: In function '__gnat_locate_exec': /home/guerby/work/gcc/version-head/gcc/ada/adaint.c:2031: internal compiler error: fold check: original tree changed by fold Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. make[2]: *** [ada/adaint.o] Error 1 make[2]: Leaving directory `/home/guerby/work/gcc/build/build-20050629T214650/gcc' make[1]: *** [stage2_build] Error 2 make[1]: Leaving directory `/home/guerby/work/gcc/build/build-20050629T214650/gcc' make: *** [bootstrap] Error 2
Created an attachment (id=9181) [edit] source adainit.i.bz2
Hmm, unless I made a mistake the strfix problem is indeed fixed, but gcc/ada/vms_conv.adb one is still there. LAST_UPDATED Thu Jun 30 21:09:27 UTC 2005 + Zdenek patch. ../../xgcc -c -I./ -I../rts -I. -I/home/guerby/work/gcc/version-head/gcc/ada -B../../ -g -O2 -gnatpg -gnata -I- /home/guerby/work/gcc/version-head/gcc/ada/vms_conv.adb raised STORAGE_ERROR : stack overflow (or erroneous memory access) gnatmake: "/home/guerby/work/gcc/version-head/gcc/ada/vms_conv.adb" compilation error make[3]: *** [../../gnat] Error 4 make[3]: Leaving directory `/home/guerby/work/gcc/build/build-20050630T235156/gcc/ada/tools' The backtrace is the same ( tree_ssa_iv_optimize )
cxa4006 and cxa4017 fail the same way (STORAGE_ERROR) as vms_conv.adb.
Subject: Re: [4.1 Regression] SEGV in is_gimple_variable during loop-ivopts while building Ada RTS cxa4006 and cxa4017 fail the same way (STORAGE_ERROR) as vms_conv.adb. See the email I sent to the GCC list about cxa4006.
Fixed by patch for PR 21963, thanks Zdenek! *** This bug has been marked as a duplicate of 21963 ***