[Bug c/60226] New: ICE initializing array of elements with too large alignment
reichelt at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Feb 16 17:36:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60226
Bug ID: 60226
Summary: ICE initializing array of elements with too large
alignment
Product: gcc
Version: 4.9.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
The following invalid code snippet triggers an ICE since GCC 4.0.0:
=======================================================
typedef int __attribute__ ((aligned(1 << 28))) int28;
int28 foo[4] = {};
=======================================================
bug.c:2:1: error: alignment of array elements is greater than element size
int28 foo[4] = {};
^
bug.c:2:1: internal compiler error: in round_up_loc, at fold-const.c:16882
0x7e8116 round_up_loc(unsigned int, tree_node*, int)
../../gcc/gcc/fold-const.c:16882
0x9e45bd finalize_type_size
../../gcc/gcc/stor-layout.c:1691
0x9e6936 layout_type(tree_node*)
../../gcc/gcc/stor-layout.c:2312
0xc0e1a2 build_array_type_1
../../gcc/gcc/tree.c:7840
0x5961e0 grokdeclarator
../../gcc/gcc/c/c-decl.c:5603
0x598c6d start_decl(c_declarator*, c_declspecs*, bool, tree_node*)
../../gcc/gcc/c/c-decl.c:4069
0x5e88ff c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.c:1754
0x5eca5f c_parser_external_declaration
../../gcc/gcc/c/c-parser.c:1399
0x5ed359 c_parser_translation_unit
../../gcc/gcc/c/c-parser.c:1286
0x5ed359 c_parse_file()
../../gcc/gcc/c/c-parser.c:14026
0x63bc53 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]
More information about the Gcc-bugs
mailing list