[Bug middle-end/71224] Looping over local copy of aggregate invokes undefined behavior -Waggressive-loop-optimizations
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun May 22 18:24:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71224
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think the warning is correct and here is why:
If we look at the final code which is produced on the tree level:
_3 = pthis_2(D)->length;
_4 = _3 + 1;
if (_3 > _4)
goto <bb 4>;
else
goto <bb 3>;
If pthis_2(D)->length was UINT_MAX, then that UINT_MAX > UINT_MAX + 1 would be
true while for all other cases, it is false.
More information about the Gcc-bugs
mailing list