Jeff Law <[email protected]> writes:
> Let's do better this time ;-) Add a testcase for the m68k port which
> verifies we're getting the desired code.
Make sense. Installed with the following test case.
Andreas.
PR rtl-optimization/54555
* gcc.target/m68k/pr54555.c: New test.
diff --git a/gcc/testsuite/gcc.target/m68k/pr54555.c
b/gcc/testsuite/gcc.target/m68k/pr54555.c
new file mode 100644
index 0000000..4be704b
--- /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 ();
+}
--
2.0.0
--
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."