https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109561
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |15.1.0
Keywords| |needs-bisection
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This looks like it was fixed in GCC 15 but there is still some missing
optimizations.
in .optimized:
```
D.57945 = {};
SR.83_44->i = {};
_34 = (void *) ivtmp.116_94;
_17 = MEM[(bool *)_34 + 16B];
pretmp_41 = MEM[(struct _Optional_payload_base &)&D.57945 + 8]._M_engaged;
```
In .fre3:
```
D.57945 = {};
SR.83_7->i = {};
_10 = &MEM[(struct _Optional_payload *)SR.83_7 + 8B].D.55976;
_17 = MEM[(struct _Optional_payload_base *)SR.83_7 + 8B]._M_engaged;
if (_17 != 0)
goto <bb 4>; [50.00%]
else
goto <bb 16>; [50.00%]
<bb 4> [local count: 477815112]:
_18 = MEM[(struct _Optional_payload_base &)&D.57945 + 8]._M_engaged;
```
At this point _18/pretmp_41 should be 0.