[RFC] optimize x - y cmp 0 with undefined overflow

Eric Botcazou ebotcazou@adacore.com
Mon Sep 29 23:01:00 GMT 2014


> Yeah, that sounds good to me.

Here's what I have at last commited after testing on x86-64/Linux.


2014-09-29  Eric Botcazou  <ebotcazou@adacore.com>

        * tree-vrp.c (get_single_symbol): New function.
        (build_symbolic_expr): Likewise.
        (symbolic_range_based_on_p): New predicate.
        (extract_range_from_binary_expr_1): Deal with single-symbolic ranges
        for PLUS and MINUS.  Do not drop symbolic ranges at the end.
        (extract_range_from_binary_expr): Try harder for PLUS and MINUS if
        operand is symbolic and based on the other operand.


2014-09-29  Eric Botcazou  <ebotcazou@adacore.com>

        * gcc.dg/tree-ssa/vrp94.c: New test.
        * gnat.dg/opt40.adb: Likewise.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vrp_symbolic-2.diff
Type: text/x-patch
Size: 16928 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140929/668f08c9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vrp94.c
Type: text/x-csrc
Size: 496 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140929/668f08c9/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opt40.adb
Type: text/x-adasrc
Size: 380 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140929/668f08c9/attachment-0002.bin>


More information about the Gcc-patches mailing list