Commit 74395677 by Richard Henderson Committed by Richard Henderson

builtins.c (expand_builtin_synchronize): Build a new-style asm with a memory clobber.

        * builtins.c (expand_builtin_synchronize): Build a new-style asm
        with a memory clobber.

From-SVN: r105535
parent 1b2914a0
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> 2005-10-17 James E Wilson <wilson@specifix.com>
PR rtl-optimization/17356 PR rtl-optimization/17356
......
...@@ -5501,7 +5501,7 @@ expand_builtin_lock_test_and_set (enum machine_mode mode, tree arglist, ...@@ -5501,7 +5501,7 @@ expand_builtin_lock_test_and_set (enum machine_mode mode, tree arglist,
static void static void
expand_builtin_synchronize (void) expand_builtin_synchronize (void)
{ {
rtx body; tree x;
#ifdef HAVE_memory_barrier #ifdef HAVE_memory_barrier
if (HAVE_memory_barrier) if (HAVE_memory_barrier)
...@@ -5511,11 +5511,12 @@ expand_builtin_synchronize (void) ...@@ -5511,11 +5511,12 @@ expand_builtin_synchronize (void)
} }
#endif #endif
/* If no explicit memory barrier instruction is available, create an empty /* If no explicit memory barrier instruction is available, create an
asm stmt that will prevent compiler movement across the barrier. */ empty asm stmt with a memory clobber. */
body = gen_rtx_ASM_INPUT (VOIDmode, ""); x = build4 (ASM_EXPR, void_type_node, build_string (0, ""), NULL, NULL,
MEM_VOLATILE_P (body) = 1; tree_cons (NULL, build_string (6, "memory"), NULL));
emit_insn (body); ASM_VOLATILE_P (x) = 1;
expand_asm_expr (x);
} }
/* Expand the __sync_lock_release intrinsic. ARGLIST is the operands list /* Expand the __sync_lock_release intrinsic. ARGLIST is the operands list
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment