Patchwork Fix some hle* tests

login
register
mail settings
Submitter Uros Bizjak
Date May 3, 2012, 11:57 a.m.
Message ID <CAFULd4ZQr6ARgtCrQLkZssimhJUNaG-a_m8_FSmsKieQRZwhQw@mail.gmail.com>
Download mbox | patch
Permalink /patch/156672/
State New
Headers show

Comments

Uros Bizjak - May 3, 2012, 11:57 a.m.
On Thu, May 3, 2012 at 12:17 PM, Uros Bizjak <ubizjak@gmail.com> wrote:

>> BTW, I wonder if dg-options shouldn't select -march=i686 for !lp64,
>> if somebody configures gcc to default to -march=i386, I guess xadd etc.
>> won't be emitted there.
>
> You can add -march=x86-64 unconditionally to these test. This arch is
> the placeholder for "some recent x86 processor" and works for -m32 and
> -m64.

Fixed with attached patch.

2012-05-03  Uros Bizjak  <ubizjak@gmail.com>

	* gcc.target/i386/hle-cmpxchg-acq-1.c (dg-options): Add -march=x86-64.
	* gcc.target/i386/hle-xadd-acq-1.c (dg-options): Ditto.
	* gcc.target/i386/hle-cmpxchg-rel-1.c (dg-options): Ditto.
	* gcc.target/i386/hle-xadd-rel-1.c (dg-options): Ditto.

Tested on x86_64-pc-linux-gnu {,-m32}, committed.
Uros.

Patch

Index: gcc.target/i386/hle-cmpxchg-rel-1.c
===================================================================
--- gcc.target/i386/hle-cmpxchg-rel-1.c	(revision 187093)
+++ gcc.target/i386/hle-cmpxchg-rel-1.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-mhle" } */
+/* { dg-options "-march=x86-64 -mhle" } */
 /* { dg-final { scan-assembler "lock\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+cmpxchg" } } */
 
 int
Index: gcc.target/i386/hle-xadd-rel-1.c
===================================================================
--- gcc.target/i386/hle-xadd-rel-1.c	(revision 187093)
+++ gcc.target/i386/hle-xadd-rel-1.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-mhle" } */
+/* { dg-options "-march=x86-64 -mhle" } */
 /* { dg-final { scan-assembler "lock\[ \n\t\]+\(xrelease\|\.byte\[ \t\]+0xf3\)\[ \t\n\]+xadd" } } */
 
 int
Index: gcc.target/i386/hle-cmpxchg-acq-1.c
===================================================================
--- gcc.target/i386/hle-cmpxchg-acq-1.c	(revision 187093)
+++ gcc.target/i386/hle-cmpxchg-acq-1.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-mhle" } */
+/* { dg-options "-march=x86-64 -mhle" } */
 /* { dg-final { scan-assembler "lock\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+cmpxchg" } } */
 
 int
Index: gcc.target/i386/hle-xadd-acq-1.c
===================================================================
--- gcc.target/i386/hle-xadd-acq-1.c	(revision 187093)
+++ gcc.target/i386/hle-xadd-acq-1.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-mhle" } */
+/* { dg-options "-march=x86-64 -mhle" } */
 /* { dg-final { scan-assembler "lock\[ \n\t\]+\(xacquire\|\.byte\[ \t\]+0xf2\)\[ \t\n\]+xadd" } } */
 
 int
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 187093)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@ 
+2012-05-03  Uros Bizjak  <ubizjak@gmail.com>
+
+	* gcc.target/i386/hle-cmpxchg-acq-1.c (dg-options): Add -march=x86-64.
+	* gcc.target/i386/hle-xadd-acq-1.c (dg-options): Ditto.
+	* gcc.target/i386/hle-cmpxchg-rel-1.c (dg-options): Ditto.
+	* gcc.target/i386/hle-xadd-rel-1.c (dg-options): Ditto.
+
 2012-05-03  Jakub Jelinek  <jakub@redhat.com>
 
 	* gcc.target/i386/hle-xadd-rel-1.c: Match .byte 0xf3 instead of