[Bug tree-optimization/108757] We do not simplify (a - (N*M)) / N + M -> a / N

chip.kerchner at ibm dot com gcc-bugzilla@gcc.gnu.org
Sat Feb 11 19:45:41 GMT 2023


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

--- Comment #9 from Chip Kerchner <chip.kerchner at ibm dot com> ---
Doesn't this work for powers of two (N) and signed values (for A, N and M)?

(59 - (33 * -2)) / -2 + 31 = -62 + 31 = -29

and

59 / -2 = -29


More information about the Gcc-bugs mailing list