]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* tree-vrp.c (vrp_int_const_binop <MINUS_EXPR>): Handle 0 - -INF.
authorMichael Matz <matz@suse.de>
Thu, 15 Sep 2005 05:03:01 +0000 (05:03 +0000)
committerMichael Matz <matz@gcc.gnu.org>
Thu, 15 Sep 2005 05:03:01 +0000 (05:03 +0000)
From-SVN: r104298

gcc/ChangeLog
gcc/tree-vrp.c

index b424f3068af0edc9ac807ef387d438245e12a524..e111d5d87da24c9c97b6b813a9bce3faed4c4770 100644 (file)
@@ -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
index a7be2d9cc2ec0487fec689185061b32049a9f1d5..e802b2db802dd047d5048f61d0391e310bb03fe5 100644 (file)
@@ -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