rs6000.c (rs6000_adjust_atomic_subword): Calculate correct shift value in little...
authorAnton Blanchard <anton@samba.org>
Tue, 11 Jun 2013 06:17:50 +0000 (06:17 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Tue, 11 Jun 2013 06:17:50 +0000 (15:47 +0930)
* config/rs6000/rs6000.c (rs6000_adjust_atomic_subword): Calculate
correct shift value in little-endian mode.

From-SVN: r199935

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

index 903a79c..b3db96e 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-11  Anton Blanchard  <anton@samba.org>
+
+       * config/rs6000/rs6000.c (rs6000_adjust_atomic_subword): Calculate
+       correct shift value in little-endian mode.
+
 2013-06-11  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/56564
index 3646c6d..54dc0ce 100644 (file)
@@ -17881,8 +17881,9 @@ rs6000_adjust_atomic_subword (rtx orig_mem, rtx *pshift, rtx *pmask)
   shift = gen_reg_rtx (SImode);
   addr = gen_lowpart (SImode, addr);
   emit_insn (gen_rlwinm (shift, addr, GEN_INT (3), GEN_INT (shift_mask)));
-  shift = expand_simple_binop (SImode, XOR, shift, GEN_INT (shift_mask),
-                              shift, 1, OPTAB_LIB_WIDEN);
+  if (WORDS_BIG_ENDIAN)
+    shift = expand_simple_binop (SImode, XOR, shift, GEN_INT (shift_mask),
+                                shift, 1, OPTAB_LIB_WIDEN);
   *pshift = shift;
 
   /* Mask for insertion.  */