OSDN Git Service

(operand_equal_p): Constants are not equal if there has been an overflow.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 Apr 1997 01:27:07 +0000 (01:27 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 Apr 1997 01:27:07 +0000 (01:27 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13949 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fold-const.c

index f75d479..84e098a 100644 (file)
@@ -1759,11 +1759,16 @@ operand_equal_p (arg0, arg1, only_const)
     switch (TREE_CODE (arg0))
       {
       case INTEGER_CST:
     switch (TREE_CODE (arg0))
       {
       case INTEGER_CST:
-       return (TREE_INT_CST_LOW (arg0) == TREE_INT_CST_LOW (arg1)
+       return (! TREE_CONSTANT_OVERFLOW (arg0)
+               && ! TREE_CONSTANT_OVERFLOW (arg1)
+               && TREE_INT_CST_LOW (arg0) == TREE_INT_CST_LOW (arg1)
                && TREE_INT_CST_HIGH (arg0) == TREE_INT_CST_HIGH (arg1));
 
       case REAL_CST:
                && TREE_INT_CST_HIGH (arg0) == TREE_INT_CST_HIGH (arg1));
 
       case REAL_CST:
-       return REAL_VALUES_EQUAL (TREE_REAL_CST (arg0), TREE_REAL_CST (arg1));
+       return (! TREE_CONSTANT_OVERFLOW (arg0)
+               && ! TREE_CONSTANT_OVERFLOW (arg1)
+               && REAL_VALUES_EQUAL (TREE_REAL_CST (arg0),
+                                     TREE_REAL_CST (arg1)));
 
       case COMPLEX_CST:
        return (operand_equal_p (TREE_REALPART (arg0), TREE_REALPART (arg1),
 
       case COMPLEX_CST:
        return (operand_equal_p (TREE_REALPART (arg0), TREE_REALPART (arg1),