diff options
Diffstat (limited to 'gcc/fold-const.c')
| -rw-r--r-- | gcc/fold-const.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index cd7f1d9..b19b768 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2584,8 +2584,19 @@ operand_equal_p (tree arg0, tree arg1, unsigned int flags) return tree_int_cst_equal (arg0, arg1); case REAL_CST: - return REAL_VALUES_IDENTICAL (TREE_REAL_CST (arg0), - TREE_REAL_CST (arg1)); + if (REAL_VALUES_IDENTICAL (TREE_REAL_CST (arg0), + TREE_REAL_CST (arg1))) + return 1; + + + if (!HONOR_SIGNED_ZEROS (TYPE_MODE (TREE_TYPE (arg0)))) + { + /* If we do not distinguish between signed and unsigned zero, + consider them equal. */ + if (real_zerop (arg0) && real_zerop (arg1)) + return 1; + } + return 0; case VECTOR_CST: { |
