* [PATCH, i386 testsuite]: Require nonpic target for some tests
@ 2015-01-30 20:38 Uros Bizjak
2015-03-12 12:15 ` Tom de Vries
0 siblings, 1 reply; 6+ messages in thread
From: Uros Bizjak @ 2015-01-30 20:38 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 568 bytes --]
Hello!
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.
* gcc.target/i386/headmerge-1.c: Ditto.
* gcc.target/i386/headmerge-2.c: Ditto.
* gcc.target/i386/sibcall-6.c: Ditto.
Tested on x86_64-linux-gnu {-m32} /-fpic and committed to mainline SVN.
Uros.
[-- Attachment #2: t.diff.txt --]
[-- Type: text/plain, Size: 2500 bytes --]
Index: gcc.target/i386/fuse-caller-save-rec.c
===================================================================
--- gcc.target/i386/fuse-caller-save-rec.c (revision 220294)
+++ gcc.target/i386/fuse-caller-save-rec.c (working copy)
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-require-effective-target nonpic } */
/* { dg-options "-O2 -fipa-ra -fomit-frame-pointer -fno-optimize-sibling-calls" } */
/* { dg-additional-options "-mregparm=1" { target ia32 } } */
Index: gcc.target/i386/fuse-caller-save-xmm.c
===================================================================
--- gcc.target/i386/fuse-caller-save-xmm.c (revision 220294)
+++ gcc.target/i386/fuse-caller-save-xmm.c (working copy)
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-require-effective-target nonpic } */
/* { dg-options "-O2 -msse2 -mno-avx -fipa-ra -fomit-frame-pointer" } */
typedef double v2df __attribute__((vector_size (16)));
Index: gcc.target/i386/fuse-caller-save.c
===================================================================
--- gcc.target/i386/fuse-caller-save.c (revision 220294)
+++ gcc.target/i386/fuse-caller-save.c (working copy)
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-require-effective-target nonpic } */
/* { dg-options "-O2 -fipa-ra -fomit-frame-pointer" } */
/* { dg-additional-options "-mregparm=1" { target ia32 } } */
Index: gcc.target/i386/headmerge-1.c
===================================================================
--- gcc.target/i386/headmerge-1.c (revision 220294)
+++ gcc.target/i386/headmerge-1.c (working copy)
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-require-effective-target nonpic } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler-times "\\\$120|, 120" 1 } } */
Index: gcc.target/i386/headmerge-2.c
===================================================================
--- gcc.target/i386/headmerge-2.c (revision 220294)
+++ gcc.target/i386/headmerge-2.c (working copy)
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-require-effective-target nonpic } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler-times "\\\$120|, 120" 1 } } */
Index: gcc.target/i386/sibcall-6.c
===================================================================
--- gcc.target/i386/sibcall-6.c (revision 220294)
+++ gcc.target/i386/sibcall-6.c (working copy)
@@ -1,4 +1,5 @@
/* { dg-do compile { target ia32 } } */
+/* { dg-require-effective-target nonpic } */
/* { dg-options "-O2" } */
typedef void *ira_loop_tree_node_t;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH, i386 testsuite]: Require nonpic target for some tests
2015-03-12 12:11 ` Uros Bizjak
@ 2015-03-12 12:07 ` Tom de Vries
2015-03-12 12:13 ` Uros Bizjak
0 siblings, 1 reply; 6+ messages in thread
From: Tom de Vries @ 2015-03-12 12:07 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches
On 12-03-15 10:57, Uros Bizjak wrote:
> On Thu, Mar 12, 2015 at 9:11 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.
Thanks,
- Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH, i386 testsuite]: Require nonpic target for some tests
2015-03-12 12:15 ` Tom de Vries
@ 2015-03-12 12:11 ` Uros Bizjak
2015-03-12 12:07 ` Tom de Vries
0 siblings, 1 reply; 6+ messages in thread
From: Uros Bizjak @ 2015-03-12 12:11 UTC (permalink / raw)
To: Tom de Vries; +Cc: gcc-patches
On Thu, Mar 12, 2015 at 9:11 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.
Uros.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH, i386 testsuite]: Require nonpic target for some tests
2015-03-12 12:07 ` Tom de Vries
@ 2015-03-12 12:13 ` Uros Bizjak
2015-03-16 10:14 ` Tom de Vries
0 siblings, 1 reply; 6+ messages in thread
From: Uros Bizjak @ 2015-03-12 12:13 UTC (permalink / raw)
To: Tom de Vries; +Cc: gcc-patches
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.
Thanks,
Uros.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH, i386 testsuite]: Require nonpic target for some tests
2015-01-30 20:38 [PATCH, i386 testsuite]: Require nonpic target for some tests Uros Bizjak
@ 2015-03-12 12:15 ` Tom de Vries
2015-03-12 12:11 ` Uros Bizjak
0 siblings, 1 reply; 6+ messages in thread
From: Tom de Vries @ 2015-03-12 12:15 UTC (permalink / raw)
To: Uros Bizjak, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 571 bytes --]
On 30-01-15 20:49, Uros Bizjak wrote:
> Hello!
>
> 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).
Thanks,
- Tom
[-- Attachment #2: 0001-Revert-require-nonpic-target-for-fuse-caller-save-.c.patch --]
[-- Type: text/x-patch, Size: 1716 bytes --]
2015-03-12 Tom de Vries <tom@codesourcery.com>
PR rtl-optimization/64895
* gcc.target/i386/fuse-caller-save-rec.c: Revert require nonpic target.
* gcc.target/i386/fuse-caller-save-xmm.c: Ditto.
* gcc.target/i386/fuse-caller-save.c: Ditto.
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 ed0984c..c660e01 100644
--- a/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
+++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
@@ -1,5 +1,4 @@
/* { dg-do compile } */
-/* { dg-require-effective-target nonpic } */
/* { dg-options "-O2 -fipa-ra -fomit-frame-pointer -fno-optimize-sibling-calls" } */
/* { dg-additional-options "-mregparm=1" { target ia32 } } */
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 261ba07..1d02844 100644
--- a/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
+++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
@@ -1,5 +1,4 @@
/* { dg-do compile } */
-/* { dg-require-effective-target nonpic } */
/* { dg-options "-O2 -msse2 -mno-avx -fipa-ra -fomit-frame-pointer" } */
typedef double v2df __attribute__((vector_size (16)));
diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
index b9494ac..7cfd22a 100644
--- a/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
+++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
@@ -1,5 +1,4 @@
/* { dg-do compile } */
-/* { dg-require-effective-target nonpic } */
/* { dg-options "-O2 -fipa-ra -fomit-frame-pointer" } */
/* { dg-additional-options "-mregparm=1" { target ia32 } } */
--
1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH, i386 testsuite]: Require nonpic target for some tests
2015-03-12 12:13 ` Uros Bizjak
@ 2015-03-16 10:14 ` Tom de Vries
0 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2015-03-16 10:14 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]
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
[-- Attachment #2: 0001-Add-PR64895-xfails-in-i386-fuse-caller-save-.c.patch --]
[-- Type: text/x-patch, Size: 3562 bytes --]
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-03-16 10:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-30 20:38 [PATCH, i386 testsuite]: Require nonpic target for some tests Uros Bizjak
2015-03-12 12:15 ` Tom de Vries
2015-03-12 12:11 ` Uros Bizjak
2015-03-12 12:07 ` Tom de Vries
2015-03-12 12:13 ` Uros Bizjak
2015-03-16 10:14 ` Tom de Vries
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).