https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128215
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Better testcase:
union U { int a[8]; };
constexpr U bar (int m, int n) {
U u;
__builtin_start_lifetime (&u.a);
u.a[0] = 42;
for (int i = m; i < n; ++i)
u.a[i] = 0;
return u;
}
template <auto V, int N>
int foo () { return N; }
int a = foo <bar (1, 1), 42> ();
int b = foo <bar (1, 3), 43> ();
int c = foo <bar (2, 8), 44> ();
int main () {}
This one shows different numbers of zeros after 42 and before inactive
elemental subobjects in the first case, and in the last case inactive elemental
subobject before the trailing zeros.
_Z3fooITnDaXtl1Udi1atlA8_iLi42EEEELi42EEiv
_Z3fooITnDaXtl1Udi1atlA8_iLi42EEEELi43EEiv
_Z3fooITnDaXtl1Udi1atlA8_iLi42EEEELi44EEiv
are all inappropriate. Ideally (so that it is compact) we could in the
mangling express that there are N consecutive inactive elemental subobjects.