diff options
author | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-19 18:41:22 +0000 |
---|---|---|
committer | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-19 18:41:22 +0000 |
commit | 076b670d63f3f04162c1218fbb34d503b3c76cd8 (patch) | |
tree | 2bcf096e2c7a2d0589b6d0f349bfdd7ccaef90f5 /gcc/optabs.c | |
parent | d09294c0fe5126ab80ad7e249cde989241e45441 (diff) | |
download | gcc-076b670d63f3f04162c1218fbb34d503b3c76cd8.tar.gz |
gcc/
PR target/40697
* optabs.c (avoid_expensive_constant): Use rtx_cost to find out
the cost of loading the constant rather than assuming
COSTS_N_INSNS (1).
* config/arm/arm.c (thumb1_rtx_costs) <case CONST_INT>: If the
outer code is AND, do the same tests as the andsi3 expander and
return COSTS_N_INSNS (1) if and is cheap.
testsuite/
PR target/40697
* gcc.target/arm/thumb-andsi.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157582 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index 747166b18d3..a82619e7cf3 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1389,11 +1389,11 @@ static rtx avoid_expensive_constant (enum machine_mode mode, optab binoptab, rtx x, bool unsignedp) { + bool speed = optimize_insn_for_speed_p (); if (mode != VOIDmode && optimize && CONSTANT_P (x) - && rtx_cost (x, binoptab->code, optimize_insn_for_speed_p ()) - > COSTS_N_INSNS (1)) + && rtx_cost (x, binoptab->code, speed) > rtx_cost (x, SET, speed)) { if (CONST_INT_P (x)) { |