diff options
author | Andreas Schwab <schwab@suse.de> | 2014-06-18 10:37:14 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@gcc.gnu.org> | 2014-06-18 10:37:14 +0000 |
commit | a0f37b26c5b459cc601ad226a6e4a13b45f5e454 (patch) | |
tree | 7d9cbd498f3d157c295b5573cf648b71a8134c51 /gcc/postreload.c | |
parent | 9fdb837f67dfa03da55cc5a9e51fa492c2a72f3b (diff) | |
download | gcc-a0f37b26c5b459cc601ad226a6e4a13b45f5e454.zip gcc-a0f37b26c5b459cc601ad226a6e4a13b45f5e454.tar.gz gcc-a0f37b26c5b459cc601ad226a6e4a13b45f5e454.tar.bz2 |
Use strict_low_part for loading a constant only if it is cheaper
PR rtl-optimization/54555
* postreload.c (move2add_use_add2_insn): Substitute
STRICT_LOW_PART only if it is cheaper.
testsuite/:
PR rtl-optimization/54555
* gcc.target/m68k/pr54555.c: New test.
From-SVN: r211777
Diffstat (limited to 'gcc/postreload.c')
-rw-r--r-- | gcc/postreload.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/postreload.c b/gcc/postreload.c index 9d71649..89f0c84 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -1805,10 +1805,14 @@ move2add_use_add2_insn (rtx reg, rtx sym, rtx off, rtx insn) gen_rtx_STRICT_LOW_PART (VOIDmode, narrow_reg), narrow_src); - changed = validate_change (insn, &PATTERN (insn), - new_set, 0); - if (changed) - break; + get_full_set_rtx_cost (new_set, &newcst); + if (costs_lt_p (&newcst, &oldcst, speed)) + { + changed = validate_change (insn, &PATTERN (insn), + new_set, 0); + if (changed) + break; + } } } } |