]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/67401 (Incorrect expand of __atomic_compare_exchange_8 using __sync_...
authorJohn David Anglin <danglin@gcc.gnu.org>
Fri, 18 Sep 2015 18:26:13 +0000 (18:26 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 18 Sep 2015 18:26:13 +0000 (18:26 +0000)
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

gcc/ChangeLog
gcc/optabs.c

index c9f98d237280954380e14c419801968548056551..1281413cae735128785adca54ecd36bbfc4ae967 100644 (file)
@@ -1,3 +1,9 @@
+2015-09-18  John David Anglin  <danglin@gcc.gnu.org>
+
+       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  <ebotcazou@adacore.com>
 
        PR rtl-optimization/66790
index 5359257665ab67a2301700d85db44c152059bec6..aa4defcdd378838d1e4424d4b94d6ebca33bff16 100644 (file)
@@ -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)