summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index bb9ee35cd8c..c70c0f5004c 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -5288,6 +5288,12 @@ expand_builtin_atomic_fetch_op (machine_mode mode, tree exp, rtx target,
gcc_assert (TREE_OPERAND (addr, 0) == fndecl);
TREE_OPERAND (addr, 0) = builtin_decl_explicit (ext_call);
+ /* If we will emit code after the call, the call can not be a tail call.
+ If it is emitted as a tail call, a barrier is emitted after it, and
+ then all trailing code is removed. */
+ if (!ignore)
+ CALL_EXPR_TAILCALL (exp) = 0;
+
/* Expand the call here so we can emit trailing code. */
ret = expand_call (exp, target, ignore);