From: Roger Sayle Date: Tue, 4 Jan 2005 21:42:52 +0000 (+0000) Subject: fold-const.c (fold_single_bit_test): Delete unreachable handling of TRUTH_NOT_EXPR. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e3523f56d2fe5b163b358c96a53fb8da8a1a9426;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3cfaae796cb..96b0483a8f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-01-04 Roger Sayle + + * 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 * config/sparc/sparc.md (save_register_windowdi): Add missing mode. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index cd7b95be483..a3d1f1d5350 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: