https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118817
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
<bb 6> [local count: 751619280]:
*_154 ={v} {CLOBBER(bob)};
_227 = &_154->D.5702._M_local_buf;
MEM[(struct _Alloc_hider *)_154] ={v} {CLOBBER(bob)};
MEM[(struct _Alloc_hider *)_154]._M_p = _227;
__builtin_memcpy (_227, "Three", 5);
_154->_M_string_length = 5;
MEM[(char_type &)_154 + 21] = 0;
is what we diagnose.
And the reason is we do
_181 = operator new (64);
...
_164 = _181 + 32;
...
_154 = _164 + 32;
...
_175 = _181 + 64;
...
if (_154 != _175)
goto <bb 6>; [70.00%]
and we fail to eliminate the compare. Ugh.