]> gcc.gnu.org Git - gcc.git/commitdiff
re PR target/70168 (Wrong code generation in __sync_val_compare_and_swap on PowerPC)
authorUlrich Weigand <uweigand@de.ibm.com>
Thu, 10 Mar 2016 23:58:44 +0000 (23:58 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Thu, 10 Mar 2016 23:58:44 +0000 (23:58 +0000)
PR target/70168
* config/rs6000/rs6000.c (rs6000_expand_atomic_compare_and_swap):
Handle overlapping retval and newval.

From-SVN: r234126

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index d53c261bb8127f4895fb3498a9983d7204bc54ef..cc91e84d61b8838cbcfa0cd407efcc42fa932373 100644 (file)
@@ -1,3 +1,9 @@
+2016-03-10  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+       PR target/70168
+       * config/rs6000/rs6000.c (rs6000_expand_atomic_compare_and_swap):
+       Handle overlapping retval and newval.
+
 2016-03-10  Nick Clifton  <nickc@redhat.com>
 
        PR target/7044
index 5b03f9e7d37f7591cf25c989b5038fde077c480f..fd4b7cc5a7ee32cdc70f42a83fd04414662b3589 100644 (file)
@@ -22283,6 +22283,9 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[])
   if (mode != TImode && !reg_or_short_operand (oldval, mode))
     oldval = copy_to_mode_reg (mode, oldval);
 
+  if (reg_overlap_mentioned_p (retval, newval))
+    newval = copy_to_reg (newval);
+
   mem = rs6000_pre_atomic_barrier (mem, mod_s);
 
   label1 = NULL_RTX;
This page took 0.100809 seconds and 5 git commands to generate.