diff mbox

PR54555: Use strict_low_part for loading a constant only if it is cheaper

Message ID mvm8uouzeol.fsf@hawking.suse.de
State New
Headers show

Commit Message

Andreas Schwab June 18, 2014, 10:37 a.m. UTC
Jeff Law <law@redhat.com> 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 mbox

Patch

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 ();
+}