aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2005-03-04 06:24:09 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2005-03-03 22:24:09 -0800
commit935167332d4ee2b0bb173e40a6cf36db53b67d16 (patch)
treef56735cae147ea5b7f7fd4e20aaa0eed733555a6 /gcc
parent99ff9e7a1543a94af8e777e0aa4393fdb9cf4b3d (diff)
downloadgcc-935167332d4ee2b0bb173e40a6cf36db53b67d16.zip
gcc-935167332d4ee2b0bb173e40a6cf36db53b67d16.tar.gz
gcc-935167332d4ee2b0bb173e40a6cf36db53b67d16.tar.bz2
revert: re PR tree-optimization/15784 (fold misses binary optimization)
2005-03-04 Andrew Pinski <pinskia@physics.uc.edu> Revert for now: 2005-03-03 James A. Morrison <phython@gcc.gnu.org> PR tree-optimization/15784 * fold-const.c (fold): Fold ~A + 1 to -1. Fold -A - 1 and -1 - A to ~A. From-SVN: r95880
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/fold-const.c15
2 files changed, 8 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ce68c0e..be6abe6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2005-03-04 Andrew Pinski <pinskia@physics.uc.edu>
+
+ Revert for now:
+ 2005-03-03 James A. Morrison <phython@gcc.gnu.org>
+ PR tree-optimization/15784
+ * fold-const.c (fold): Fold ~A + 1 to -1. Fold -A - 1
+ and -1 - A to ~A.
+
2005-03-04 Ben Elliston <bje@au.ibm.com>
* gcc.c (option_map): Add --coverage.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index c494d4f..517c45d 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -7454,11 +7454,6 @@ fold (tree expr)
if (TREE_CODE (arg0) == NEGATE_EXPR
&& reorder_operands_p (TREE_OPERAND (arg0, 0), arg1))
return fold (build2 (MINUS_EXPR, type, arg1, TREE_OPERAND (arg0, 0)));
- /* Convert ~A + 1 to -A. */
- if (INTEGRAL_TYPE_P (type)
- && TREE_CODE (arg0) == BIT_NOT_EXPR
- && integer_onep (arg1))
- return fold (build1 (NEGATE_EXPR, type, TREE_OPERAND (arg0, 0)));
if (TREE_CODE (type) == COMPLEX_TYPE)
{
@@ -7897,16 +7892,6 @@ fold (tree expr)
&& reorder_operands_p (arg0, arg1))
return fold (build2 (MINUS_EXPR, type, negate_expr (arg1),
TREE_OPERAND (arg0, 0)));
- /* Convert -A - 1 to ~A. */
- if (INTEGRAL_TYPE_P (type)
- && TREE_CODE (arg0) == NEGATE_EXPR
- && integer_onep (arg1))
- return fold (build1 (BIT_NOT_EXPR, type, TREE_OPERAND (arg0, 0)));
-
- /* Convert -1 - A to ~A. */
- if (INTEGRAL_TYPE_P (type)
- && integer_all_onesp (arg0))
- return fold (build1 (BIT_NOT_EXPR, type, arg1));
if (TREE_CODE (type) == COMPLEX_TYPE)
{