[Bug middle-end/85598] [7/8/9 Regression] Incorrect warning only at -O2 and -O3

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu May 10 20:57:00 GMT 2018


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

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
The problem is that the warning pass sees x as having the range of [0, 256]
rather than [0, 255].  The incorrect range can also be seen in EVRP.  There is
no warning at -O1 because the range determined at that level is that of
unsigned int which is considered to be the same as unknown.  The warning does
not trigger for such ranges.


More information about the Gcc-bugs mailing list