[Bug c/79546] Strange error: missed loop optimization, the loop counter may overflow [-Werror=unsafe-loop-optimizations]

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 15 23:22:00 GMT 2017


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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>-Werror=unsafe-loop-optimizations

That is not enabled by default even with -Werror -W -Wall.

But "missed loop optimization, the loop counter may overflow" is basically
saying if i was an signed integer, the loop counter would overflow in some
cases.  The case depends the value of len.  The only way to fix this would be
rewrite the code so that case would not happen.
The cases where it would happen is len = SIZET_MIN ... SIZET_MIN-0x0FFF (if I
did my math correctly).


More information about the Gcc-bugs mailing list