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

            Bug ID: 81055
           Summary: [5/6/7/8 Regression] ICE with invalid initializer for
                    array new
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet (compiled with -std=c++0x) triggers
an ICE since GCC 4.7.0:

==============================
int** p = new int*[1]{q};
==============================

bug.cc:1:23: error: 'q' was not declared in this scope
 int** p = new int*[1]{q};
                       ^
bug.cc: In function 'void __static_initialization_and_destruction_0(int, int)':
bug.cc:1:24: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.c:84
 int** p = new int*[1]{q};
                        ^
0x5d3be5 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/gcc/tree.c:9909
0xacd134 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../gcc/gcc/tree.h:3206
0xacd134 useless_type_conversion_p(tree_node*, tree_node*)
        ../../gcc/gcc/gimple-expr.c:84
0xb0c901 gimplify_modify_expr
        ../../gcc/gcc/gimplify.c:5443
0xafaee2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:11297
0xafdc08 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.c:6521
0xafa6ca gimplify_cleanup_point_expr
        ../../gcc/gcc/gimplify.c:6265
0xafa6ca gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:11673
0xafdc08 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.c:6521
0xaf944b gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1721
0xaf944b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:11725
0xafdc08 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.c:6521
0xaf977c gimplify_and_add(tree_node*, gimple**)
        ../../gcc/gcc/gimplify.c:438
0xaf977c gimplify_loop_expr
        ../../gcc/gcc/gimplify.c:1695
0xaf977c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:11501
0xafdc08 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.c:6521
0xaf944b gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1721
0xaf944b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:11725
0xafdc08 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.c:6521
0xaf944b gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1721
Please submit a full bug report, [etc.]

Reply via email to