Patchwork [testsuite] Fix gcc.target/i386/hle-* testcases with Sun as

login
register
mail settings
Submitter Rainer Orth
Date May 8, 2012, 5:19 p.m.
Message ID <ydd1umubnfq.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/157751/
State New
Headers show

Comments

Rainer Orth - May 8, 2012, 5:19 p.m.
Several /gcc.target/i386/hle-*.c tests are currently failing on Solaris
9/x86 with Sun as:

FAIL: gcc.target/i386/hle-add-acq-1.c scan-assembler lock[ \\n\\t]+(xacquire|.byte[ \\t]+0xf2)[ \\t\\n]+add

The .s file has

        lock;
        .byte   0xf2

but the scan-assembler regex currently doesn't allow for the ; (which is
not present with gas 2.22).

The patch below does just that.  Tested with the appropriate runtest
invocation on i386-pc-solaris2.9 configured with as and gas
respectively.

Ok for mainline?

	Rainer


2012-05-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.target/i386/hle-add-acq-1.c: Allow for ; after lock.
	* gcc.target/i386/hle-add-rel-1.c: Likewise.
	* gcc.target/i386/hle-and-acq-1.c: Likewise.
	* gcc.target/i386/hle-and-rel-1.c: Likewise.
	* gcc.target/i386/hle-cmpxchg-acq-1.c: Likewise.
	* gcc.target/i386/hle-cmpxchg-rel-1.c: Likewise.
	* gcc.target/i386/hle-or-acq-1.c: Likewise.
	* gcc.target/i386/hle-or-rel-1.c: Likewise.
	* gcc.target/i386/hle-sub-acq-1.c: Likewise.
	* gcc.target/i386/hle-sub-rel-1.c: Likewise.
	* gcc.target/i386/hle-xadd-acq-1.c: Likewise.
	* gcc.target/i386/hle-xadd-rel-1.c: Likewise.
	* gcc.target/i386/hle-xor-acq-1.c: Likewise.
	* gcc.target/i386/hle-xor-rel-1.c: Likewise.
Mike Stump - May 8, 2012, 7:04 p.m.
On May 8, 2012, at 10:19 AM, Rainer Orth wrote:
> Several /gcc.target/i386/hle-*.c tests are currently failing on Solaris
> 9/x86 with Sun as:
> 
> FAIL: gcc.target/i386/hle-add-acq-1.c scan-assembler lock[ \\n\\t]+(xacquire|.byte[ \\t]+0xf2)[ \\t\\n]+add
> 
> The .s file has
> 
>        lock;
>        .byte   0xf2
> 
> but the scan-assembler regex currently doesn't allow for the ; (which is
> not present with gas 2.22).
> 
> The patch below does just that.  Tested with the appropriate runtest
> invocation on i386-pc-solaris2.9 configured with as and gas
> respectively.
> 
> Ok for mainline?

Ok, assuming that the ; has to be there.  If it doesn't have to be there, an alternative patch might be to remove it from the port now instead of the patch.
Rainer Orth - May 9, 2012, 10:53 a.m.
Hi Mike,

> On May 8, 2012, at 10:19 AM, Rainer Orth wrote:
>> Several /gcc.target/i386/hle-*.c tests are currently failing on Solaris
>> 9/x86 with Sun as:
>> 
>> FAIL: gcc.target/i386/hle-add-acq-1.c scan-assembler lock[ \\n\\t]+(xacquire|.byte[ \\t]+0xf2)[ \\t\\n]+add
>> 
>> The .s file has
>> 
>>        lock;
>>        .byte   0xf2
>> 
>> but the scan-assembler regex currently doesn't allow for the ; (which is
>> not present with gas 2.22).
>> 
>> The patch below does just that.  Tested with the appropriate runtest
>> invocation on i386-pc-solaris2.9 configured with as and gas
>> respectively.
>> 
>> Ok for mainline?
>
> Ok, assuming that the ; has to be there.  If it doesn't have to be

I just rechecked: this is covered by the gcc_cv_as_ix86_rep_lock_prefix
test in gcc/configure.as which fails with the Solaris (8 and) 9 native
assembler.

> there, an alternative patch might be to remove it from the port now
> instead of the patch.

Right, that's why I was asking for review rather than just installing on
my own.

	Rainer
Uros Bizjak - May 9, 2012, 11:39 a.m.
On Wed, May 9, 2012 at 12:53 PM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:

>>> Several /gcc.target/i386/hle-*.c tests are currently failing on Solaris
>>> 9/x86 with Sun as:
>>>
>>> FAIL: gcc.target/i386/hle-add-acq-1.c scan-assembler lock[ \\n\\t]+(xacquire|.byte[ \\t]+0xf2)[ \\t\\n]+add
>>>
>>> The .s file has
>>>
>>>        lock;
>>>        .byte   0xf2
>>>
>>> but the scan-assembler regex currently doesn't allow for the ; (which is
>>> not present with gas 2.22).
>>>
>>> The patch below does just that.  Tested with the appropriate runtest
>>> invocation on i386-pc-solaris2.9 configured with as and gas
>>> respectively.
>>>
>>> Ok for mainline?
>>
>> Ok, assuming that the ; has to be there.  If it doesn't have to be
>
> I just rechecked: this is covered by the gcc_cv_as_ix86_rep_lock_prefix
> test in gcc/configure.as which fails with the Solaris (8 and) 9 native
> assembler.
>
>> there, an alternative patch might be to remove it from the port now
>> instead of the patch.
>
> Right, that's why I was asking for review rather than just installing on
> my own.

