[Bug middle-end/104966] [11/12 Regression] Yet another bogus -Warray-bounds warning in libstdc++ headers

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 17 12:48:10 GMT 2022


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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ah, so we have

this_42(D)->_M_positive_sign_size = 0;
_62 = operator new [] (0);
  (possible EH)

<bb 35> [local count: 268220751]:
_6 = this_42(D)->_M_positive_sign_size;
_192 = MEM[(long unsigned int *)&D.281666(address-taken) + 8B];
_188 = MIN_EXPR <_6, _192>;
if (_188 != 0)
  goto <bb 36>; [50.00%]

and 'new' is now (after some "recent" fix) possibly clobbering
this->_M_positive_sign_size.  I suggest to save that to an automatic
local, only loading it once as workaround.


More information about the Gcc-bugs mailing list