Patchwork PR target/55565: update failing powerpc test

login
register
mail settings
Submitter Aldy Hernandez
Date Jan. 10, 2013, 7:40 p.m.
Message ID <50EF1919.8010706@redhat.com>
Download mbox | patch
Permalink /patch/211128/
State New
Headers show

Comments

Aldy Hernandez - Jan. 10, 2013, 7:40 p.m.
On 01/10/13 12:58, Dominique Dhumieres wrote:
> Hi,
>
> AFAIU the regexps, they are not doing what they are supposed to do
> on powerpc-apple-darwin9: the assembly reads
>
> 	fmr f1,f0
>
> i.e., fmr \[0-9\]+ or fmr 1 are never found.
>
> If I use "fmr f?\[0-9\]+,f?\[0-9\]+", then the test fails,
> in line with the other powerpc.
> If I use "lfd \(f?\[0-9\]+\),\[^\n\r\]*\[\n\r\]+\[ \t]*fmr f?1,\\1\[\n\r\]+\[ \t]*blr"
> the test passes.

I didn't tackle the Darwin issue since the original test was ignored on 
Darwin, but I guess it doesn't hurt to handle the Darwin "f" register 
variants.

OK for trunk?
commit 61ceeb130c2c2c342f19e716397ffddd212a0b32
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Thu Jan 10 11:58:37 2013 -0600

    	PR target/55565
    	* gcc.target/powerpc/ppc-mov-1.c: Update scan-assembler-not
    	regex.
Jakub Jelinek - Jan. 10, 2013, 7:54 p.m.
On Thu, Jan 10, 2013 at 01:40:09PM -0600, Aldy Hernandez wrote:
> commit 61ceeb130c2c2c342f19e716397ffddd212a0b32
> Author: Aldy Hernandez <aldyh@redhat.com>
> Date:   Thu Jan 10 11:58:37 2013 -0600
> 
>     	PR target/55565
>     	* gcc.target/powerpc/ppc-mov-1.c: Update scan-assembler-not
>     	regex.

Ok with:

> diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-mov-1.c b/gcc/testsuite/gcc.target/powerpc/ppc-mov-1.c
> index 750cf85..f843015 100644
> --- a/gcc/testsuite/gcc.target/powerpc/ppc-mov-1.c
> +++ b/gcc/testsuite/gcc.target/powerpc/ppc-mov-1.c
> @@ -1,7 +1,7 @@
>  /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
>  /* { dg-options "-O2" } */
>  
> -/* { dg-final { scan-assembler-not "fmr \[0-9\]+,\[0-9\]+" } }
> +/* { dg-final { scan-assembler-not "lfd \(f?\[0-9\]+\),\[^\n\r\]*\[\n\r\]+\[ \t]*fmr f?1,f?\\1\[\n\r\]+\[ \t]*blr" } } */

                                                                                       The ,f?
before \\1 removed.  The optional f will be matched already from \\1.

	Jakub
Dominique Dhumieres - Jan. 10, 2013, 7:57 p.m.
> PS. IIRC some previous discussions around such darwin peculiarities
> the f? decoration may be too simplistic to cover all the powerpc
> flavors (A. Pinski may know better).

I have found the links for that: r168960 (pr41146). A. Pinski asked to
add %?. I don't know which ppc platform uses it and if it does also
for floating-point register, nevertheless the following regexp

"lfd \(%?f?\[0-9\]+\),\[^\n\r\]*\[\n\r\]+\[ \t]*fmr %?f?1,\\1\[\n\r\]+\[ \t]*blr"

also works for darwin.

TIA

Dominique
Andrew Pinski - Jan. 10, 2013, 7:59 p.m.
On Thu, Jan 10, 2013 at 11:57 AM, Dominique Dhumieres
<dominiq@lps.ens.fr> wrote:
>> PS. IIRC some previous discussions around such darwin peculiarities
>> the f? decoration may be too simplistic to cover all the powerpc
>> flavors (A. Pinski may know better).
>
> I have found the links for that: r168960 (pr41146). A. Pinski asked to
> add %?. I don't know which ppc platform uses it and if it does also
> for floating-point register, nevertheless the following regexp

% is only used when -mregnames is used and then f is also included.

Thanks,
Andrew

>
> "lfd \(%?f?\[0-9\]+\),\[^\n\r\]*\[\n\r\]+\[ \t]*fmr %?f?1,\\1\[\n\r\]+\[ \t]*blr"
>
> also works for darwin.
>
> TIA
>
> Dominique
>

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-mov-1.c b/gcc/testsuite/gcc.target/powerpc/ppc-mov-1.c
index 750cf85..f843015 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-mov-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-mov-1.c
@@ -1,7 +1,7 @@ 
 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
 /* { dg-options "-O2" } */
 
-/* { dg-final { scan-assembler-not "fmr \[0-9\]+,\[0-9\]+" } }
+/* { dg-final { scan-assembler-not "lfd \(f?\[0-9\]+\),\[^\n\r\]*\[\n\r\]+\[ \t]*fmr f?1,f?\\1\[\n\r\]+\[ \t]*blr" } } */
 
 /* Origin:Pete Steinmetz <steinmtz@us.ibm.com> */