Commit e3523f56 by Roger Sayle Committed by Roger Sayle

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
parent 242746f1
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> 2005-01-04 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sparc.md (save_register_windowdi): Add missing mode. * config/sparc/sparc.md (save_register_windowdi): Add missing mode.
......
...@@ -5829,22 +5829,6 @@ tree ...@@ -5829,22 +5829,6 @@ tree
fold_single_bit_test (enum tree_code code, tree arg0, tree arg1, fold_single_bit_test (enum tree_code code, tree arg0, tree arg1,
tree result_type) 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 this is testing a single bit, we can optimize the test. */
if ((code == NE_EXPR || code == EQ_EXPR) if ((code == NE_EXPR || code == EQ_EXPR)
&& TREE_CODE (arg0) == BIT_AND_EXPR && integer_zerop (arg1) && TREE_CODE (arg0) == BIT_AND_EXPR && integer_zerop (arg1)
...@@ -8043,12 +8027,7 @@ fold (tree expr) ...@@ -8043,12 +8027,7 @@ fold (tree expr)
tem = invert_truthvalue (arg0); tem = invert_truthvalue (arg0);
/* Avoid infinite recursion. */ /* Avoid infinite recursion. */
if (TREE_CODE (tem) == TRUTH_NOT_EXPR) if (TREE_CODE (tem) == TRUTH_NOT_EXPR)
{ return t;
tem = fold_single_bit_test (code, arg0, arg1, type);
if (tem)
return tem;
return t;
}
return fold_convert (type, tem); return fold_convert (type, tem);
case TRUTH_ANDIF_EXPR: case TRUTH_ANDIF_EXPR:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment