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
This commit is contained in:
parent
9fdb837f67
commit
a0f37b26c5
@ -1,3 +1,9 @@
|
||||
2014-06-18 Andreas Schwab <schwab@suse.de>
|
||||
|
||||
PR rtl-optimization/54555
|
||||
* postreload.c (move2add_use_add2_insn): Substitute
|
||||
STRICT_LOW_PART only if it is cheaper.
|
||||
|
||||
2014-06-18 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
* config/i386/i386.md (*sibcall_memory): Rename from *sibcall_intern.
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-06-18 Andreas Schwab <schwab@suse.de>
|
||||
|
||||
PR rtl-optimization/54555
|
||||
* gcc.target/m68k/pr54555.c: New test.
|
||||
|
||||
2014-06-18 Olivier Hainque <hainque@adacore.com>
|
||||
|
||||
* gnat.dg/blocklocs.adb: New test.
|
||||
|
13
gcc/testsuite/gcc.target/m68k/pr54555.c
Normal file
13
gcc/testsuite/gcc.target/m68k/pr54555.c
Normal file
@ -0,0 +1,13 @@
|
||||
/* PR rtl-optimization/54555
|
||||
Test that postreload does not shorten the load of small constants to
|
||||
use move.b instead of moveq. */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2" } */
|
||||
/* { dg-final { scan-assembler-not "move\\.?b" } } */
|
||||
|
||||
void foo (void);
|
||||
void bar (int a)
|
||||
{
|
||||
if (a == 16 || a == 23) foo ();
|
||||
if (a == -110 || a == -128) foo ();
|
||||
}
|
Loading…
Reference in New Issue
Block a user