public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, X86] Revise fuse-caller-save-* to avoid XPASSes on PIC targets.
@ 2019-05-22 18:41 Iain Sandoe
  2019-05-23  6:23 ` Uros Bizjak
  0 siblings, 1 reply; 7+ messages in thread
From: Iain Sandoe @ 2019-05-22 18:41 UTC (permalink / raw)
  To: GCC Patches; +Cc: Uros Bizjak, Tom de Vries, H.J. Lu

As Dominque noted in PR 64895, somewhere between revisions
 r244915 and r244957 we see the fuse-caller-save* tests started to
XPASS on Darwin, which is a PIC target by default.

The XFAILed parts of the tests never seem to be exercised on 
Linux, and therefore the change would be unnoticed there.

I have attached an analysis to the PR of the latest codegen from Linux
(which is identical to Darwin modulo the syntactic differences of PIC
accesses on the m32 platforms).

AFAICT, from the thread in the PR, codegen now seems to be correct.
Even if the codegen is still not right, the test conditions need amendment
to reflect the current status quo (and the XFAILs are no longers needed).

One test requires amendment for the PIC case on Linux, the remainer
of the changes are removals of the XFAILs.

With the attached patch both Linux and Darwin show 17 / 18 passes m32 / m64.

OK for trunk?
Relevant branch(es)?

Iain

gcc/testsuite/

	PR rtl-optimisation/64895
	* gcc.target/i386/fuse-caller-save-rec.c: Remove XFAILs.
	* gcc.target/i386/fuse-caller-save.c: Likewise.
	* gcc.target/i386/fuse-caller-save-xmm.c: Adjust tests for
	PIC cases, remove XFAILs.

diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
index 7abcf91..e8d4efb 100644
--- a/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
+++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
@@ -18,14 +18,12 @@ foo (int y)
   return y + bar (y);
 }
 
-/* For !nonpic && ia32 xfails, see PR64895.  */
-
 /* Check that no registers are saved/restored. */
-/* { dg-final { scan-assembler-not "push" { xfail { { ! nonpic } && ia32 } } } } */
-/* { dg-final { scan-assembler-not "pop" { xfail { { ! nonpic } && ia32 } } } } */
+/* { dg-final { scan-assembler-not "push" } } */
+/* { dg-final { scan-assembler-not "pop" } } */
 
 /* Check that addition uses dx. */
-/* { dg-final { scan-assembler-times "addl\t%\[re\]?dx, %\[re\]?ax" 1 { xfail { { ! nonpic } && ia32 } } } } */
+/* { dg-final { scan-assembler-times "addl\t%\[re\]?dx, %\[re\]?ax" 1 } } */
 
 /* Verify that bar is self-recursive.  */
 /* { dg-final { scan-assembler-times "call\t_?bar" 2 } } */
diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
index c2d0544..02a5f5b 100644
--- a/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
+++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
@@ -15,13 +15,18 @@ foo (v2df y)
   return y + bar (y);
 }
 
-/* For !nonpic && ia32 xfails, see PR64895.  */
-
 /* Check presence of all insns on xmm registers.  These checks are expected to
    pass with both -fipa-ra and -fno-ipa-ra.  */
-/* { dg-final { scan-assembler-times "addpd\t\\.?LC0.*, %xmm0" 1 } } */
-/* { dg-final { scan-assembler-times "addpd\t%xmm1, %xmm0" 1 { xfail { { ! nonpic } && ia32 } } } } */
-/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm1" 1 { xfail { { ! nonpic } && ia32 } } } } */
+
+/* { dg-final { scan-assembler-times {addpd\t\.?[Ll]C0.*, %xmm0} 1 { target { { ! ia32 } || nonpic } } } } */
+/* { dg-final { scan-assembler-times {movapd\t\.?[Ll]C0.*, %xmm1} 1 { target { ia32 && { ! nonpic } } } } } */
+
+/* We happen to get this for both cases, but in different positions.  */
+/* { dg-final { scan-assembler-times "addpd\t%xmm1, %xmm0" 1 } } */
+
+/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm1" 1 { target { { ! ia32 } || nonpic } } } } */
+/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm2" 1 { target { ia32 && { ! nonpic } } } } } */
+/* { dg-final { scan-assembler-times "addpd\t%xmm2, %xmm0" 1 { target { ia32 && { ! nonpic } } } } } */
 
 /* Check absence of save/restore of xmm1 register.  */
 /* { dg-final { scan-assembler-not "movaps\t%xmm1, \\(%\[re\]?sp\\)" } } */
diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
index 4b8e68d..c0e8bf4 100644
--- a/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
+++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
@@ -16,11 +16,9 @@ foo (int y)
   return y + bar (y);
 }
 
-/* For !nonpic && ia32 xfails, see PR64895.  */
-
 /* Check that no registers are saved/restored. */
-/* { dg-final { scan-assembler-not "push" { xfail { { ! nonpic } && ia32 } } } } */
-/* { dg-final { scan-assembler-not "pop" { xfail { { ! nonpic } && ia32 } } } } */
+/* { dg-final { scan-assembler-not "push" } } */
+/* { dg-final { scan-assembler-not "pop" } } */
 
 /* PR61605.  If the first argument register and the return register differ, then
    bar leaves the first argument register intact.  That means in foo that the
@@ -31,4 +29,4 @@ foo (int y)
 /* { dg-final { scan-assembler-not "movl" { target { ! ia32 } } } } */
 
 /* Check that addition uses di (in case of no copy) or dx (in case of copy). */
-/* { dg-final { scan-assembler-times "addl\t%\[re\]?d\[ix\], %\[re\]?ax" 1 { xfail { { ! nonpic } && ia32 } } } } */
+/* { dg-final { scan-assembler-times "addl\t%\[re\]?d\[ix\], %\[re\]?ax" 1 } } */

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

* Re: [PATCH, X86] Revise fuse-caller-save-* to avoid XPASSes on PIC targets.
  2019-05-22 18:41 [PATCH, X86] Revise fuse-caller-save-* to avoid XPASSes on PIC targets Iain Sandoe
@ 2019-05-23  6:23 ` Uros Bizjak
  2019-05-23  9:25   ` Iain Sandoe
  0 siblings, 1 reply; 7+ messages in thread
From: Uros Bizjak @ 2019-05-23  6:23 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: GCC Patches, Tom de Vries, H.J. Lu

On Wed, May 22, 2019 at 8:41 PM Iain Sandoe <iain@sandoe.co.uk> wrote:
>
> As Dominque noted in PR 64895, somewhere between revisions
>  r244915 and r244957 we see the fuse-caller-save* tests started to
> XPASS on Darwin, which is a PIC target by default.
>
> The XFAILed parts of the tests never seem to be exercised on
> Linux, and therefore the change would be unnoticed there.
>
> I have attached an analysis to the PR of the latest codegen from Linux
> (which is identical to Darwin modulo the syntactic differences of PIC
> accesses on the m32 platforms).
>
> AFAICT, from the thread in the PR, codegen now seems to be correct.
> Even if the codegen is still not right, the test conditions need amendment
> to reflect the current status quo (and the XFAILs are no longers needed).
>
> One test requires amendment for the PIC case on Linux, the remainer
> of the changes are removals of the XFAILs.
>
> With the attached patch both Linux and Darwin show 17 / 18 passes m32 / m64.
>
> OK for trunk?

These changes are OK as long as they don't regress HJ's x86_64 and
i686 autotesters. Double points if they also fix -fpic failures. ;)

> Relevant branch(es)?

After a couple of days in mainline, if there are no autotester
regressions. Otherwise your call.

Thanks,
Uros.

>
> Iain
>
> gcc/testsuite/
>
>         PR rtl-optimisation/64895
>         * gcc.target/i386/fuse-caller-save-rec.c: Remove XFAILs.
>         * gcc.target/i386/fuse-caller-save.c: Likewise.
>         * gcc.target/i386/fuse-caller-save-xmm.c: Adjust tests for
>         PIC cases, remove XFAILs.
>
> diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
> index 7abcf91..e8d4efb 100644
> --- a/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
> +++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
> @@ -18,14 +18,12 @@ foo (int y)
>    return y + bar (y);
>  }
>
> -/* For !nonpic && ia32 xfails, see PR64895.  */
> -
>  /* Check that no registers are saved/restored. */
> -/* { dg-final { scan-assembler-not "push" { xfail { { ! nonpic } && ia32 } } } } */
> -/* { dg-final { scan-assembler-not "pop" { xfail { { ! nonpic } && ia32 } } } } */
> +/* { dg-final { scan-assembler-not "push" } } */
> +/* { dg-final { scan-assembler-not "pop" } } */
>
>  /* Check that addition uses dx. */
> -/* { dg-final { scan-assembler-times "addl\t%\[re\]?dx, %\[re\]?ax" 1 { xfail { { ! nonpic } && ia32 } } } } */
> +/* { dg-final { scan-assembler-times "addl\t%\[re\]?dx, %\[re\]?ax" 1 } } */
>
>  /* Verify that bar is self-recursive.  */
>  /* { dg-final { scan-assembler-times "call\t_?bar" 2 } } */
> diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
> index c2d0544..02a5f5b 100644
> --- a/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
> +++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
> @@ -15,13 +15,18 @@ foo (v2df y)
>    return y + bar (y);
>  }
>
> -/* For !nonpic && ia32 xfails, see PR64895.  */
> -
>  /* Check presence of all insns on xmm registers.  These checks are expected to
>     pass with both -fipa-ra and -fno-ipa-ra.  */
> -/* { dg-final { scan-assembler-times "addpd\t\\.?LC0.*, %xmm0" 1 } } */
> -/* { dg-final { scan-assembler-times "addpd\t%xmm1, %xmm0" 1 { xfail { { ! nonpic } && ia32 } } } } */
> -/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm1" 1 { xfail { { ! nonpic } && ia32 } } } } */
> +
> +/* { dg-final { scan-assembler-times {addpd\t\.?[Ll]C0.*, %xmm0} 1 { target { { ! ia32 } || nonpic } } } } */
> +/* { dg-final { scan-assembler-times {movapd\t\.?[Ll]C0.*, %xmm1} 1 { target { ia32 && { ! nonpic } } } } } */
> +
> +/* We happen to get this for both cases, but in different positions.  */
> +/* { dg-final { scan-assembler-times "addpd\t%xmm1, %xmm0" 1 } } */
> +
> +/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm1" 1 { target { { ! ia32 } || nonpic } } } } */
> +/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm2" 1 { target { ia32 && { ! nonpic } } } } } */
> +/* { dg-final { scan-assembler-times "addpd\t%xmm2, %xmm0" 1 { target { ia32 && { ! nonpic } } } } } */
>
>  /* Check absence of save/restore of xmm1 register.  */
>  /* { dg-final { scan-assembler-not "movaps\t%xmm1, \\(%\[re\]?sp\\)" } } */
> diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
> index 4b8e68d..c0e8bf4 100644
> --- a/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
> +++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
> @@ -16,11 +16,9 @@ foo (int y)
>    return y + bar (y);
>  }
>
> -/* For !nonpic && ia32 xfails, see PR64895.  */
> -
>  /* Check that no registers are saved/restored. */
> -/* { dg-final { scan-assembler-not "push" { xfail { { ! nonpic } && ia32 } } } } */
> -/* { dg-final { scan-assembler-not "pop" { xfail { { ! nonpic } && ia32 } } } } */
> +/* { dg-final { scan-assembler-not "push" } } */
> +/* { dg-final { scan-assembler-not "pop" } } */
>
>  /* PR61605.  If the first argument register and the return register differ, then
>     bar leaves the first argument register intact.  That means in foo that the
> @@ -31,4 +29,4 @@ foo (int y)
>  /* { dg-final { scan-assembler-not "movl" { target { ! ia32 } } } } */
>
>  /* Check that addition uses di (in case of no copy) or dx (in case of copy). */
> -/* { dg-final { scan-assembler-times "addl\t%\[re\]?d\[ix\], %\[re\]?ax" 1 { xfail { { ! nonpic } && ia32 } } } } */
> +/* { dg-final { scan-assembler-times "addl\t%\[re\]?d\[ix\], %\[re\]?ax" 1 } } */
>

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

* Re: [PATCH, X86] Revise fuse-caller-save-* to avoid XPASSes on PIC targets.
  2019-05-23  6:23 ` Uros Bizjak
