http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59032

            Bug ID: 59032
           Summary: [4.8/4.9 Regression] ICE incrementing vector type
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following invalid code snippet triggers an ICE since GCC 4.8.0:

============================================
void foo()
{
  float v __attribute__((vector_size(8)));
  ++v;
}
============================================

bug.cc: In function 'void foo()':
bug.cc:4:5: error: can't convert between vector values of different size
   ++v;
     ^
bug.cc:4:6: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in fold_binary_loc, at fold-const.c:10381
   ++v;
      ^
0xd356c6 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/gcc/tree.c:9472
0x91bc32 tree_class_check
        ../../gcc/gcc/tree.h:2815
0x91bc32 fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/gcc/fold-const.c:10381
0x925a2a fold_build2_stat_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/gcc/fold-const.c:15048
0x90389d fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/gcc/fold-const.c:10035
0x925a2a fold_build2_stat_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/gcc/fold-const.c:15048
0x98dde6 gimplify_self_mod_expr(tree_node**, gimple_statement_d**,
gimple_statement_d**, bool, tree_node*)
        ../../gcc/gcc/gimplify.c:2400
0x9872aa gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7665
0x98b956 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5657
0x9884cf gimplify_cleanup_point_expr
        ../../gcc/gcc/gimplify.c:5433
0x9884cf gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:8088
0x98b956 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5657
0x987f1b gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1548
0x987f1b gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:8140
0x98b956 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5657
0x98c7e5 gimplify_bind_expr
        ../../gcc/gcc/gimplify.c:1229
0x9883ac gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7922
0x98b956 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5657
0x98d0ce gimplify_body(tree_node*, bool)
        ../../gcc/gcc/gimplify.c:8832
0x98d626 gimplify_function_tree(tree_node*)
        ../../gcc/gcc/gimplify.c:8970
Please submit a full bug report, [etc.]

Btw, the error message seems to be bogus, too. The C-frontend gives a better
diagnostic (and doesn't crash):

bug.c: In function 'foo':
bug.c:4:3: error: wrong type argument to increment
   ++v;

Reply via email to