gcc-4.1-20050723T1611UTC (...) stage1/xgcc -Bstage1/ -B/usr/x86_64-pld-linux/bin/ -c -march=x86-64 -O2 -gnatpg -gnata -g -O1 -fno-inline \ -I- -I. -Iada -I../../gcc/ada ../../gcc/ada/a-except.adb -o ada/a-except.o +===========================GNAT BUG DETECTED==============================+ | 4.1.0 20050723 (experimental) (x86_64-pld-linux-gnu) GCC error: | | in gimple_add_tmp_var, at gimplify.c:557 | | Error detected at a-exexda.adb:240:8
Is this with my patch: <http://gcc.gnu.org/ml/gcc-patches/2005-07/msg01327.html>?
(In reply to comment #1) > Is this with my patch: > <http://gcc.gnu.org/ml/gcc-patches/2005-07/msg01327.html>? yes.
FYI I successfully bootstraped on x86_64-linux with Andrew's patch: http://gcc.gnu.org/ml/gcc-testresults/2005-07/msg01241.html LAST_UPDATED: Sat Jul 23 10:44:53 UTC 2005 I'm updating and reboostraping. I also have a patch to ada/trans.c but I don't remember its origin (mailing list or bugzilla). Index: trans.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/ada/trans.c,v retrieving revision 1.101 diff -c -r1.101 trans.c *** trans.c 20 Jul 2005 01:18:53 -0000 1.101 --- trans.c 23 Jul 2005 17:58:13 -0000 *************** *** 3585,3590 **** --- 3585,3591 ---- else gnu_lhs = DECL_RESULT (current_function_decl); + #if 0 /* Do not remove the padding from GNU_RET_VAL if the inner type is self-referential since we want to allocate the fixed size in that case. */ *************** *** 3596,3601 **** --- 3597,3603 ---- && (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (TREE_TYPE (gnu_ret_val))))) gnu_ret_val = TREE_OPERAND (gnu_ret_val, 0); + #endif if (TYPE_RETURNS_BY_REF_P (gnu_subprog_type) || By_Ref (gnat_node)) *************** *** 4549,4576 **** *expr_p = TREE_OPERAND (*expr_p, 0); return GS_OK; - case ADDR_EXPR: - /* If we're taking the address of a constant CONSTRUCTOR, force it to - be put into static memory. We know it's going to be readonly given - the semantics we have and it's required to be static memory in - the case when the reference is in an elaboration procedure. */ - if (TREE_CODE (TREE_OPERAND (expr, 0)) == CONSTRUCTOR - && TREE_CONSTANT (TREE_OPERAND (expr, 0))) - { - tree new_var - = create_tmp_var (TREE_TYPE (TREE_OPERAND (expr, 0)), "C"); - - TREE_READONLY (new_var) = 1; - TREE_STATIC (new_var) = 1; - TREE_ADDRESSABLE (new_var) = 1; - DECL_INITIAL (new_var) = TREE_OPERAND (expr, 0); - - TREE_OPERAND (expr, 0) = new_var; - recompute_tree_invarant_for_addr_expr (expr); - return GS_ALL_DONE; - } - return GS_UNHANDLED; - case COMPONENT_REF: /* We have a kludge here. If the FIELD_DECL is from a fat pointer and is from an early dummy type, replace it with the proper FIELD_DECL. */ --- 4551,4556 ---- *************** *** 5361,5367 **** case UNCONSTRAINED_ARRAY_REF: case INDIRECT_REF: ! case CONSTRUCTOR: case NULL_EXPR: case SAVE_EXPR: return true; --- 5341,5347 ---- case UNCONSTRAINED_ARRAY_REF: case INDIRECT_REF: ! /* case CONSTRUCTOR:*/ case NULL_EXPR: case SAVE_EXPR: return true;
Silly me, it's part of Andrew's patch.
Bootstraped completed on x86_64-linux for LAST_UPDATED Sat Jul 23 17:57:57 UTC 2005 with Andrew's patch.
(In reply to comment #5) > Bootstraped completed on x86_64-linux for > LAST_UPDATED Sat Jul 23 17:57:57 UTC 2005 > with Andrew's patch. have You done a full `make bootstrap` ? on my snapshot (20050723T1611UTC) i get an ice with Andrew's patch. without Andrew's patch full boostrap works fine. i have no idea what's wrong :|
Can you give the backtrace? Also all the options you used to bootstrap/configure?
(In reply to comment #7) > Can you give the backtrace? > (gdb) r Starting program: /home/users/pluto/rpm/BUILD/gcc-4.1-20050723T1611UTC/obj-x86_64-pld-linux/gcc/stage1/gnat1 -I- -I. -Iada -I../../gcc/ada -quiet -dumpbase a-except.adb -O1 -fno-inline -gnatpg -gnata -g -mtune=k8 -gnatO ada/a-except.o ../../gcc/ada/a-except.adb -o /tmp/ccgbB3Td.s Breakpoint 2, 0x0000000000829a7d in internal_error () (gdb) bt #0 0x0000000000829a7d in internal_error () #1 0x0000000000829d0f in fancy_abort () #2 0x0000000000725013 in gimple_add_tmp_var () #3 0x0000000000727c91 in gimplify_decl_expr () #4 0x000000000073acc0 in gimplify_expr () #5 0x0000000000739d8c in gimplify_stmt () #6 0x0000000000736fa3 in gimplify_statement_list () #7 0x000000000073be20 in gimplify_expr () #8 0x0000000000739d8c in gimplify_stmt () #9 0x0000000000739da3 in gimplify_to_stmt_list () #10 0x0000000000726867 in gimplify_bind_expr () #11 0x000000000073acf2 in gimplify_expr () #12 0x0000000000739d8c in gimplify_stmt () #13 0x0000000000736fa3 in gimplify_statement_list () #14 0x000000000073be20 in gimplify_expr () #15 0x0000000000739d8c in gimplify_stmt () #16 0x000000000073e51b in gimplify_body () #17 0x000000000073ec8b in gimplify_function_tree () #18 0x000000000043fb23 in gnat_gimplify_function () #19 0x000000000043fae5 in end_subprog_body () #20 0x000000000046c979 in Subprogram_Body_to_gnu () #21 0x0000000000477743 in gnat_to_gnu () #22 0x000000000047e0ac in process_decls () #23 0x0000000000477844 in gnat_to_gnu () #24 0x0000000000477931 in gnat_to_gnu () #25 0x0000000000477913 in gnat_to_gnu () #26 0x000000000047dfba in process_decls () #27 0x0000000000477844 in gnat_to_gnu () #28 0x0000000000470f1d in Compilation_Unit_to_gnu () #29 0x0000000000464743 in gigi () #30 0x000000000070e331 in back_end__call_back_end () #31 0x000000000071081c in _ada_gnat1drv () #32 0x0000000000433010 in gnat_parse_file () #33 0x0000000000b423bc in compile_file () #34 0x0000000000b43edb in do_compile () #35 0x0000000000b43f3f in toplev_main () #36 0x0000000000710fc3 in main () > Also all the options you used to bootstrap/configure? configure/build log attached.
Created attachment 9339 [details] buildlog.
Breakpoint 3, gimple_add_tmp_var (tmp=0x2aaaab3176e0) at ../../gcc/gimplify.c:557 557 gcc_assert (!TREE_CHAIN (tmp) && !DECL_SEEN_IN_BIND_EXPR_P (tmp));
Created attachment 9340 [details] tmp var dump.
detailed backtrace: (gdb) bt #0 gimple_add_tmp_var (tmp=0x2aaaab3176e0) at ../../gcc/gimplify.c:557 #1 0x0000000000724261 in create_tmp_var (type=0x2aaaaaf93c60, prefix=0x0) #2 0x000000000072496c in create_tmp_from_val (val=0x2aaaab303b40) at ../../gcc/gimplify.c:429 #3 0x00000000007248ba in lookup_tmp_var (val=0x2aaaab303b40, is_formal=1 '\001') at ../../gcc/gimplify.c:458 #4 0x00000000007249ae in internal_get_tmp_var (val=0x2aaaab303b40, pre_p=0x2aaaab30a0f0, post_p=0x0, is_formal=1 '\001') at ../../gcc/gimplify.c:493 #5 0x0000000000724c39 in get_formal_tmp_var (val=0x2aaaab303b40, pre_p=0x2aaaab30a0f0) at ../../gcc/gimplify.c:519 #6 0x000000000073d29c in gimplify_expr (expr_p=0x2aaaab30c478, pre_p=0x2aaaab30a0f0, post_p=0x7fffffecf8f0, gimple_test_f=0x722920 <is_gimple_reg>, fallback=fb_rvalue) at ../../gcc/gimplify.c:4515 #7 0x000000000073ac04 in gimplify_expr (expr_p=0x2aaaab303bc8, pre_p=0x2aaaab30a0f0, post_p=0x7fffffecf8f0, gimple_test_f=0x722e71 <is_gimple_min_lval>, fallback=fb_rvalue) at ../../gcc/gimplify.c:4111 #8 0x000000000072cadc in gimplify_compound_lval (expr_p=0x7fffffecf6f8, pre_p=0x2aaaab30a0f0, post_p=0x7fffffecf8f0, fallback=fb_rvalue) at ../../gcc/gimplify.c:1558 #9 0x000000000073a24e in gimplify_expr (expr_p=0x7fffffecf6f8, pre_p=0x2aaaab30a0f0, post_p=0x7fffffecf8f0, gimple_test_f=0x722304 <is_gimple_formal_tmp_rhs>, fallback=fb_rvalue) at ../../gcc/gimplify.c:4005 #10 0x00000000007249a1 in internal_get_tmp_var (val=0x2aaaab303b90, pre_p=0x2aaaab30a0f0, post_p=0x7fffffecf8f0, is_formal=0 '\0') at ../../gcc/gimplify.c:491 #11 0x0000000000724c65 in get_initialized_tmp_var (val=0x2aaaab303b90, pre_p=0x2aaaab30a0f0, post_p=0x7fffffecf8f0) at ../../gcc/gimplify.c:528 #12 0x0000000000737378 in gimplify_save_expr (expr_p=0x2aaaab309b70, pre_p=0x2aaaab30a0f0, post_p=0x7fffffecf8f0) at ../../gcc/gimplify.c:3386 #13 0x000000000073b2d7 in gimplify_expr (expr_p=0x2aaaab309b70, pre_p=0x2aaaab30a0f0, post_p=0x7fffffecf8f0, gimple_test_f=0x722d53 <is_gimple_val>, fallback=fb_rvalue) at ../../gcc/gimplify.c:4211 #14 0x000000000073e05c in gimplify_one_sizepos (expr_p=0x2aaaab309b70, stmt_p=0x2aaaab30a0f0) at ../../gcc/gimplify.c:4645 #15 0x000000000073d67e in gimplify_type_sizes (type=0x2aaaab309b00, list_p=0x2aaaab30a0f0) at ../../gcc/gimplify.c:4580 #16 0x00000000007276ea in gimplify_decl_expr (stmt_p=0x2aaaab30a0f0) at ../../gcc/gimplify.c:1026 #17 0x000000000073acc0 in gimplify_expr (expr_p=0x2aaaab30a0f0, pre_p=0x7fffffed00f8, post_p=0x7fffffed00f0, gimple_test_f=0x7226a4 <is_gimple_stmt>, fallback=fb_none) at ../../gcc/gimplify.c:4137 #18 0x0000000000739d8c in gimplify_stmt (stmt_p=0x2aaaab30a0f0) at ../../gcc/gimplify.c:3873 #19 0x0000000000736fa3 in gimplify_statement_list (expr_p=0x2aaaab314d10) at ../../gcc/gimplify.c:3339 #20 0x000000000073be20 in gimplify_expr (expr_p=0x2aaaab314d10, pre_p=0x7fffffed06f8, post_p=0x7fffffed06f0, gimple_test_f=0x7226a4 <is_gimple_stmt>, fallback=fb_none) at ../../gcc/gimplify.c:4283 #21 0x0000000000739d8c in gimplify_stmt (stmt_p=0x2aaaab314d10) at ../../gcc/gimplify.c:3873 #22 0x0000000000739da3 in gimplify_to_stmt_list (stmt_p=0x2aaaab314d10) at ../../gcc/gimplify.c:3881 #23 0x0000000000726867 in gimplify_bind_expr (expr_p=0x2aaaab30a610, temp=0x0, pre_p=0x7fffffed0e58) at ../../gcc/gimplify.c:901 #24 0x000000000073acf2 in gimplify_expr (expr_p=0x2aaaab30a610, pre_p=0x7fffffed0e58, post_p=0x7fffffed0e50, gimple_test_f=0x7226a4 <is_gimple_stmt>, fallback=fb_none) at ../../gcc/gimplify.c:4146 #25 0x0000000000739d8c in gimplify_stmt (stmt_p=0x2aaaab30a610) at ../../gcc/gimplify.c:3873 #26 0x0000000000736fa3 in gimplify_statement_list (expr_p=0x2aaaaafd3cb0) at ../../gcc/gimplify.c:3339 #27 0x000000000073be20 in gimplify_expr (expr_p=0x2aaaaafd3cb0, pre_p=0x7fffffed1458, post_p=0x7fffffed1450, gimple_test_f=0x7226a4 <is_gimple_stmt>, fallback=fb_none) at ../../gcc/gimplify.c:4283 #28 0x0000000000739d8c in gimplify_stmt (stmt_p=0x2aaaaafd3cb0) at ../../gcc/gimplify.c:3873 #29 0x000000000073e51b in gimplify_body (body_p=0x2aaaaafd3cb0, fndecl=0x2aaaaafd3c00, do_parms=1 '\001') at ../../gcc/gimplify.c:4754 #30 0x000000000073ec8b in gimplify_function_tree (fndecl=0x2aaaaafd3c00) at ../../gcc/gimplify.c:4829 #31 0x000000000043fb23 in gnat_gimplify_function (fndecl=0x2aaaaafd3c00) at ../../gcc/ada/utils.c:1778 #32 0x000000000043fae5 in end_subprog_body (body=0x2aaaab30bc60) at ../../gcc/ada/utils.c:1761 #33 0x000000000046c979 in Subprogram_Body_to_gnu (gnat_node=17914) at ../../gcc/ada/trans.c:1480 #34 0x0000000000477743 in gnat_to_gnu (gnat_node=17914) at ../../gcc/ada/trans.c:3690 #35 0x000000000047e0ac in process_decls (gnat_decls=-99998363, gnat_decls2=0, gnat_end_list=0, pass1p=1 '\001', pass2p=1 '\001') at ../../gcc/ada/trans.c:4998 #36 0x0000000000477844 in gnat_to_gnu (gnat_node=17436) at ../../gcc/ada/trans.c:3725 #37 0x0000000000477931 in gnat_to_gnu (gnat_node=17427) at ../../gcc/ada/trans.c:3780 #38 0x0000000000477913 in gnat_to_gnu (gnat_node=4276) at ../../gcc/ada/trans.c:3776 #39 0x000000000047dfba in process_decls (gnat_decls=-99999981, gnat_decls2=0, gnat_end_list=0, pass1p=1 '\001', pass2p=1 '\001') at ../../gcc/ada/trans.c:4982 #40 0x0000000000477844 in gnat_to_gnu (gnat_node=1693) at ../../gcc/ada/trans.c:3725 #41 0x0000000000470f1d in Compilation_Unit_to_gnu (gnat_node=1656) at ../../gcc/ada/trans.c:2434 #42 0x0000000000464743 in gigi (gnat_root=1656, max_gnat_node=29021, number_name=4029, nodes_ptr=0x2aaaab0f2010, next_node_ptr=0x2aaaab2aa010, prev_node_ptr=0x2aaaab2db010, elists_ptr=0x17025d0, elmts_ptr=0x15fcf10, strings_ptr=0x1653040, string_chars_ptr=0x16e0d50, list_headers_ptr=0x166df50, number_units=28, file_info_ptr=0x7fffffed5510 "-§á\021", standard_integer=62, standard_long_long_float=92, standard_exception_type=1217, gigi_operating_mode=0) at ../../gcc/ada/trans.c:241 During symbol reading, inner block not inside outer block in back_end.scan_compiler_arguments. During symbol reading, inner block not inside outer block in back_end.scan_compiler_arguments. #43 0x000000000070e331 in back_end.call_back_end (mode=back_end__generate_object) at ../../gcc/ada/back_end.adb:108 During symbol reading, inner block (0x7108a6-0x710ac2) not inside outer block (0x70ffa9-0x710235). During symbol reading, inner block (0x710ac2-0x710aeb) not inside outer block (0x70f608-0x710894). #44 0x000000000071081c in gnat1drv () at ../../gcc/ada/gnat1drv.adb:640 #45 0x0000000000433010 in gnat_parse_file (set_yydebug=0) at ../../gcc/ada/misc.c:242 #46 0x0000000000b423bc in compile_file () at ../../gcc/toplev.c:971 #47 0x0000000000b43edb in do_compile () at ../../gcc/toplev.c:1937 #48 0x0000000000b43f3f in toplev_main (argc=19, argv=0x7fffffed5f58) at ../../gcc/toplev.c:1969 #49 0x0000000000710fc3 in main (argc=19, argv=0x7fffffed5f58) at ../../gcc/main.c:35
Subject: Re: ICE / ada / error in gimple_add_tmp_var, at gimplify.c:557 > > > ------- Additional Comments From pluto at agmk dot net 2005-07-23 22:45 ------- > detailed backtrace: > > (gdb) bt > #0 gimple_add_tmp_var (tmp=0x2aaaab3176e0) at ../../gcc/gimplify.c:557 > #1 0x0000000000724261 in create_tmp_var (type=0x2aaaaaf93c60, prefix=0x0) #2 > 0x000000000072496c in create_tmp_from_val (val=0x2aaaab303b40) > at ../../gcc/gimplify.c:429 > #3 0x00000000007248ba in lookup_tmp_var (val=0x2aaaab303b40, is_formal=1 > '\001') at ../../gcc/gimplify.c:458 > #4 0x00000000007249ae in internal_get_tmp_var (val=0x2aaaab303b40, > pre_p=0x2aaaab30a0f0, post_p=0x0, > is_formal=1 '\001') at ../../gcc/gimplify.c:493 > #5 0x0000000000724c39 in get_formal_tmp_var (val=0x2aaaab303b40, > pre_p=0x2aaaab30a0f0) > at ../../gcc/gimplify.c:519 > #6 0x000000000073d29c in gimplify_expr (expr_p=0x2aaaab30c478, > pre_p=0x2aaaab30a0f0, post_p=0x7fffffecf8f0, > gimple_test_f=0x722920 <is_gimple_reg>, fallback=fb_rvalue) > at ../../gcc/gimplify.c:4515 > #7 0x000000000073ac04 in gimplify_expr (expr_p=0x2aaaab303bc8, > pre_p=0x2aaaab30a0f0, post_p=0x7fffffecf8f0, > gimple_test_f=0x722e71 <is_gimple_min_lval>, fallback=fb_rvalue) > at ../../gcc/gimplify.c:4111 The last time I ran into this is when gimplify_build_fold_addr_expr did not return (DECL_EXPR <t>, &) but &(DECL_EXPR<t>, &t) which was my bug. I wonder if something like that is happening again but I looked and saw gimplify_build_fold_addr_expr in the patch which I posted has it correct.
(In reply to comment #6) > (In reply to comment #5) > > Bootstraped completed on x86_64-linux for > > LAST_UPDATED Sat Jul 23 17:57:57 UTC 2005 > > with Andrew's patch. > > have You done a full `make bootstrap` ? > on my snapshot (20050723T1611UTC) i get an ice with Andrew's patch. > without Andrew's patch full boostrap works fine. > i have no idea what's wrong :| Yes I always start everything from scratch and configure prefix to an empty directory (in fact I use a script that does everything). My testresults (with configure line) are here: http://gcc.gnu.org/ml/gcc-testresults/2005-07/msg01266.html I'm attaching my current diff so you can check.
Created attachment 9341 [details] Current diff
(In reply to comment #14) > (In reply to comment #6) > > (In reply to comment #5) > > > Bootstraped completed on x86_64-linux for > > > LAST_UPDATED Sat Jul 23 17:57:57 UTC 2005 > > > with Andrew's patch. > > > > have You done a full `make bootstrap` ? > > on my snapshot (20050723T1611UTC) i get an ice with Andrew's patch. > > without Andrew's patch full boostrap works fine. > > i have no idea what's wrong :| > > Yes I always start everything from scratch and configure prefix to an empty > directory (in fact I use a script that does everything). > > My testresults (with configure line) are here: > http://gcc.gnu.org/ml/gcc-testresults/2005-07/msg01266.html > > I'm attaching my current diff so you can check. Your patch is different from patch linked in PR22533. I'm testing Your patch now...
with pinskia1.patch bootstrap gcc doesn't ice. patch linked to PR22533 causes an ice. /close.
Subject: Re: ICE / ada / error in gimple_add_tmp_var, at gimplify.c:557 > > > ------- Additional Comments From pluto at agmk dot net 2005-07-24 15:10 ------- > with pinskia1.patch bootstrap gcc doesn't ice. > patch linked to PR22533 causes an ice. Guess I have to fix that then :(. -- Pinski
Note this works just fine on ppc-darwin with my patch so I don't know what is going on.
Oh, If I change the second agrument to create_tmp_var/create_tmp_var_raw to "C" instead of NULL, we no longer get an ICE.