aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-10-05 13:35:07 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-10-05 09:35:07 -0400
commitb8fbe62c82e854fb02bca685c84bfa8c1a57b8f9 (patch)
treecea16f7e2671099aa14b7cb4bb23dbeb3affd0a5 /gcc/fold-const.c
parent35ba173387bbe16802679a210357c800a4ee55f0 (diff)
downloadgcc-b8fbe62c82e854fb02bca685c84bfa8c1a57b8f9.zip
gcc-b8fbe62c82e854fb02bca685c84bfa8c1a57b8f9.tar.gz
gcc-b8fbe62c82e854fb02bca685c84bfa8c1a57b8f9.tar.bz2
fold-const.c (fold, [...]): Perform negation in proper type.a
* fold-const.c (fold, case MINUS_EXPR, case EQ_EXPR): Perform negation in proper type.a From-SVN: r36726
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index ecc7c32..6908d71 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -5576,7 +5576,7 @@ fold (expr)
if (! FLOAT_TYPE_P (type))
{
if (! wins && integer_zerop (arg0))
- return convert (type, negate_expr (arg1));
+ return negate_expr (convert (type, arg1));
if (integer_zerop (arg1))
return non_lvalue (convert (type, arg0));
@@ -5599,7 +5599,7 @@ fold (expr)
{
/* Except with IEEE floating point, 0-x equals -x. */
if (! wins && real_zerop (arg0))
- return convert (type, negate_expr (arg1));
+ return negate_expr (convert (type, arg1));
/* Except with IEEE floating point, x-0 equals x. */
if (real_zerop (arg1))
return non_lvalue (convert (type, arg0));
@@ -6888,7 +6888,12 @@ fold (expr)
{
case EQ_EXPR:
return
- pedantic_non_lvalue (convert (type, negate_expr (arg1)));
+ pedantic_non_lvalue
+ (convert (type,
+ negate_expr
+ (convert (TREE_TYPE (TREE_OPERAND (t, 1)),
+ arg1))));
+
case NE_EXPR:
return pedantic_non_lvalue (convert (type, arg1));
case GE_EXPR: