This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Restrict to ColdFire.


Attached is a patch to restrict pr36134.c to ColdFire. FAILs because the testcase looks for LEA
instruction, but GCC does not generate the instruction on CPU32,
including fido.  GCC prefers a sequence of ADDQ and SUBQ on CPU32
because that is faster.

Note that the patch to fix PR 36134 was specific to ColdFire as you
can see in:

This patch fixes the problem by specifying -mcpu=5208 as the
optimization is specific to ColdFire.  If there is a conflict
involving -mcpu=, we skip the testcase.

Tested by running the testcase on fido-none-elf.  OK to apply?

Kazu Hirata

2009-05-04  Kazu Hirata  <>

	* Use dg-skip-if to skip the testcase
	if there is a conflict with -mcpu=.  Use -mcpu=5208.

Index: gcc/testsuite/
--- gcc/testsuite/	(revision 146079)
+++ gcc/testsuite/	(working copy)
@@ -1,10 +1,15 @@
 /* pr36134.c
    This test ensures that the shorter LEA instruction is used in preference
-   to the longer ADD instruction.  */
+   to the longer ADD instruction.
+   This preference is applicable to ColdFire only.  On CPU32, we can
+   use a sequence of two ADDQ instructions, which is faster than the
+   LEA instruction.  */
 /* { dg-do compile }  */
-/* { dg-options "-O2" }  */
+/* { dg-skip-if "" { *-*-* } { "-mcpu=*" } { "-mcpu=5208" } } */
+/* { dg-options "-O2 -mcpu=5208" }  */
 /* { dg-final { scan-assembler "lea" } } */
 /* { dg-final { scan-assembler-not "add" } } */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]