diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2004-11-18 12:09:43 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-11-18 12:09:43 +0000 |
commit | b8610a53763f72f32f5c1c79840d96ba147d93d6 (patch) | |
tree | 54f09d5690e3341c8eee2198c97fb7486b990db6 /gcc/fold-const.c | |
parent | 14492f0b1e71aeb385d252cb202ea39dee37b3c0 (diff) | |
download | gcc-b8610a53763f72f32f5c1c79840d96ba147d93d6.zip gcc-b8610a53763f72f32f5c1c79840d96ba147d93d6.tar.gz gcc-b8610a53763f72f32f5c1c79840d96ba147d93d6.tar.bz2 |
re PR rtl-optimization/17107 (Opportunity to improve code generated for complex logical expression)
PR target/17107
* fold-const.c (RANGE_TEST_NON_SHORT_CIRCUIT): Rename to ...
(LOGICAL_OP_NON_SHORT_CIRCUIT): ... here.
(fold_range_test): Adjust.
(fold_truthop): Use it.
* config/rs6000/rs6000.h (RANGE_TEST_NON_SHORT_CIRCUIT): Rename to ...
(LOGICAL_OP_NON_SHORT_CIRCUIT): ... here.
From-SVN: r90857
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 0d2e407..0c1a3d5 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -4392,8 +4392,8 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) -#ifndef RANGE_TEST_NON_SHORT_CIRCUIT -#define RANGE_TEST_NON_SHORT_CIRCUIT (BRANCH_COST >= 2) +#ifndef LOGICAL_OP_NON_SHORT_CIRCUIT +#define LOGICAL_OP_NON_SHORT_CIRCUIT (BRANCH_COST >= 2) #endif /* EXP is some logical combination of boolean tests. See if we can @@ -4431,7 +4431,7 @@ fold_range_test (tree exp) /* On machines where the branch cost is expensive, if this is a short-circuited branch and the underlying object on both sides is the same, make a non-short-circuit operation. */ - else if (RANGE_TEST_NON_SHORT_CIRCUIT + else if (LOGICAL_OP_NON_SHORT_CIRCUIT && lhs != 0 && rhs != 0 && (TREE_CODE (exp) == TRUTH_ANDIF_EXPR || TREE_CODE (exp) == TRUTH_ORIF_EXPR) @@ -4653,7 +4653,8 @@ fold_truthop (enum tree_code code, tree truth_type, tree lhs, tree rhs) ll_arg, rl_arg), fold_convert (TREE_TYPE (ll_arg), integer_zero_node)); - return build2 (code, truth_type, lhs, rhs); + if (LOGICAL_OP_NON_SHORT_CIRCUIT) + return build2 (code, truth_type, lhs, rhs); } /* See if the comparisons can be merged. Then get all the parameters for |