summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/m68k
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2014-06-18 10:37:14 +0000
committerAndreas Schwab <schwab@gcc.gnu.org>2014-06-18 10:37:14 +0000
commita0f37b26c5b459cc601ad226a6e4a13b45f5e454 (patch)
tree7d9cbd498f3d157c295b5573cf648b71a8134c51 /gcc/testsuite/gcc.target/m68k
parent9fdb837f67dfa03da55cc5a9e51fa492c2a72f3b (diff)
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/testsuite/gcc.target/m68k')
-rw-r--r--gcc/testsuite/gcc.target/m68k/pr54555.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/m68k/pr54555.c b/gcc/testsuite/gcc.target/m68k/pr54555.c
new file mode 100644
index 00000000000..4be704b8f77
--- /dev/null
+++ b/gcc/testsuite/gcc.target/m68k/pr54555.c
@@ -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 ();
+}