This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: A couple of testsuite tweaks for SH PIC
- From: Richard Sandiford <richard at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 12 Aug 2007 11:37:27 +0100
- Subject: RFA: A couple of testsuite tweaks for SH PIC
First, pr21255.c is:
--------------------------------------------------------------------------
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O2 -fomit-frame-pointer" } */
double
f ()
{
double r;
asm ("mov %S1,%S0; mov %R1,%R0" : "=r" (r) : "i" (f));
/* { dg-error "invalid operand to %S" "" {target "sh*-*-*" } 9 } */
/* { dg-error "invalid operand to %R" "" {target "sh*-*-*" } 9 } */
return r;
}
--------------------------------------------------------------------------
So the idea is that "f" is valid for the "i" constraint, but is used
with an inappropriate operand prefix. However, "f" isn't valid for
"i" when generating PIC. The patch below adds a "nonpic" requirement.
Second, gcc.dg/tree-ssa/loop-1.c has:
--------------------------------------------------------------------------
/* { dg-final { scan-assembler-times "jsr|blink\ttr?,r18" 5 { target sh*-*-* } } } */
--------------------------------------------------------------------------
But SH can also use bsrf when compiling PIC for an SH4 target.
The patch below adds that as a third alternative.
Tested on sh-wrs-vxworks ({,-mrtp,-mrtp/-non-static,-mrtp/-fPIC}).
OK to install?
Richard
gcc/testsuite/
* gcc.dg/pr21255-4.c: Skip for PIC.
* gcc.dg/tree-ssa/loop-1.c: Allow bsrf as well as jsr for SH targets.
Index: gcc/testsuite/gcc.dg/pr21255-4.c
===================================================================
--- gcc/testsuite/gcc.dg/pr21255-4.c (revision 127359)
+++ gcc/testsuite/gcc.dg/pr21255-4.c (working copy)
@@ -1,4 +1,4 @@
-/* { dg-do compile { target "sh*-*-*" } } */
+/* { dg-do compile { target { sh*-*-* && nonpic } } } */
/* { dg-options "-O2 -fomit-frame-pointer" } */
double
Index: gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/loop-1.c (revision 127359)
+++ gcc/testsuite/gcc.dg/tree-ssa/loop-1.c (working copy)
@@ -42,6 +42,6 @@ void xxx(void)
/* { dg-final { scan-assembler-times "foo" 5 { xfail hppa*-*-* ia64*-*-* sh*-*-* cris-*-* fido-*-* m68k-*-* } } } */
/* { dg-final { scan-assembler-times "foo,%r" 5 { target hppa*-*-* } } } */
/* { dg-final { scan-assembler-times "= foo" 5 { target ia64*-*-* } } } */
-/* { dg-final { scan-assembler-times "jsr|blink\ttr?,r18" 5 { target sh*-*-* } } } */
+/* { dg-final { scan-assembler-times "jsr|bsrf|blink\ttr?,r18" 5 { target sh*-*-* } } } */
/* { dg-final { scan-assembler-times "Jsr \\\$r" 5 { target cris-*-* } } } */
/* { dg-final { scan-assembler-times "\[jb\]sr" 5 { target fido-*-* m68k-*-* } } } */