From: John David Anglin Date: Fri, 18 Sep 2015 18:26:13 +0000 (+0000) Subject: re PR middle-end/67401 (Incorrect expand of __atomic_compare_exchange_8 using __sync_... X-Git-Tag: releases/gcc-4.9.4~597 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bdfd16c3a30d96b955eae991b96e6201e1d39f9;p=thirdparty%2Fgcc.git re PR middle-end/67401 (Incorrect expand of __atomic_compare_exchange_8 using __sync_val_compare_and_swap_8) PR middle-end/67401 * optabs.c (expand_atomic_compare_and_swap): Move result of emitting sync_compare_and_swap_optab libcall to target_oval. From-SVN: r227914 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c9f98d237280..1281413cae73 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-09-18 John David Anglin + + PR middle-end/67401 + * optabs.c (expand_atomic_compare_and_swap): Move result of emitting + sync_compare_and_swap_optab libcall to target_oval. + 2015-09-17 Eric Botcazou PR rtl-optimization/66790 diff --git a/gcc/optabs.c b/gcc/optabs.c index 5359257665ab..aa4defcdd378 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -7474,9 +7474,10 @@ expand_atomic_compare_and_swap (rtx *ptarget_bool, rtx *ptarget_oval, if (libfunc != NULL) { rtx addr = convert_memory_address (ptr_mode, XEXP (mem, 0)); - target_oval = emit_library_call_value (libfunc, NULL_RTX, LCT_NORMAL, - mode, 3, addr, ptr_mode, - expected, mode, desired, mode); + rtx target = emit_library_call_value (libfunc, NULL_RTX, LCT_NORMAL, + mode, 3, addr, ptr_mode, + expected, mode, desired, mode); + emit_move_insn (target_oval, target); /* Compute the boolean return value only if requested. */ if (ptarget_bool)