https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109561

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
We diagnose

<bb7>
pretmp_108 = MEM[(const struct basic_string *)&D.58534 + 8B]._M_string_length;

which is guarded by


<bb 5> [local count: 955630225]:
# ivtmp.123_51 = PHI <ivtmp.123_74(34), ivtmp.123_42(4)>
MEM[(struct optional *)&D.58534] ={v} {CLOBBER};
MEM[(union _Storage *)&D.58534] ={v} {CLOBBER};
MEM[(struct _Optional_payload_base *)&D.58534]._M_engaged = 0;
MEM[(struct optional *)&D.58534 + 8B] ={v} {CLOBBER};
MEM[(union _Storage *)&D.58534 + 8B] ={v} {CLOBBER};
MEM[(struct _Optional_payload_base *)&D.58534 + 8B]._M_engaged = 0;
_1 = (void *) ivtmp.123_51;
MEM[(struct optional *)_1 + -24B] = D.58534.i;
_23 = MEM[(bool *)_1 + 16B];
if (_23 != 0)
  goto <bb 6>; [50.00%]
else
  goto <bb 22>; [50.00%]

<bb 6> [local count: 477815112]:
_24 = MEM[(struct _Optional_payload_base &)&D.58534 + 8]._M_engaged;
pretmp_110 = MEM[(char * *)_1 + -16B];
if (_24 != 0)
  goto <bb 7>; [33.00%]
else
  goto <bb 21>; [67.00%]

clearly there's missed CSE of .M_engaged here, but

  MEM[(struct optional *)_1 + -24B] = D.58534.i;

must aliases the location.

Reply via email to