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

            Bug ID: 70022
           Summary: [4.9/5/6 Regression] ICE: in tree_to_shwi, at
                    tree.c:7328 with out-of-bounds vector index
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---

Created attachment 37827
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37827&action=edit
reduced testcase

Compiler output:
$ gcc testcase.c 
testcase.c: In function 'foo':
testcase.c:6:4: internal compiler error: in tree_to_shwi, at tree.c:7328
   v[~0ULL];
   ~^~~~~~~
0xe40e42 tree_to_shwi(tree_node const*)
        /repo/gcc-trunk/gcc/tree.c:7328
0x87c2b4 fold_indirect_ref_1(unsigned int, tree_node*, tree_node*)
        /repo/gcc-trunk/gcc/fold-const.c:14221
0x89c9e3 fold_indirect_ref_loc(unsigned int, tree_node*)
        /repo/gcc-trunk/gcc/fold-const.c:14300
0x8fe098 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /repo/gcc-trunk/gcc/gimplify.c:10276
0x900b96 gimplify_stmt(tree_node**, gimple**)
        /repo/gcc-trunk/gcc/gimplify.c:5644
0x901dd5 gimplify_bind_expr
        /repo/gcc-trunk/gcc/gimplify.c:1142
0x8fbe62 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /repo/gcc-trunk/gcc/gimplify.c:10363
0x900b96 gimplify_stmt(tree_node**, gimple**)
        /repo/gcc-trunk/gcc/gimplify.c:5644
0x9029f4 gimplify_body(tree_node*, bool)
        /repo/gcc-trunk/gcc/gimplify.c:11295
0x903086 gimplify_function_tree(tree_node*)
        /repo/gcc-trunk/gcc/gimplify.c:11451
0x7639c7 cgraph_node::analyze()
        /repo/gcc-trunk/gcc/cgraphunit.c:625
0x766d33 analyze_functions
        /repo/gcc-trunk/gcc/cgraphunit.c:1086
0x767a78 symbol_table::finalize_compilation_unit()
        /repo/gcc-trunk/gcc/cgraphunit.c:2540
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

All targets seem to be affected.

Tested revisions:
trunk r233801 - FAIL
5-branch r233800 - FAIL
4_9-branch r233802 - FAIL
4_8-branch r224828 - FAIL (in tree_low_cst)
4_7-branch r211571 - OK

Reply via email to