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

mail settings
Submitter Andreas Krebbel
Date May 9, 2011, 2:39 p.m.
Message ID <20110509143905.GA6958@bart>
Download mbox | patch
Permalink /patch/94770/
State New
Headers show


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  <>

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


Index: gcc/config/s390/
--- gcc/config/s390/
+++ gcc/config/s390/
@@ -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);