https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115549
Bug ID: 115549 Summary: ICE: tree check: expected tree that contains ‘decl common’ structure, have ‘error_mark’ in common_handle_aligned_attribute, at c-family/c-attribs.cc:2665 with invalid aligned attribute Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: iamanonymous.cs at gmail dot com Target Milestone: --- ICE on trunk. Compiler Explorer: https://godbolt.org/z/zcab6cfWj ******************************************************************************* OS and Platform: $ uname -a: Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux ******************************************************************************* gcc version: Using built-in specs. COLLECT_GCC=/root/gcc_set/trunk-48a320a/bin/gcc COLLECT_LTO_WRAPPER=/root/gcc_set/trunk-48a320a/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --prefix=/root/gcc_set/trunk-48a320a --with-gmp=/root/build_essential --with-mpfr=/root/build_essential --with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib --with-sanitizer=address,undefined,thread,leak --enable-coverage --disable-bootstrap Thread model: posix Supported LTO compression algorithms: zlib gcc version 15.0.0 20240426 (experimental) (GCC) ******************************************************************************* Program: $ cat mutant.c __attribute__((aligned, optimize(s),)0) s() ******************************************************************************* Command Lines: $ gcc mutant.c mutant.c:1:34: error: ‘s’ undeclared here (not in a function) 1 | __attribute__((aligned, optimize(s),)0) s() | ^ mutant.c:1:38: error: expected ‘)’ before numeric constant 1 | __attribute__((aligned, optimize(s),)0) s() | ^ | ) mutant.c:1:1: internal compiler error: tree check: expected tree that contains ‘decl common’ structure, have ‘error_mark’ in common_handle_aligned_attribute, at c-family/c-attribs.cc:2665 1 | __attribute__((aligned, optimize(s),)0) s() | ^~~~~~~~~~~~~ 0x25433e9 tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/gcc/tree.cc:9130 0xd34731 contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/gcc/tree.h:3770 0x10360bf common_handle_aligned_attribute ../../gcc/gcc/c-family/c-attribs.cc:2665 0x103692a handle_aligned_attribute ../../gcc/gcc/c-family/c-attribs.cc:2750 0xd2acd9 decl_attributes(tree_node**, tree_node*, int, tree_node*) ../../gcc/gcc/attribs.cc:900 0xd598f1 c_decl_attributes ../../gcc/gcc/c/c-decl.cc:5497 0xd795ab start_function(c_declspecs*, c_declarator*, tree_node*) ../../gcc/gcc/c/c-decl.cc:10483 0xe40891 c_parser_declaration_or_fndef ../../gcc/gcc/c/c-parser.cc:2912 0xe3c6ed c_parser_external_declaration ../../gcc/gcc/c/c-parser.cc:2046 0xe3bbd7 c_parser_translation_unit ../../gcc/gcc/c/c-parser.cc:1900 0xeccd02 c_parse_file() ../../gcc/gcc/c/c-parser.cc:26889 0xfe8faa c_common_parse_file() ../../gcc/gcc/c-family/c-opts.cc:1311 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.