[Bug c/71418] New: gcc ICE on x86_64-linux-gnu in min_align_of_type, at stor-layout.c:2402

helloqirun at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Jun 5 09:33:00 GMT 2016


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

            Bug ID: 71418
           Summary: gcc ICE on x86_64-linux-gnu in min_align_of_type, at
                    stor-layout.c:2402
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE when compiled with the current gcc
trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes. 

It appears to be a 7 regression.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160604 (experimental) [trunk revision 237092] (GCC)


$ gcc-trunk abc.c
abc.c:1:25: error: lvalue required as increment operand
 _Alignas (char)   ID0 [ ++ 7 ] ;
                         ^~
abc.c:1:1: warning: data definition has no type or storage class
 _Alignas (char)   ID0 [ ++ 7 ] ;
 ^~~~~~~~
abc.c:1:19: warning: type defaults to ‘int’ in declaration of ‘ID0’
[-Wimplicit-int]
 _Alignas (char)   ID0 [ ++ 7 ] ;
                   ^~~
abc.c:1:1: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in min_align_of_type, at stor-layout.c:2402
 _Alignas (char)   ID0 [ ++ 7 ] ;
 ^~~~~~~~
0xe60277 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc-source-trunk/gcc/tree.c:9802
0xbaf9dd tree_class_check
        ../../gcc-source-trunk/gcc/tree.h:3153
0xbaf9dd min_align_of_type(tree_node*)
        ../../gcc-source-trunk/gcc/stor-layout.c:2402
0x656259 grokdeclarator
        ../../gcc-source-trunk/gcc/c/c-decl.c:6319
0x65783a start_decl(c_declarator*, c_declspecs*, bool, tree_node*)
        ../../gcc-source-trunk/gcc/c/c-decl.c:4442
0x6bc0c5 c_parser_declaration_or_fndef
        ../../gcc-source-trunk/gcc/c/c-parser.c:1963
0x6c6065 c_parser_external_declaration
        ../../gcc-source-trunk/gcc/c/c-parser.c:1549
0x6c68f9 c_parser_translation_unit
        ../../gcc-source-trunk/gcc/c/c-parser.c:1430
0x6c68f9 c_parse_file()
        ../../gcc-source-trunk/gcc/c/c-parser.c:17930
0x728e82 c_common_parse_file()
        ../../gcc-source-trunk/gcc/c-family/c-opts.c:1064
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.


$ cat abc.c
_Alignas (char)   ID0 [ ++ 7 ] ;


More information about the Gcc-bugs mailing list