[Bug c/63549] New: ICE in build_array_ref with invalid code

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 16 00:32:00 GMT 2014


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

            Bug ID: 63549
           Summary: ICE in build_array_ref with invalid code
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org

While reducing a testcase for a different bug I ran into this ICE.
Testcase:
enum processor_type ix86_cpu;
  const processor_alias_table[] =
     align_functions = 1 << i;
      align_loops = processor_target_table[ix86_cpu].align_loop;

Reduced from SPEC 2006's gcc.
This produces the following output:
pinskia@server:~$ ~/local-gcc/bin/gcc t.i
t.i:3:6: error: ‘align_functions’ undeclared here (not in a function)
      align_functions = 1 << i;
      ^
t.i:3:29: error: ‘i’ undeclared here (not in a function)
      align_functions = 1 << i;
                             ^
t.i:4:7: warning: data definition has no type or storage class
       align_loops = processor_target_table[ix86_cpu].align_loop;
       ^
t.i:4:21: error: ‘processor_target_table’ undeclared here (not in a function)
       align_loops = processor_target_table[ix86_cpu].align_loop;
                     ^
t.i:4:7: error: ‘ix86_cpu’ has an incomplete type
       align_loops = processor_target_table[ix86_cpu].align_loop;
       ^
t.i:4:7: internal compiler error: in build_array_ref, at c/c-typeck.c:2482
0x5a87c8 build_array_ref(unsigned int, tree_node*, tree_node*)
    /home/pinskia/src/local/gcc/gcc/c/c-typeck.c:2482
0x5c8964 c_parser_postfix_expression_after_primary
    /home/pinskia/src/local/gcc/gcc/c/c-parser.c:7742
0x5bc686 c_parser_postfix_expression
    /home/pinskia/src/local/gcc/gcc/c/c-parser.c:7607
0x5beb6a c_parser_unary_expression
    /home/pinskia/src/local/gcc/gcc/c/c-parser.c:6534
0x5c47ff c_parser_cast_expression
    /home/pinskia/src/local/gcc/gcc/c/c-parser.c:6372
0x5c49e4 c_parser_binary_expression
    /home/pinskia/src/local/gcc/gcc/c/c-parser.c:6187
0x5c5545 c_parser_conditional_expression
    /home/pinskia/src/local/gcc/gcc/c/c-parser.c:5963
0x5c5b10 c_parser_expr_no_commas
    /home/pinskia/src/local/gcc/gcc/c/c-parser.c:5881
0x5ce7f9 c_parser_initializer
    /home/pinskia/src/local/gcc/gcc/c/c-parser.c:4141
0x5d19bf c_parser_declaration_or_fndef
    /home/pinskia/src/local/gcc/gcc/c/c-parser.c:1799
0x5db2d7 c_parser_external_declaration
    /home/pinskia/src/local/gcc/gcc/c/c-parser.c:1427
0x5dbb99 c_parser_translation_unit
    /home/pinskia/src/local/gcc/gcc/c/c-parser.c:1314
0x5dbb99 c_parse_file()
    /home/pinskia/src/local/gcc/gcc/c/c-parser.c:14348
0x62f8d2 c_common_parse_file()
    /home/pinskia/src/local/gcc/gcc/c-family/c-opts.c:1043
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.


More information about the Gcc-bugs mailing list