Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 181727)
+++ lib/target-supports.exp	(working copy)
@@ -3644,11 +3644,14 @@
 }
 
 # Return 1 if the target supports atomic operations on "long long".
+#
+# Note: 32bit x86 targets require -march=pentium in dg-options.
 
 proc check_effective_target_sync_long_long { } {
-    if { ([istarget x86_64-*-*] || [istarget i?86-*-*])
-	 && ![is-effective-target ia32]
-	 || [istarget arm*-*-*] } {
+    if { [istarget x86_64-*-*]
+	 || [istarget i?86-*-*])
+	 || [istarget arm*-*-*]
+	 || [istarget alpha*-*-*] } {
 	return 1
     } else {
 	return 0
@@ -3657,10 +3660,12 @@
 
 # Return 1 if the target supports atomic operations on "long long"
 # and can execute them.
+#
+# Note: 32bit x86 targets require -march=pentium in dg-options.
 
 proc check_effective_target_sync_long_long_runtime { } {
-    if { ([istarget x86_64-*-*] || [istarget i?86-*-*])
-	 && ![is-effective-target ia32] } {
+    if { [istarget x86_64-*-*]
+	 || [istarget i?86-*-*] } {
 	return [check_cached_effective_target sync_long_long_available {
 	    check_runtime_nocache sync_long_long_available {
 		#include "cpuid.h"
@@ -3689,6 +3694,8 @@
 	      exit (0);
 	    }
 	} "" ]
+    } elseif { [istarget alpha*-*-*] } {
+	return 1
     } else {
 	return 0
     }
Index: gcc.dg/atomic-compare-exchange-4.c
===================================================================
--- gcc.dg/atomic-compare-exchange-4.c	(revision 181727)
+++ gcc.dg/atomic-compare-exchange-4.c	(working copy)
@@ -3,6 +3,7 @@
 /* { dg-do run } */
 /* { dg-require-effective-target sync_long_long_runtime } */
 /* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 /* Test the execution of __atomic_compare_exchange_n builtin for a long_long.  */
 
Index: gcc.dg/di-longlong64-sync-1.c
===================================================================
--- gcc.dg/di-longlong64-sync-1.c	(revision 181727)
+++ gcc.dg/di-longlong64-sync-1.c	(working copy)
@@ -1,6 +1,8 @@
 /* { dg-do run } */
 /* { dg-require-effective-target sync_long_long_runtime } */
 /* { dg-options "-std=gnu99" } */
+/* { dg-additional-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
 /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
 /* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
 
Index: gcc.dg/atomic-load-4.c
===================================================================
--- gcc.dg/atomic-load-4.c	(revision 181727)
+++ gcc.dg/atomic-load-4.c	(working copy)
@@ -3,6 +3,7 @@
 /* { dg-do run } */
 /* { dg-require-effective-target sync_long_long_runtime } */
 /* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 extern void abort(void);
 
Index: gcc.dg/simulate-thread/atomic-load-longlong.c
===================================================================
--- gcc.dg/simulate-thread/atomic-load-longlong.c	(revision 181727)
+++ gcc.dg/simulate-thread/atomic-load-longlong.c	(working copy)
@@ -1,6 +1,7 @@
 /* { dg-do link } */
 /* { dg-require-effective-target sync_long_long_runtime } */
 /* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 /* { dg-final { simulate-thread } } */
 
 
Index: gcc.dg/simulate-thread/atomic-other-longlong.c
===================================================================
--- gcc.dg/simulate-thread/atomic-other-longlong.c	(revision 181727)
+++ gcc.dg/simulate-thread/atomic-other-longlong.c	(working copy)
@@ -1,6 +1,7 @@
 /* { dg-do link } */
 /* { dg-require-effective-target sync_long_long_runtime } */
 /* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 /* { dg-final { simulate-thread } } */
 
 
Index: gcc.dg/atomic-store-4.c
===================================================================
--- gcc.dg/atomic-store-4.c	(revision 181727)
+++ gcc.dg/atomic-store-4.c	(working copy)
@@ -3,6 +3,7 @@
 /* { dg-do run } */
 /* { dg-require-effective-target sync_long_long_runtime } */
 /* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 /* Test the execution of the __atomic_store_n builtin for a long long.  */
 
Index: gcc.dg/atomic-exchange-4.c
===================================================================
--- gcc.dg/atomic-exchange-4.c	(revision 181727)
+++ gcc.dg/atomic-exchange-4.c	(working copy)
@@ -3,6 +3,7 @@
 /* { dg-do run } */
 /* { dg-require-effective-target sync_long_long_runtime } */
 /* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 /* Test the execution of the __atomic_X builtin for a long_long.  */
 
Index: gcc.dg/atomic-op-4.c
===================================================================
--- gcc.dg/atomic-op-4.c	(revision 181727)
+++ gcc.dg/atomic-op-4.c	(working copy)
@@ -3,6 +3,7 @@
 /* { dg-do run } */
 /* { dg-require-effective-target sync_long_long_runtime } */
 /* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 /* Test the execution of the __atomic_*OP builtin routines for long long.  */
 
Index: gcc.dg/di-sync-multithread.c
===================================================================
--- gcc.dg/di-sync-multithread.c	(revision 181727)
+++ gcc.dg/di-sync-multithread.c	(working copy)
@@ -3,6 +3,7 @@
 /* { dg-require-effective-target pthread_h } */
 /* { dg-require-effective-target pthread } */
 /* { dg-options "-pthread -std=gnu99" } */
+/* { dg-additional-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 /* test of long long atomic ops performed in parallel in 3 pthreads
    david.gilbert@linaro.org */
