aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-complex.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-complex.c')
-rw-r--r--gcc/tree-complex.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 7dbc63ab12d..2835220c206 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -99,7 +99,10 @@ some_nonzerop (tree t)
{
int zerop = false;
- if (TREE_CODE (t) == REAL_CST)
+ /* Operations with real or imaginary part of a complex number zero
+ cannot be treated the same as operations with a real or imaginary
+ operand if we care about the signs of zeros in the result. */
+ if (TREE_CODE (t) == REAL_CST && !flag_signed_zeros)
zerop = REAL_VALUES_IDENTICAL (TREE_REAL_CST (t), dconst0);
else if (TREE_CODE (t) == FIXED_CST)
zerop = fixed_zerop (t);