aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2005-01-04 21:42:52 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2005-01-04 21:42:52 +0000
commite3523f56d2fe5b163b358c96a53fb8da8a1a9426 (patch)
treefaa498a0ab57d1aac5113d7815e952b693d5d311 /gcc
parent242746f19751e1942bc851c5eee9b8bfca16169c (diff)
downloadgcc-e3523f56d2fe5b163b358c96a53fb8da8a1a9426.zip
gcc-e3523f56d2fe5b163b358c96a53fb8da8a1a9426.tar.gz
gcc-e3523f56d2fe5b163b358c96a53fb8da8a1a9426.tar.bz2
fold-const.c (fold_single_bit_test): Delete unreachable handling of TRUTH_NOT_EXPR.
* fold-const.c (fold_single_bit_test): Delete unreachable handling of TRUTH_NOT_EXPR. (fold): Don't call fold_single_bit_test with a TRUTH_NOT_EXPR, as all the cases handled by it are inverted by invert_truthvalue. From-SVN: r92909
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/fold-const.c23
2 files changed, 8 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3cfaae7..96b0483a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-04 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold_single_bit_test): Delete unreachable handling
+ of TRUTH_NOT_EXPR.
+ (fold): Don't call fold_single_bit_test with a TRUTH_NOT_EXPR, as
+ all the cases handled by it are inverted by invert_truthvalue.
+
2005-01-04 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sparc.md (save_register_windowdi): Add missing mode.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index cd7b95b..a3d1f1d 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -5829,22 +5829,6 @@ tree
fold_single_bit_test (enum tree_code code, tree arg0, tree arg1,
tree result_type)
{
- /* If this is a TRUTH_NOT_EXPR, it may have a single bit test inside
- operand 0. */
- if (code == TRUTH_NOT_EXPR)
- {
- code = TREE_CODE (arg0);
- if (code != NE_EXPR && code != EQ_EXPR)
- return NULL_TREE;
-
- /* Extract the arguments of the EQ/NE. */
- arg1 = TREE_OPERAND (arg0, 1);
- arg0 = TREE_OPERAND (arg0, 0);
-
- /* This requires us to invert the code. */
- code = (code == EQ_EXPR ? NE_EXPR : EQ_EXPR);
- }
-
/* If this is testing a single bit, we can optimize the test. */
if ((code == NE_EXPR || code == EQ_EXPR)
&& TREE_CODE (arg0) == BIT_AND_EXPR && integer_zerop (arg1)
@@ -8043,12 +8027,7 @@ fold (tree expr)
tem = invert_truthvalue (arg0);
/* Avoid infinite recursion. */
if (TREE_CODE (tem) == TRUTH_NOT_EXPR)
- {
- tem = fold_single_bit_test (code, arg0, arg1, type);
- if (tem)
- return tem;
- return t;
- }
+ return t;
return fold_convert (type, tem);
case TRUTH_ANDIF_EXPR: