[Bug tree-optimization/64454] optimize (x%5)%5

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri May 15 18:07:00 GMT 2015


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

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #12)
> One last thing that would have been nice: in VRP, if the range of X is
> included in [10,14], X%5 can be simplified to X-10. But it is probably not
> worth the trouble.

It might also be useful if the range is [0,10] for x%5 to be simplified down to
just "t = x-5; x>=5?t:x;"  And yes this shows up in some places; mainly dealing
with character digit to number conversions.



More information about the Gcc-bugs mailing list