public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RFA: A couple of testsuite tweaks for SH PIC
@ 2007-08-12 10:37 Richard Sandiford
  2007-08-12 13:12 ` Kaz Kojima
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2007-08-12 10:37 UTC (permalink / raw)
  To: gcc-patches

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-*-* } } } */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RFA: A couple of testsuite tweaks for SH PIC
  2007-08-12 10:37 RFA: A couple of testsuite tweaks for SH PIC Richard Sandiford
@ 2007-08-12 13:12 ` Kaz Kojima
  0 siblings, 0 replies; 2+ messages in thread
From: Kaz Kojima @ 2007-08-12 13:12 UTC (permalink / raw)
  To: richard; +Cc: gcc-patches

Richard Sandiford <richard@codesourcery.com> wrote:
> 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.

This patch is OK.  Thanks!

Regards,
	kaz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-12 13:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-12 10:37 RFA: A couple of testsuite tweaks for SH PIC Richard Sandiford
2007-08-12 13:12 ` Kaz Kojima

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).