From: nathan Date: Thu, 18 Nov 2004 12:09:43 +0000 (+0000) Subject: PR target/17107 X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=17529f9823fb9d0ecc4817fa46b78a35bdd8f7a7;p=pf3gnuchains%2Fgcc-fork.git 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90857 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fdde9c221ce..4766d4ac507 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2004-11-18 Nathan Sidwell + + 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. + 2004-11-18 Uros Bizjak * configure/i386/i386.md (*fix_trunch_1): Add "&& 1" to diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 1b74db8080a..912f40eee90 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1096,9 +1096,9 @@ extern const char *rs6000_warn_altivec_long_switch; #define BRANCH_COST 3 /* Override BRANCH_COST heuristic which empirically produces worse - performance for fold_range_test(). */ + performance for removing short circuiting from the logical ops. */ -#define RANGE_TEST_NON_SHORT_CIRCUIT 0 +#define LOGICAL_OP_NON_SHORT_CIRCUIT 0 /* A fixed register used at prologue and epilogue generation to fix addressing modes. The SPE needs heavy addressing fixes at the last diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 0d2e4076926..0c1a3d587c5 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