]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
builtins.c (expand_builtin_synchronize): Build a new-style asm with a memory clobber.
authorRichard Henderson <rth@redhat.com>
Tue, 18 Oct 2005 03:12:55 +0000 (20:12 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 18 Oct 2005 03:12:55 +0000 (20:12 -0700)
        * builtins.c (expand_builtin_synchronize): Build a new-style asm
        with a memory clobber.

From-SVN: r105535

gcc/ChangeLog
gcc/builtins.c

index c7c6e6c1c6feac954b9f3f8b998c66ee658c5a3c..91973cd7465ff1dcd732d80537a9df67172b1b44 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-17  Richard Henderson  <rth@redhat.com>
+
+       * builtins.c (expand_builtin_synchronize): Build a new-style asm
+       with a memory clobber.
+
 2005-10-17  James E Wilson  <wilson@specifix.com>
 
        PR rtl-optimization/17356
index a39860574089d3694cf4044a53a6376ca3256c71..a9fe858250187c566a9d412177abd131c1af831a 100644 (file)
@@ -5501,7 +5501,7 @@ expand_builtin_lock_test_and_set (enum machine_mode mode, tree arglist,
 static void
 expand_builtin_synchronize (void)
 {
-  rtx body;
+  tree x;
 
 #ifdef HAVE_memory_barrier
   if (HAVE_memory_barrier)
@@ -5511,11 +5511,12 @@ expand_builtin_synchronize (void)
     }
 #endif
 
-  /* If no explicit memory barrier instruction is available, create an empty
-     asm stmt that will prevent compiler movement across the barrier.  */
-  body = gen_rtx_ASM_INPUT (VOIDmode, "");
-  MEM_VOLATILE_P (body) = 1;
-  emit_insn (body);
+  /* If no explicit memory barrier instruction is available, create an
+     empty asm stmt with a memory clobber.  */
+  x = build4 (ASM_EXPR, void_type_node, build_string (0, ""), NULL, NULL,
+             tree_cons (NULL, build_string (6, "memory"), NULL));
+  ASM_VOLATILE_P (x) = 1;
+  expand_asm_expr (x);
 }
 
 /* Expand the __sync_lock_release intrinsic.  ARGLIST is the operands list