@ 2019-05-23  9:25   ` Iain Sandoe
  2019-05-23 13:09     ` Uros Bizjak
  0 siblings, 1 reply; 7+ messages in thread
From: Iain Sandoe @ 2019-05-23  9:25 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: GCC Patches, Tom de Vries, H.J. Lu

Hi Uros.

> On 23 May 2019, at 07:23, Uros Bizjak <ubizjak@gmail.com> wrote:
> 
> On Wed, May 22, 2019 at 8:41 PM Iain Sandoe <iain@sandoe.co.uk> wrote:
>> 
>> As Dominque noted in PR 64895, somewhere between revisions
>> r244915 and r244957 we see the fuse-caller-save* tests started to
>> XPASS on Darwin, which is a PIC target by default.
>> 
>> The XFAILed parts of the tests never seem to be exercised on
>> Linux, and therefore the change would be unnoticed there.
>> 
>> I have attached an analysis to the PR of the latest codegen from Linux
>> (which is identical to Darwin modulo the syntactic differences of PIC
>> accesses on the m32 platforms).
>> 
>> AFAICT, from the thread in the PR, codegen now seems to be correct.
>> Even if the codegen is still not right, the test conditions need amendment
>> to reflect the current status quo (and the XFAILs are no longers needed).
>> 
>> One test requires amendment for the PIC case on Linux, the remainer
>> of the changes are removals of the XFAILs.
>> 
>> With the attached patch both Linux and Darwin show 17 / 18 passes m32 / m64.
>> 
>> OK for trunk?
> 
> These changes are OK as long as they don't regress HJ's x86_64 and
> i686 autotesters.

Applied as r271544, will look out for such fails.

> Double points if they also fix -fpic failures. ;)

make check-gcc-c RUNTESTFLAGS="--target_board=unix/-fpic\{-m32,-m64\} i386.exp=fuse-caller-save*”

Test run by iains on Thu May 23 07:20:03 2019
Native configuration is x86_64-pc-linux-gnu

		=== gcc tests ===

Running target unix/-fpic/-m32

		=== gcc Summary for unix/-fpic/-m32 ===

# of expected passes		18

		=== gcc Summary for unix/-fpic/-m64 ===

# of expected passes		18

( but, as noted above, these tests are not run ‘-fpic’ on Linux by default, although in this case a fail on Darwin
  would be a fair indication of problems )

thanks
Iain

>> Relevant branch(es)?
> 
> After a couple of days in mainline, if there are no autotester
> regressions. Otherwise your call.
> 
> Thanks,
> Uros.
> 
>> 
>> Iain
>> 
>> gcc/testsuite/
>> 
>>        PR rtl-optimisation/64895
>>        * gcc.target/i386/fuse-caller-save-rec.c: Remove XFAILs.
>>        * gcc.target/i386/fuse-caller-save.c: Likewise.
>>        * gcc.target/i386/fuse-caller-save-xmm.c: Adjust tests for
>>        PIC cases, remove XFAILs.
>> 
>> diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
>> index 7abcf91..e8d4efb 100644
>> --- a/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
>> +++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
>> @@ -18,14 +18,12 @@ foo (int y)
>>   return y + bar (y);
>> }
>> 
>> -/* For !nonpic && ia32 xfails, see PR64895.  */
>> -
>> /* Check that no registers are saved/restored. */
>> -/* { dg-final { scan-assembler-not "push" { xfail { { ! nonpic } && ia32 } } } } */
>> -/* { dg-final { scan-assembler-not "pop" { xfail { { ! nonpic } && ia32 } } } } */
>> +/* { dg-final { scan-assembler-not "push" } } */
>> +/* { dg-final { scan-assembler-not "pop" } } */
>> 
>> /* Check that addition uses dx. */
>> -/* { dg-final { scan-assembler-times "addl\t%\[re\]?dx, %\[re\]?ax" 1 { xfail { { ! nonpic } && ia32 } } } } */
>> +/* { dg-final { scan-assembler-times "addl\t%\[re\]?dx, %\[re\]?ax" 1 } } */
>> 
>> /* Verify that bar is self-recursive.  */
>> /* { dg-final { scan-assembler-times "call\t_?bar" 2 } } */
>> diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
>> index c2d0544..02a5f5b 100644
>> --- a/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
>> +++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
>> @@ -15,13 +15,18 @@ foo (v2df y)
>>   return y + bar (y);
>> }
>> 
>> -/* For !nonpic && ia32 xfails, see PR64895.  */
>> -
>> /* Check presence of all insns on xmm registers.  These checks are expected to
>>    pass with both -fipa-ra and -fno-ipa-ra.  */
>> -/* { dg-final { scan-assembler-times "addpd\t\\.?LC0.*, %xmm0" 1 } } */
>> -/* { dg-final { scan-assembler-times "addpd\t%xmm1, %xmm0" 1 { xfail { { ! nonpic } && ia32 } } } } */
>> -/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm1" 1 { xfail { { ! nonpic } && ia32 } } } } */
>> +
>> +/* { dg-final { scan-assembler-times {addpd\t\.?[Ll]C0.*, %xmm0} 1 { target { { ! ia32 } || nonpic } } } } */
>> +/* { dg-final { scan-assembler-times {movapd\t\.?[Ll]C0.*, %xmm1} 1 { target { ia32 && { ! nonpic } } } } } */
>> +
>> +/* We happen to get this for both cases, but in different positions.  */
>> +/* { dg-final { scan-assembler-times "addpd\t%xmm1, %xmm0" 1 } } */
>> +
>> +/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm1" 1 { target { { ! ia32 } || nonpic } } } } */
>> +/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm2" 1 { target { ia32 && { ! nonpic } } } } } */
>> +/* { dg-final { scan-assembler-times "addpd\t%xmm2, %xmm0" 1 { target { ia32 && { ! nonpic } } } } } */
>> 
>> /* Check absence of save/restore of xmm1 register.  */
>> /* { dg-final { scan-assembler-not "movaps\t%xmm1, \\(%\[re\]?sp\\)" } } */
>> diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
>> index 4b8e68d..c0e8bf4 100644
>> --- a/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
>> +++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
>> @@ -16,11 +16,9 @@ foo (int y)
>>   return y + bar (y);
>> }
>> 
>> -/* For !nonpic && ia32 xfails, see PR64895.  */
>> -
>> /* Check that no registers are saved/restored. */
>> -/* { dg-final { scan-assembler-not "push" { xfail { { ! nonpic } && ia32 } } } } */
>> -/* { dg-final { scan-assembler-not "pop" { xfail { { ! nonpic } && ia32 } } } } */
>> +/* { dg-final { scan-assembler-not "push" } } */
>> +/* { dg-final { scan-assembler-not "pop" } } */
>> 
>> /* PR61605.  If the first argument register and the return register differ, then
>>    bar leaves the first argument register intact.  That means in foo that the
>> @@ -31,4 +29,4 @@ foo (int y)
>> /* { dg-final { scan-assembler-not "movl" { target { ! ia32 } } } } */
>> 
>> /* Check that addition uses di (in case of no copy) or dx (in case of copy). */
>> -/* { dg-final { scan-assembler-times "addl\t%\[re\]?d\[ix\], %\[re\]?ax" 1 { xfail { { ! nonpic } && ia32 } } } } */
>> +/* { dg-final { scan-assembler-times "addl\t%\[re\]?d\[ix\], %\[re\]?ax" 1 } } */

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

* Re: [PATCH, X86] Revise fuse-caller-save-* to avoid XPASSes on PIC targets.
  2019-05-23  9:25   ` Iain Sandoe
@ 2019-05-23 13:09     ` Uros Bizjak
  2019-05-23 15:18       ` H.J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: Uros Bizjak @ 2019-05-23 13:09 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: GCC Patches, Tom de Vries, H.J. Lu

On Thu, May 23, 2019 at 11:25 AM Iain Sandoe <iain@sandoe.co.uk> wrote:

> > These changes are OK as long as they don't regress HJ's x86_64 and
> > i686 autotesters.
>
> Applied as r271544, will look out for such fails.
>
> > Double points if they also fix -fpic failures. ;)
>
> make check-gcc-c RUNTESTFLAGS="--target_board=unix/-fpic\{-m32,-m64\} i386.exp=fuse-caller-save*”
>
> Test run by iains on Thu May 23 07:20:03 2019
> Native configuration is x86_64-pc-linux-gnu
>
>                 === gcc tests ===
>
> Running target unix/-fpic/-m32
>
>                 === gcc Summary for unix/-fpic/-m32 ===
>
> # of expected passes            18
>
>                 === gcc Summary for unix/-fpic/-m64 ===
>
> # of expected passes            18
>
> ( but, as noted above, these tests are not run ‘-fpic’ on Linux by default, although in this case a fail on Darwin
>   would be a fair indication of problems )

There are periodic results for i686/-fpic [1], x32/-fpic [2] and
x86_64/-fpic/{,-mcmodel=medium} [3] targets avaliable in
gcc-testresults@ ML. I think we have quite good coverage of -fpic for
x86 targets.

BTW: HJ, for some reason -fpic/-mcmodel=large does not work in [3].

[1] https://gcc.gnu.org/ml/gcc-testresults/2019-05/msg02599.html
[2] https://gcc.gnu.org/ml/gcc-testresults/2019-05/msg02577.html
[3] https://gcc.gnu.org/ml/gcc-testresults/2019-05/msg02571.html

Uros.

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

* Re: [PATCH, X86] Revise fuse-caller-save-* to avoid XPASSes on PIC targets.
  2019-05-23 13:09     ` Uros Bizjak
