[Bug tree-optimization/64322] More optimize opportunity for constant folding

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 16 00:41:00 GMT 2014


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
First of all, I wonder why already VRP can't handle this.
To do so it would need to add RSHIFT_EXPR to the codes that we handle different
range kinds form (like PLUS_EXPR, BIT_AND_EXPR etc.), and simply if the second
range is range_int_cst_p and the first range is not VR_RANGE, just pretend the
first range is VR_RANGE from min to max value.  Say on the x >> 63 from the
testcase it should figure out the VR is [-1, 0] and thus for double that
[-2, 0] and for division by 0x100000000L that it must be 0.



More information about the Gcc-bugs mailing list