From: rth Date: Tue, 18 Oct 2005 03:12:55 +0000 (+0000) Subject: * builtins.c (expand_builtin_synchronize): Build a new-style asm X-Git-Tag: upstream/4.9.2~58134 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82e583964449362559c4f2e66821517345007a7a;p=platform%2Fupstream%2Flinaro-gcc.git * builtins.c (expand_builtin_synchronize): Build a new-style asm with a memory clobber. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105535 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c7c6e6c..91973cd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-10-17 Richard Henderson + + * builtins.c (expand_builtin_synchronize): Build a new-style asm + with a memory clobber. + 2005-10-17 James E Wilson PR rtl-optimization/17356 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