https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79412

            Bug ID: 79412
           Summary: ICE in fold_convert_loc, at fold-const.c:2239
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

With invalid code down to at least gcc 4.8 (configured with
--enable-checking=yes) on x86_64 GNU/Linux.
(official releases: confused by earlier errors, bailing out)


$ cat z1.c
int a;
void fn1 ()
{
  a++;
}
int a[] = {2};


$ gcc-7-20170205 -c z1.c
z1.c:6:5: error: conflicting types for 'a'
 int a[] = {2};
     ^
z1.c:1:5: note: previous declaration of 'a' was here
 int a;
     ^
z1.c: In function 'fn1':
z1.c:4:4: internal compiler error: in fold_convert_loc, at fold-const.c:2239
   a++;
   ~^~
0x90910f fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../gcc/fold-const.c:2238
0x97abe8 gimplify_self_mod_expr(tree_node**, gimple**, gimple**, bool,
tree_node*)
        ../../gcc/gimplify.c:2966
0x973f70 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.c:11135
0x9773e6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.c:6478
0x9786cd gimplify_bind_expr
        ../../gcc/gimplify.c:1290
0x9745ba gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.c:11402
0x9773e6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.c:6478
0x9793b9 gimplify_body(tree_node*, bool)
        ../../gcc/gimplify.c:12396
0x979a54 gimplify_function_tree(tree_node*)
        ../../gcc/gimplify.c:12554
0x7f17c7 cgraph_node::analyze()
        ../../gcc/cgraphunit.c:655
0x7f4ce3 analyze_functions
        ../../gcc/cgraphunit.c:1116
0x7f5a3a symbol_table::finalize_compilation_unit()
        ../../gcc/cgraphunit.c:2597

Reply via email to