On Thu, May 3, 2012 at 12:17 PM, Uros Bizjak <ubiz...@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  <ubiz...@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.
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  <ubiz...@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  <ja...@redhat.com>
 
        * gcc.target/i386/hle-xadd-rel-1.c: Match .byte 0xf3 instead of

Reply via email to