[Bug tree-optimization/61502] == comparison on "one-past" pointer gives wrong result

ch3root at openwall dot com gcc-bugzilla@gcc.gnu.org
Mon Dec 23 13:15:00 GMT 2019


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

--- Comment #34 from Alexander Cherepanov <ch3root at openwall dot com> ---
It seems to me that problems with the optimization `if (p == q) use p` -> `if
(p == q) use q` (comment 4 etc.) are not specific to past-the-end pointers. So
I filed a separated bug for it with various testcases -- see pr93051.

The same for the optimization `p == q ? p : q` -> `q` (comment 30) -- see
pr93052.


More information about the Gcc-bugs mailing list