[Comitted] S/390: Fix TD/TF mem to reg splitter for -m31 -mzarch

Submitted by Andreas Krebbel on May 9, 2011, 2:39 p.m.


Message ID 20110509143905.GA6958@bart
State New
Headers show

Commit Message

Andreas Krebbel May 9, 2011, 2:39 p.m.

the attached patch fixes a testsuite failure with -m31 -mzarch.  The
TD/TF mem to reg move splitter uses the first word mode register of
the target operand as temporary register for storing the address.
This generates an invalid address when having a 64 bit word mode and a
32 bit address mode as it happens with -m31 -mzarch.

Fixed with the attached patch. 

Bootstrapped and regtested with -with-mode=zarch.

Applied to mainline and 4.6.



2011-05-09  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* config/s390/s390.md (TD/TF mem to reg move splitter): Make the
	temporary register to match Pmode.

Patch hide | download patch | download mbox

Index: gcc/config/s390/s390.md
--- gcc/config/s390/s390.md.orig
+++ gcc/config/s390/s390.md
@@ -2026,6 +2026,7 @@ 
   [(set (match_dup 0) (match_dup 1))]
   rtx addr = operand_subword (operands[0], 1, 0, <MODE>mode);
+  addr = gen_lowpart (Pmode, addr);
   s390_load_address (addr, XEXP (operands[1], 0));
   operands[1] = replace_equiv_address (operands[1], addr);