https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107411
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2022-10-26
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. reduced testcase:
int t();
void f(int);
void j()
{
const int& e = t();
f(e);
}
Someone who understands the uininit pass should look into this but the IR at
that point we get is (with -fno-exceptions due to extra clobbers otherwise
which don't make a difference):
_1 = .DEFERRED_INIT (4, 2, &"D.2374"[0]);
D.2374 = _1;
e_6 = .DEFERRED_INIT (8, 2, &"e"[0]);
_2 = t ();
D.2374 = _2;
e_9 = &D.2374;
_3 = *e_9;
f (_3);
D.2374 ={v} {CLOBBER(eol)};
There is no read from D.2374 in the call to t at all and then we do a full
write after the call.