re PR middle-end/67401 (Incorrect expand of __atomic_compare_exchange_8 using __sync_...
authorJohn David Anglin <danglin@gcc.gnu.org>
Mon, 14 Sep 2015 12:05:58 +0000 (12:05 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Mon, 14 Sep 2015 12:05:58 +0000 (12:05 +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: r227746

gcc/ChangeLog
gcc/optabs.c

index 462a997707118bd4f2a6dd31599fdbd8ef7bb545..d5ef728f9e5ca84aec21bdc76e80bc753f5345e6 100644 (file)
@@ -1,3 +1,9 @@
+2015-09-14  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-14  Marek Polacek  <polacek@redhat.com>
 
        * rtlanal.c (split_double): Cast to unsigned when shifting a negative
index 79c6f06b9913ba1c8076e3abad02b13192eac158..c2a9b1ce9effd8bcaffc99c98d685558a41b65b7 100644 (file)
@@ -7521,9 +7521,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)