summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-15 05:03:01 +0000
committermatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-15 05:03:01 +0000
commita449953cf9f859da496ecfeee7d2d05c5af3300b (patch)
tree71cce1f99ee510dfc33760561e6423fac9b8fa98
parent0863585c9ba53b2500fc9f15fc9bd6516f8fa18a (diff)
downloadppe42-gcc-a449953cf9f859da496ecfeee7d2d05c5af3300b.tar.gz
ppe42-gcc-a449953cf9f859da496ecfeee7d2d05c5af3300b.zip
* tree-vrp.c (vrp_int_const_binop <MINUS_EXPR>): Handle 0 - -INF.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104298 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/tree-vrp.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b424f3068af..e111d5d87da 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2005-09-15 Michael Matz <matz@suse.de>
+
+ * tree-vrp.c (vrp_int_const_binop <MINUS_EXPR>): Handle 0 - -INF.
+
2005-09-14 Daniel Berlin <dberlin@dberlin.org>
PR tree-optimization/23835
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index a7be2d9cc2e..e802b2db802 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -956,8 +956,10 @@ vrp_int_const_binop (enum tree_code code, tree val1, tree val2)
/* For subtraction, the operands must be of different
signs to yield an overflow. Its sign is therefore
that of the first operand or the opposite of that
- of the second operand. */
- || (code == MINUS_EXPR && sgn1 > 0)
+ of the second operand. A first operand of 0 counts
+ as positive here, for the corner case 0 - (-INF),
+ which overflows, but must yield +INF. */
+ || (code == MINUS_EXPR && sgn1 >= 0)
/* For division, the only case is -INF / -1 = +INF. */
|| code == TRUNC_DIV_EXPR
|| code == FLOOR_DIV_EXPR
OpenPOWER on IntegriCloud