@ 2019-05-23 15:18       ` H.J. Lu
  2019-05-23 15:25         ` Iain Sandoe
  0 siblings, 1 reply; 7+ messages in thread
From: H.J. Lu @ 2019-05-23 15:18 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: Iain Sandoe, GCC Patches, Tom de Vries

On Thu, May 23, 2019 at 6:09 AM Uros Bizjak <ubizjak@gmail.com> wrote:
>
> On Thu, May 23, 2019 at 11:25 AM Iain Sandoe <iain@sandoe.co.uk> wrote:
>
> > > These changes are OK as long as they don't regress HJ's x86_64 and
> > > i686 autotesters.
> >
> > Applied as r271544, will look out for such fails.
> >
> > > Double points if they also fix -fpic failures. ;)
> >
> > make check-gcc-c RUNTESTFLAGS="--target_board=unix/-fpic\{-m32,-m64\} i386.exp=fuse-caller-save*”
> >
> > Test run by iains on Thu May 23 07:20:03 2019
> > Native configuration is x86_64-pc-linux-gnu
> >
> >                 === gcc tests ===
> >
> > Running target unix/-fpic/-m32
> >
> >                 === gcc Summary for unix/-fpic/-m32 ===
> >
> > # of expected passes            18
> >
> >                 === gcc Summary for unix/-fpic/-m64 ===
> >
> > # of expected passes            18
> >
> > ( but, as noted above, these tests are not run ‘-fpic’ on Linux by default, although in this case a fail on Darwin
> >   would be a fair indication of problems )
>
> There are periodic results for i686/-fpic [1], x32/-fpic [2] and
> x86_64/-fpic/{,-mcmodel=medium} [3] targets avaliable in
> gcc-testresults@ ML. I think we have quite good coverage of -fpic for
> x86 targets.
>
> BTW: HJ, for some reason -fpic/-mcmodel=large does not work in [3].
>
> [1] https://gcc.gnu.org/ml/gcc-testresults/2019-05/msg02599.html
> [2] https://gcc.gnu.org/ml/gcc-testresults/2019-05/msg02577.html
> [3] https://gcc.gnu.org/ml/gcc-testresults/2019-05/msg02571.html

