https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90905
--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> ---
Right. The warning pass sees this:
<bb 12> [local count: 1073612976]:
__dnew ={v} {CLOBBER};
D.29156 ={v} {CLOBBER};
D.29152 ={v} {CLOBBER};
if (&str.D.19306._M_local_buf != _23)
goto <bb 13>; [53.47%]
else
goto <bb 14>; [46.53%]
<bb 13> [local count: 574060859]:
_5 = str.D.19306._M_allocated_capacity;
_3 = _5 + 1;
operator delete (_23, _3);
<bb 14> [local count: 1073612977]:
str ={v} {CLOBBER};
return _23;
Maybe the alias oracle could be put to use here after all to improve things.