[Bug tree-optimization/24574] a!=0?a/10:0 is not reduced to a/10
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jul 12 17:32:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24574
--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
Makes sense, I don't know why I didn't add divisions in the original patch.
*_MOD_EXPR, shifts and rotates should work as well with 0 on the left, max with
INT_MAX, etc, I was quite minimalist there.
Of course, if I had gone with the simpler approach of folding the operation
after replacement (here 0 / 10) and comparing that with the PHI argument, we
wouldn't need the neutral/absorbing logic at all :-(
More information about the Gcc-bugs
mailing list