Since large PIC model has very different sequence to call function bar:

movabsq $bar@GOTOFF, %rax
addq %rdx, %rax
call *%rax

these tests will fail.

-- 
H.J.

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

* Re: [PATCH, X86] Revise fuse-caller-save-* to avoid XPASSes on PIC targets.
  2019-05-23 15:18       ` H.J. Lu
@ 2019-05-23 15:25         ` Iain Sandoe
  2019-05-23 15:30           ` H.J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: Iain Sandoe @ 2019-05-23 15:25 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Uros Bizjak, GCC Patches, Tom de Vries


> On 23 May 2019, at 16:17, H.J. Lu <hjl.tools@gmail.com> wrote:
> 
> On Thu, May 23, 2019 at 6:09 AM Uros Bizjak <ubizjak@gmail.com> wrote:
>> 
>> On Thu, May 23, 2019 at 11:25 AM Iain Sandoe <iain@sandoe.co.uk> wrote:
>> 
>>>> These changes are OK as long as they don't regress HJ's x86_64 and
>>>> i686 autotesters.
>>> 
>>> Applied as r271544, will look out for such fails.
>>> 
>>>> Double points if they also fix -fpic failures. ;)
>>> 
>>> make check-gcc-c RUNTESTFLAGS="--target_board=unix/-fpic\{-m32,-m64\} i386.exp=fuse-caller-save*”
>>> 
>>> Test run by iains on Thu May 23 07:20:03 2019
>>> Native configuration is x86_64-pc-linux-gnu
>>> 
>>>                === gcc tests ===
>>> 
>>> Running target unix/-fpic/-m32
>>> 
>>>                === gcc Summary for unix/-fpic/-m32 ===
>>> 
>>> # of expected passes            18
>>> 
>>>                === gcc Summary for unix/-fpic/-m64 ===
>>> 
>>> # of expected passes            18
>>> 
>>> ( but, as noted above, these tests are not run ‘-fpic’ on Linux by default, although in this case a fail on Darwin
>>>  would be a fair indication of problems )
>> 
>> There are periodic results for i686/-fpic [1], x32/-fpic [2] and
>> x86_64/-fpic/{,-mcmodel=medium} [3] targets avaliable in
>> gcc-testresults@ ML. I think we have quite good coverage of -fpic for
>> x86 targets.
>> 
>> BTW: HJ, for some reason -fpic/-mcmodel=large does not work in [3].
>> 
>> [1] https://gcc.gnu.org/ml/gcc-testresults/2019-05/msg02599.html
>> [2] https://gcc.gnu.org/ml/gcc-testresults/2019-05/msg02577.html
>> [3] https://gcc.gnu.org/ml/gcc-testresults/2019-05/msg02571.html
> 
> Since large PIC model has very different sequence to call function bar:
> 
> movabsq $bar@GOTOFF, %rax
> addq %rdx, %rax
> call *%rax

So .. will they regress, or are they already failing there?
Do you have a suggestion for what could be done to cover this case too?
Iain

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

* Re: [PATCH, X86] Revise fuse-caller-save-* to avoid XPASSes on PIC targets.
  2019-05-23 15:25         ` Iain Sandoe
@ 2019-05-23 15:30           ` H.J. Lu
  0 siblings, 0 replies; 7+ messages in thread
From: H.J. Lu @ 2019-05-23 15:30 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: Uros Bizjak, GCC Patches, Tom de Vries

On Thu, May 23, 2019 at 8:25 AM Iain Sandoe <iain@sandoe.co.uk> wrote:
>
>
> > On 23 May 2019, at 16:17, H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Thu, May 23, 2019 at 6:09 AM Uros Bizjak <ubizjak@gmail.com> wrote:
> >>
> >> On Thu, May 23, 2019 at 11:25 AM Iain Sandoe <iain@sandoe.co.uk> wrote:
> >>
> >>>> These changes are OK as long as they don't regress HJ's x86_64 and
> >>>> i686 autotesters.
> >>>
> >>> Applied as r271544, will look out for such fails.
> >>>
> >>>> Double points if they also fix -fpic failures. ;)
> >>>
> >>> make check-gcc-c RUNTESTFLAGS="--target_board=unix/-fpic\{-m32,-m64\} i386.exp=fuse-caller-save*”
> >>>
> >>> Test run by iains on Thu May 23 07:20:03 2019
> >>> Native configuration is x86_64-pc-linux-gnu
> >>>
> >>>                === gcc tests ===
> >>>
> >>> Running target unix/-fpic/-m32
> >>>
> >>>                === gcc Summary for unix/-fpic/-m32 ===
> >>>
> >>> # of expected passes            18
> >>>
> >>>                === gcc Summary for unix/-fpic/-m64 ===
> >>>
> >>> # of expected passes            18
> >>>
> >>> ( but, as noted above, these tests are not run ‘-fpic’ on Linux by default, although in this case a fail on Darwin
> >>>  would be a fair indication of problems )
> >>
> >> There are periodic results for i686/-fpic [1], x32/-fpic [2] and
> >> x86_64/-fpic/{,-mcmodel=medium} [3] targets avaliable in
> >> gcc-testresults@ ML. I think we have quite good coverage of -fpic for
> >> x86 targets.
> >>
> >> BTW: HJ, for some reason -fpic/-mcmodel=large does not work in [3].
> >>
> >> [1] https://gcc.gnu.org/ml/gcc-testresults/2019-05/msg02599.html
> >> [2] https://gcc.gnu.org/ml/gcc-testresults/2019-05/msg02577.html
> >> [3] https://gcc.gnu.org/ml/gcc-testresults/2019-05/msg02571.html
> >
> > Since large PIC model has very different sequence to call function bar:
> >
> > movabsq $bar@GOTOFF, %rax
> > addq %rdx, %rax
> > call *%rax
>
> So .. will they regress, or are they already failing there?
> Do you have a suggestion for what could be done to cover this case too?

We should skip these tests for -mcmodel=large.

-- 
H.J.

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

end of thread, other threads:[~2019-05-23 15:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22 18:41 [PATCH, X86] Revise fuse-caller-save-* to avoid XPASSes on PIC targets Iain Sandoe
2019-05-23  6:23 ` Uros Bizjak
2019-05-23  9:25   ` Iain Sandoe
2019-05-23 13:09     ` Uros Bizjak
2019-05-23 15:18       ` H.J. Lu
2019-05-23 15:25         ` Iain Sandoe
2019-05-23 15:30           ` H.J. Lu

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).