aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-05-17 07:07:44 +0000
committerRichard Stallman <rms@gnu.org>1992-05-17 07:07:44 +0000
commita6acbe157bfce225b8f91b2496ae4588af7cd5e0 (patch)
tree2c768c4ea7d3392df2ae5d195cd62d9656ec05bb /gcc/fold-const.c
parentb8168f0d34366808143d0f0365243d0a13e520eb (diff)
downloadgcc-a6acbe157bfce225b8f91b2496ae4588af7cd5e0.zip
gcc-a6acbe157bfce225b8f91b2496ae4588af7cd5e0.tar.gz
gcc-a6acbe157bfce225b8f91b2496ae4588af7cd5e0.tar.bz2
*** empty log message ***
From-SVN: r999
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 029f25c..dd26986 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -3007,15 +3007,17 @@ fold (expr)
/* Except with IEEE floating point, x-0 equals x. */
if (real_zerop (arg1))
return non_lvalue (convert (type, arg0));
- }
- /* Fold &x - &x. This can happen from &x.foo - &x.
- Note that can't be done for certain floats even in non-IEEE formats.
- Also note that operand_equal_p is always false is an operand
- is volatile. */
- if (operand_equal_p (arg0, arg1,
- TREE_CODE (type) == REAL_TYPE))
- return convert (type, integer_zero_node);
+ /* Fold &x - &x. This can happen from &x.foo - &x.
+ This is unsafe for certain floats even in non-IEEE formats.
+ In IEEE, it is unsafe because it does wrong for NaNs.
+ Also note that operand_equal_p is always false is an operand
+ is volatile. */
+
+ if (operand_equal_p (arg0, arg1,
+ TREE_CODE (type) == REAL_TYPE))
+ return convert (type, integer_zero_node);
+ }
goto associate;
case MULT_EXPR: