[Bug middle-end/64309] if (1 & (1 << n)) not simplified to if (n == 0)
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 15 20:46:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64309
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(1 << n) & 5 != 0 -> n == 0 || n == 2 (not beneficial)
Not only that, we actually emit similar comparisons as a bit test intentionally
even if you write it in a switch or series of ifs that way, so undoing that
optimization would be a bad idea.
More information about the Gcc-bugs
mailing list