aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>2003-04-21 17:35:44 -0400
committerRichard Kenner <kenner@gcc.gnu.org>2003-04-21 17:35:44 -0400
commit63f60ecb140af7ca96f4971ab2e190a3d3d6e389 (patch)
tree1c9acf32dbd8045dc53336c6ee3d6880e68d987f /gcc
parent0d2f38ee4068f6d836a975f9e91663f72e17d93e (diff)
downloadgcc-63f60ecb140af7ca96f4971ab2e190a3d3d6e389.zip
gcc-63f60ecb140af7ca96f4971ab2e190a3d3d6e389.tar.gz
gcc-63f60ecb140af7ca96f4971ab2e190a3d3d6e389.tar.bz2
Revert hunks not part of last patch.
From-SVN: r65908
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fold-const.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 146f40f..fa64fd2 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4182,12 +4182,8 @@ extract_muldiv_1 (t, c, code, wide_type)
/* Pass the constant down and see if we can make a simplification. If
we can, replace this expression with the inner simplification for
possible later conversion to our or some other type. */
- if ((t2 = convert (TREE_TYPE (op0), c)) != 0
- && TREE_CODE (t2) == INTEGER_CST
- && ! TREE_CONSTANT_OVERFLOW (t2)
- && (0 != (t1 = extract_muldiv (op0, t2, code,
- code == MULT_EXPR
- ? ctype : NULL_TREE))))
+ if (0 != (t1 = extract_muldiv (op0, convert (TREE_TYPE (op0), c), code,
+ code == MULT_EXPR ? ctype : NULL_TREE)))
return t1;
break;
@@ -5482,17 +5478,13 @@ fold (expr)
if (TREE_CODE (parg0) == MULT_EXPR
&& TREE_CODE (parg1) != MULT_EXPR)
return fold (build (PLUS_EXPR, type,
- fold (build (PLUS_EXPR, type,
- convert (type, parg0),
- convert (type, marg))),
- convert (type, parg1)));
+ fold (build (PLUS_EXPR, type, parg0, marg)),
+ parg1));
if (TREE_CODE (parg0) != MULT_EXPR
&& TREE_CODE (parg1) == MULT_EXPR)
return fold (build (PLUS_EXPR, type,
- fold (build (PLUS_EXPR, type,
- convert (type, parg1),
- convert (type, marg))),
- convert (type, parg0)));
+ fold (build (PLUS_EXPR, type, parg1, marg)),
+ parg0));
}
if (TREE_CODE (arg0) == MULT_EXPR && TREE_CODE (arg1) == MULT_EXPR)
@@ -5824,8 +5816,7 @@ fold (expr)
TREE_OPERAND (arg0, 1)));
if (TREE_CODE (arg1) == INTEGER_CST
- && 0 != (tem = extract_muldiv (TREE_OPERAND (t, 0),
- convert (type, arg1),
+ && 0 != (tem = extract_muldiv (TREE_OPERAND (t, 0), arg1,
code, NULL_TREE)))
return convert (type, tem);