[Bug tree-optimization/87355] missed comparison optimizations (grep DFA, x86-64)
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Sep 18 23:11:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87355
--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
For f, this is a classic case where gcc canonicalizes n>=100 as n>99, and thus
cannot as easily merge it with the other comparison n==100.
For g, n >= 103 || n == 100 || n == 101 || n == 102 is replaced in the
front-end with (n > 102 || n == 100) || (unsigned int) n + 4294967195 <= 1,
that's a bit strange. Merging comparisons into a range test is normal, but why
merge precisely tests 3 and 4? Inserting || n == 99 before n == 100 yields the
even stranger ((n > 102 || n == 99) || (unsigned int) n + 4294967196 <= 1) || n
== 102...
More information about the Gcc-bugs
mailing list