summaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-20 20:56:48 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-20 20:56:48 +0000
commit274deba29f5bca2c3ead6e574651d3bf1e43f240 (patch)
tree8bfe793a5b2ef3c75a5a5457918d42d07cd9098b /gcc/stmt.c
parentaac338057596bd988b2c2c592f06b294494eff4c (diff)
downloadgcc-274deba29f5bca2c3ead6e574651d3bf1e43f240.tar.gz
* stmt.c (lshift_cheap_p): Support properly optimize_insn_for_speed_p.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166983 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index e045330ef31..b376da0fe4a 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -2122,19 +2122,21 @@ struct case_bit_test
static
bool lshift_cheap_p (void)
{
- static bool init = false;
- static bool cheap = true;
+ static bool init[2] = {false, false};
+ static bool cheap[2] = {true, true};
- if (!init)
+ bool speed_p = optimize_insn_for_speed_p ();
+
+ if (!init[speed_p])
{
rtx reg = gen_rtx_REG (word_mode, 10000);
int cost = rtx_cost (gen_rtx_ASHIFT (word_mode, const1_rtx, reg), SET,
- optimize_insn_for_speed_p ());
- cheap = cost < COSTS_N_INSNS (3);
- init = true;
+ speed_p);
+ cheap[speed_p] = cost < COSTS_N_INSNS (3);
+ init[speed_p] = true;
}
- return cheap;
+ return cheap[speed_p];
}
/* Comparison function for qsort to order bit tests by decreasing