]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR target/70168
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Mar 2016 23:58:44 +0000 (23:58 +0000)
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Mar 2016 23:58:44 +0000 (23:58 +0000)
* config/rs6000/rs6000.c (rs6000_expand_atomic_compare_and_swap):
Handle overlapping retval and newval.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234126 138bc75d-0d04-0410-961f-82ee72b054a4

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;