diff options
author | Richard Henderson <rth@redhat.com> | 2005-10-17 20:12:55 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2005-10-17 20:12:55 -0700 |
commit | 74395677b78fbb5ce35c444f5977b087ebe1a759 (patch) | |
tree | 1a015ec6e9cf29438c20526eaeedcef23eecd008 /gcc/builtins.c | |
parent | 1b2914a08690ba27783457d7ebe250afba9bd9f2 (diff) | |
download | gcc-74395677b78fbb5ce35c444f5977b087ebe1a759.zip gcc-74395677b78fbb5ce35c444f5977b087ebe1a759.tar.gz gcc-74395677b78fbb5ce35c444f5977b087ebe1a759.tar.bz2 |
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
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index a398605..a9fe858 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -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 |