diff mbox

[i386,testsuite] : Require nonpic target for some tests

Message ID 5506AD00.1090407@mentor.com
State New
Headers show

Commit Message

Tom de Vries March 16, 2015, 10:14 a.m. UTC
On 12-03-15 11:51, Uros Bizjak wrote:
> On Thu, Mar 12, 2015 at 11:41 AM, Tom de Vries <Tom_deVries@mentor.com> wrote:
>
>>>>> Attached patch adds nonpic target requirement for some (obvious)
>>>>> cases, where data access or PIC register setup confuses scan-asms.
>>>>>
>>>>> 2015-01-30  Uros Bizjak  <ubizjak@gmail.com>
>>>>>
>>>>>        * gcc.target/i386/fuse-caller-save-rec.c: Require nonpic target.
>>>>>        * gcc.target/i386/fuse-caller-save-xmm.c: Ditto.
>>>>>        * gcc.target/i386/fuse-caller-save.c: Ditto.
>>>>
>>>>
>>>>
>>>> Hi,
>>>>
>>>> I've reverted this part of the patch. The scans were failing because the
>>>> -fipa-ra optimization was broken for -m32 -fpic (PR64895).
>>>
>>>
>>> Not really.
>>>
>>> Allocator is free to allocate %ebx (or other call-saved
>>> register) as PIC register.
>>>
>>> In this case, unwanted push/pop sequence
>>> will be emitted.
>>>
>>
>> Sure, but I don't see what that has to do with the test-cases. I don't see a
>> pic register used in fuse-caller-save.c and fuse-caller-save-rec.c. I do see
>> a pic register used in gcc.target/i386/fuse-caller-save-xmm.c, but there's
>> no scan for push/pop sequence in there.
>
> You are right, the call is (obviously) to a local function. There is
> no need for PIC reg, so this clears my concerns.
>

The patch for PR64895 has been reverted, so the scans started failing again. 
I've added xfails.

Thanks,
- Tom
diff mbox

Patch

2015-03-16  Tom de Vries  <tom@codesourcery.com>

	* gcc.target/i386/fuse-caller-save-rec.c: Add PR64895 xfail on scans.
	* gcc.target/i386/fuse-caller-save-xmm.c: Same.
	* gcc.target/i386/fuse-caller-save.c: Same.

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 c660e01..7abcf91 100644
--- a/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
+++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
@@ -18,12 +18,14 @@  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"  } } */
-/* { dg-final { scan-assembler-not "pop"  } } */
+/* { dg-final { scan-assembler-not "push" { xfail { { ! nonpic } && ia32 } } } } */
+/* { dg-final { scan-assembler-not "pop" { xfail { { ! nonpic } && ia32 } } } } */
 
 /* Check that addition uses dx. */
-/* { dg-final { scan-assembler-times "addl\t%\[re\]?dx, %\[re\]?ax" 1 } } */
+/* { dg-final { scan-assembler-times "addl\t%\[re\]?dx, %\[re\]?ax" 1 { xfail { { ! nonpic } && ia32 } } } } */
 
 /* 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 1d02844..c2d0544 100644
--- a/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
+++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
@@ -15,11 +15,13 @@  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 } } */
-/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm1" 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 } } } } */
 
 /* 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 7cfd22a..4b8e68d 100644
--- a/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
+++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
@@ -16,9 +16,11 @@  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"  } } */
-/* { dg-final { scan-assembler-not "pop"  } } */
+/* { dg-final { scan-assembler-not "push" { xfail { { ! nonpic } && ia32 } } } } */
+/* { dg-final { scan-assembler-not "pop" { xfail { { ! nonpic } && ia32 } } } } */
 
 /* 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
@@ -29,4 +31,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 } } */
+/* { dg-final { scan-assembler-times "addl\t%\[re\]?d\[ix\], %\[re\]?ax" 1 { xfail { { ! nonpic } && ia32 } } } } */
-- 
1.9.1