https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123263
Bug ID: 123263
Summary: d: ICE in dwarf2out_abstract_function, at
dwarf2out.cc:23771
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: d
Assignee: ibuclaw at gdcproject dot org
Reporter: ibuclaw at gcc dot gnu.org
Target Milestone: ---
When compiling with `-O2 -g`, compiler generates a few artificial symbols
associated with the instantiated nested struct.
The DIEs get discarded because the struct is unreferenced. Later the fnsplit
pass wants to create a clone of the generated function, resulting in triggering
of ICE after lookup_decl_die.
```
void test()
{
struct AttrT(T)
{
string name;
T value;
// bool __xopEquals(ref const AttrT!T p) const;
// TypeInfo_Struct init = { ..., .xopEquals=&__xopEquals, ... };
}
@AttrT!string() int k;
}
```