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

            Bug ID: 59827
           Summary: [4.7/4.8/4.9 Regression] ICE on array with incomplete
                    element type
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org

int
foo (int p[2][])
{
  return p[0][0];
}

void
bar (void)
{
  int p[2][1];
  foo (p);
}

$ ./cc1 -quiet zz.c 
zz.c:2:10: error: array type has incomplete element type
 foo (int p[2][])
          ^
zz.c: In function ‘bar’:
zz.c:11:3: error: type of formal parameter 1 is incomplete
   foo (p);
   ^
zz.c:8:1: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:81
 bar (void)
 ^
0xfb8b22 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
    /home/marek/src/gcc/gcc/tree.c:9243
0x56bd16 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
    /home/marek/src/gcc/gcc/tree.h:2832
0x9455e2 useless_type_conversion_p(tree_node*, tree_node*)
    /home/marek/src/gcc/gcc/gimple-expr.c:81
0x732bc8 types_compatible_p
    /home/marek/src/gcc/gcc/gimple-expr.h:65
0x73a350 gimple_check_call_args
    /home/marek/src/gcc/gcc/cgraph.c:3039
0x73a7a1 gimple_check_call_matching_types(gimple_statement_base*, tree_node*,
bool)
    /home/marek/src/gcc/gcc/cgraph.c:3089
0x734bbd cgraph_create_edge_1
    /home/marek/src/gcc/gcc/cgraph.c:894
0x734ca2 cgraph_create_edge(cgraph_node*, cgraph_node*, gimple_statement_base*,
long, int)
    /home/marek/src/gcc/gcc/cgraph.c:916
0x73bd85 build_cgraph_edges
    /home/marek/src/gcc/gcc/cgraphbuild.c:337
0x73c12a execute
    /home/marek/src/gcc/gcc/cgraphbuild.c:409
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.

Reply via email to