I'd rather see that we remove semicolon in this case, but please note
that xchg with memory operand doesn't need lock prefix. If it is not
too much trouble...

Uros.
Rainer Orth - May 11, 2012, 11:11 a.m.
Hi Uros,

>>> there, an alternative patch might be to remove it from the port now
>>> instead of the patch.
>>
>> Right, that's why I was asking for review rather than just installing on
>> my own.
>
> I'd rather see that we remove semicolon in this case, but please note
> that xchg with memory operand doesn't need lock prefix. If it is not
> too much trouble...

I saw your message only after I had committed the patch.  I'll try to
have a look this weekend, but it's quite unclear if I have any time.

	Rainer

Patch

# HG changeset patch
# Parent 0b93bf7b6bda6f699d288070fb3e186fcde95cf8
Fix gcc.target/i386/hle-* testcases with Sun as

diff --git a/gcc/testsuite/gcc.target/i386/hle-add-acq-1.c b/gcc/testsuite/gcc.target/i386/hle-add-acq-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-add-acq-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-add-acq-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+add" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+add" } } */
 
 void
 hle_add (int *p, int v)
diff --git a/gcc/testsuite/gcc.target/i386/hle-add-rel-1.c b/gcc/testsuite/gcc.target/i386/hle-add-rel-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-add-rel-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-add-rel-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+add" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+add" } } */
 
 void
 hle_add (int *p, int v)
diff --git a/gcc/testsuite/gcc.target/i386/hle-and-acq-1.c b/gcc/testsuite/gcc.target/i386/hle-and-acq-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-and-acq-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-and-acq-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+and" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+and" } } */
 
 void
 hle_and (int *p, int v)
diff --git a/gcc/testsuite/gcc.target/i386/hle-and-rel-1.c b/gcc/testsuite/gcc.target/i386/hle-and-rel-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-and-rel-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-and-rel-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+and" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+and" } } */
 
 void
 hle_and (int *p, int v)
diff --git a/gcc/testsuite/gcc.target/i386/hle-cmpxchg-acq-1.c b/gcc/testsuite/gcc.target/i386/hle-cmpxchg-acq-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-cmpxchg-acq-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-cmpxchg-acq-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-march=x86-64 -mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+cmpxchg" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+cmpxchg" } } */
 
 int
 hle_cmpxchg (int *p, int oldv, int newv)
diff --git a/gcc/testsuite/gcc.target/i386/hle-cmpxchg-rel-1.c b/gcc/testsuite/gcc.target/i386/hle-cmpxchg-rel-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-cmpxchg-rel-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-cmpxchg-rel-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-march=x86-64 -mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+cmpxchg" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+cmpxchg" } } */
 
 int
 hle_cmpxchg (int *p, int oldv, int newv)
diff --git a/gcc/testsuite/gcc.target/i386/hle-or-acq-1.c b/gcc/testsuite/gcc.target/i386/hle-or-acq-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-or-acq-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-or-acq-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+or" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+or" } } */
 
 void
 hle_or (int *p, int v)
diff --git a/gcc/testsuite/gcc.target/i386/hle-or-rel-1.c b/gcc/testsuite/gcc.target/i386/hle-or-rel-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-or-rel-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-or-rel-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+or" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+or" } } */
 
 void
 hle_xor (int *p, int v)
diff --git a/gcc/testsuite/gcc.target/i386/hle-sub-acq-1.c b/gcc/testsuite/gcc.target/i386/hle-sub-acq-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-sub-acq-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-sub-acq-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+sub" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+sub" } } */
 
 void
 hle_sub (int *p, int v)
diff --git a/gcc/testsuite/gcc.target/i386/hle-sub-rel-1.c b/gcc/testsuite/gcc.target/i386/hle-sub-rel-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-sub-rel-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-sub-rel-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+sub" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+sub" } } */
 
 void
 hle_sub (int *p, int v)
diff --git a/gcc/testsuite/gcc.target/i386/hle-xadd-acq-1.c b/gcc/testsuite/gcc.target/i386/hle-xadd-acq-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-xadd-acq-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-xadd-acq-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-march=x86-64 -mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+xadd" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+xadd" } } */
 
 int
 hle_xadd (int *p, int v)
diff --git a/gcc/testsuite/gcc.target/i386/hle-xadd-rel-1.c b/gcc/testsuite/gcc.target/i386/hle-xadd-rel-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-xadd-rel-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-xadd-rel-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-march=x86-64 -mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+xadd" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+xadd" } } */
 
 int
 hle_xadd (int *p, int v)
diff --git a/gcc/testsuite/gcc.target/i386/hle-xor-acq-1.c b/gcc/testsuite/gcc.target/i386/hle-xor-acq-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-xor-acq-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-xor-acq-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+xor" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+xor" } } */
 
 void
 hle_xor (int *p, int v)
diff --git a/gcc/testsuite/gcc.target/i386/hle-xor-rel-1.c b/gcc/testsuite/gcc.target/i386/hle-xor-rel-1.c
--- a/gcc/testsuite/gcc.target/i386/hle-xor-rel-1.c
+++ b/gcc/testsuite/gcc.target/i386/hle-xor-rel-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-mhle" } */
-/* { dg-final { scan-assembler "lock\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+xor" } } */
+/* { dg-final { scan-assembler "lock;?\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+xor" } } */
 
 void
 hle_xor (int *p, int v)