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

            Bug ID: 128060
           Summary: ICE on compatible structs with member with hardbool
                    attribute
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eczbek.void at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/cPv3q7c9x

```
struct T { [[gnu::hardbool(0)]] char a; };

void f() {
        struct T { [[gnu::hardbool(0)]] char a; };
}
```

```
<source>: In function 'f':
<source>:4:16: internal compiler error: tree check: expected tree that contains
'decl common' structure, have 'integer_cst' in tagged_types_tu_compatible_p, at
c/c-typeck.cc:2001
    4 |         struct T { [[gnu::hardbool(0)]] char a; };
      |                ^
0x28cf288 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x28c3ecb internal_error(char const*, ...)
        ???:0
0x947921 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
        ???:0
0xaebf17 comptypes_equiv_p(tree_node*, tree_node*)
        ???:0
0xadd770 hash_table<c_struct_hasher, false,
xcallocator>::find_slot_with_hash(tree_node* const&, unsigned int,
insert_option)
        ???:0
0xad986e finish_struct(unsigned long, tree_node*, tree_node*, tree_node*,
c_struct_parse_info*, tree_node**)
        ???:0
0xb323e8 c_parser_declspecs(c_parser*, c_declspecs*, bool, bool, bool, bool,
bool, bool, bool, c_lookahead_kind)
        ???:0
0xb6add0 c_parse_file()
        ???:0
0xbf1099 c_common_parse_file()
        ???:0
```

Reply via email to