This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH, rs6000: backport PR 37640


I would like to backport this patch from mainline to the 4.3 branch --
OK?  Tested with a bootstrap and regression test run on powerpc64-linux.

Thanks, Ben


2008-11-18  Ben Elliston  <bje@au.ibm.com>

        Backport from mainline:
        2008-09-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR target/37640
        * config/rs6000/rs6000.c (rs6000_expand_compare_and_swapqhi): Force
        address to a register before taking the lower part.

Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c      (revision 141955)
+++ config/rs6000/rs6000.c      (working copy)
@@ -13835,7 +13835,8 @@
   HOST_WIDE_INT imask = GET_MODE_MASK (mode);
 
   /* Shift amount for subword relative to aligned word.  */
-  addrSI = force_reg (SImode, gen_lowpart_common (SImode, XEXP (mem, 0)));
+  addrSI = force_reg (GET_MODE (XEXP (mem, 0)), XEXP (mem, 0));
+  addrSI = force_reg (SImode, gen_lowpart_common (SImode, addrSI));
   shift = gen_reg_rtx (SImode);
   emit_insn (gen_rlwinm (shift, addrSI, GEN_INT (3),
                         GEN_INT (shift_mask)));

testsuite/
2008-11-18  Ben Elliston  <bje@rego11.ozlabs.ibm.com>

        Backport from mainline:
        2008-09-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR target/37640
        * gcc.c-torture/compile/sync-3.c: New testcase to check that
        addresses of non zero offset works.

(I won't paste the full test case here; it's just a copy of the one in
mainline).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]