From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17576 invoked by alias); 12 Aug 2007 10:37:32 -0000 Received: (qmail 17475 invoked by uid 22791); 12 Aug 2007 10:37:32 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 12 Aug 2007 10:37:30 +0000 Received: (qmail 16046 invoked from network); 12 Aug 2007 10:37:28 -0000 Received: from unknown (HELO gateway) (10.0.0.100) by mail.codesourcery.com with SMTP; 12 Aug 2007 10:37:28 -0000 Received: by gateway (Postfix, from userid 1010) id 619746C12E; Sun, 12 Aug 2007 03:37:28 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard@codesourcery.com Subject: RFA: A couple of testsuite tweaks for SH PIC Date: Sun, 12 Aug 2007 10:37:00 -0000 Message-ID: <87y7ghkpi0.fsf@firetop.home> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-08/txt/msg00772.txt.bz2 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-*-* } } } */