summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-22 15:01:18 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-22 15:01:18 +0000
commitcf451ad8cca177a11b8bf0dd5aa939d81cb288a1 (patch)
treeee72cba827c7a86639b3c34912d8d1ba9c6e5d2a /gcc/fold-const.c
parenta354e4e5ed31ca91532fae2650d0c4f682cbb369 (diff)
downloadgcc-cf451ad8cca177a11b8bf0dd5aa939d81cb288a1.tar.gz
* fold-const.c (fold_range_test): Use RANGE_TEST_NON_SHORT_CIRCUIT
macro defaulting to original BRANCH_COST heuristic. * doc/tm.texi (RANGE_TEST_NON_SHORT_CIRCUIT): Document. * config/rs6000/rs6000.h (RANGE_TEST_NON_SHORT_CIRCUIT): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65942 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 146f40f97ac..eb65795e913 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -3414,6 +3414,10 @@ merge_ranges (pin_p, plow, phigh, in0_p, low0, high0, in1_p, low1, high1)
return 1;
}
+#ifndef RANGE_TEST_NON_SHORT_CIRCUIT
+#define RANGE_TEST_NON_SHORT_CIRCUIT (BRANCH_COST >= 2)
+#endif
+
/* EXP is some logical combination of boolean tests. See if we can
merge it into some range test. Return the new tree if so. */
@@ -3450,7 +3454,7 @@ fold_range_test (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 (BRANCH_COST >= 2
+ else if (RANGE_TEST_NON_SHORT_CIRCUIT
&& lhs != 0 && rhs != 0
&& (TREE_CODE (exp) == TRUTH_ANDIF_EXPR
|| TREE_CODE (exp) == TRUTH_ORIF_EXPR)