diff options
author | Jan Hubicka <jh@suse.cz> | 2010-11-20 21:56:48 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-11-20 20:56:48 +0000 |
commit | 700c498021be8d1f76b9a32a6c61a9e84a10e886 (patch) | |
tree | 8bfe793a5b2ef3c75a5a5457918d42d07cd9098b /gcc/stmt.c | |
parent | 1f980c2509ccaa1660297432864e79043bc2cd95 (diff) | |
download | gcc-700c498021be8d1f76b9a32a6c61a9e84a10e886.zip gcc-700c498021be8d1f76b9a32a6c61a9e84a10e886.tar.gz gcc-700c498021be8d1f76b9a32a6c61a9e84a10e886.tar.bz2 |
* stmt.c (lshift_cheap_p): Support properly optimize_insn_for_speed_p.
From-SVN: r166983
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -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 |