https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127115
Bug ID: 127115
Summary: ICE in tagged_types_tu_compatible_p, at c/c-typeck.cc
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: s.kimura.h41104 at gmail dot com
Target Milestone: ---
Compiler Explorer: https://godbolt.org/z/rf7EEK7f8
Reproducer:
```
struct {
int a;
char b[] __attribute__((counted_by(a)));
} *s;
struct {
int a;
char b[] __attribute__((counted_by(a2)));
} *s;
```
Backtrace:
<source>:8:1: internal compiler error: in tagged_types_tu_compatible_p, at
c/c-typeck.cc:2107
8 | } *s;
| ^
0x28418b8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x28364fb internal_error(char const*, ...)
???:0
0xa433bc fancy_abort(char const*, int, char const*)
???:0
0xa985e7 comptypes_equiv_p(tree_node*, tree_node*)
???:0
0xa89e40 hash_table<c_struct_hasher, false,
xcallocator>::find_slot_with_hash(tree_node* const&, unsigned int,
insert_option)
???:0
0xa85f3e finish_struct(unsigned long, tree_node*, tree_node*, tree_node*,
c_struct_parse_info*, tree_node**)
???:0
0xadeb68 c_parser_declspecs(c_parser*, c_declspecs*, bool, bool, bool, bool,
bool, bool, bool, c_lookahead_kind)
???:0
0xb17090 c_parse_file()
???:0
0xb9ca19 c_common_parse_file()
???:0
This ICE goes back to gcc-15:
https://godbolt.org/z/4sTnvn5c4