rs6000.c (rs6000_legitimize_address): Check to ensure that we can address an entire entity > 8 bytes.

* config/rs6000/rs6000.c (rs6000_legitimize_address): Check to
	ensure that we can address an entire entity > 8 bytes.  Don't
	generate reg+reg addressing for such data.

From-SVN: r132567
This commit is contained in:
Nathan Froyd 2008-02-23 01:00:42 +00:00 committed by Nathan Froyd
parent 2165fd3855
commit 61dd226f1c
2 changed files with 26 additions and 10 deletions

View File

@ -1,3 +1,9 @@
2008-02-22 Nathan Froyd <froydnj@codesourcery.com>
* config/rs6000/rs6000.c (rs6000_legitimize_address): Check to
ensure that we can address an entire entity > 8 bytes. Don't
generate reg+reg addressing for such data.
2008-02-22 Nathan Froyd <froydnj@codesourcery.com>
* config/rs6000/rs6000.h (CONSTANT_ALIGNMENT): Don't overalign

View File

@ -3630,19 +3630,29 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
/* We accept [reg + reg] and [reg + OFFSET]. */
if (GET_CODE (x) == PLUS)
{
rtx op1 = XEXP (x, 0);
rtx op2 = XEXP (x, 1);
{
rtx op1 = XEXP (x, 0);
rtx op2 = XEXP (x, 1);
rtx y;
op1 = force_reg (Pmode, op1);
op1 = force_reg (Pmode, op1);
if (GET_CODE (op2) != REG
&& (GET_CODE (op2) != CONST_INT
|| !SPE_CONST_OFFSET_OK (INTVAL (op2))))
op2 = force_reg (Pmode, op2);
if (GET_CODE (op2) != REG
&& (GET_CODE (op2) != CONST_INT
|| !SPE_CONST_OFFSET_OK (INTVAL (op2))
|| (GET_MODE_SIZE (mode) > 8
&& !SPE_CONST_OFFSET_OK (INTVAL (op2) + 8))))
op2 = force_reg (Pmode, op2);
return gen_rtx_PLUS (Pmode, op1, op2);
}
/* We can't always do [reg + reg] for these, because [reg +
reg + offset] is not a legitimate addressing mode. */
y = gen_rtx_PLUS (Pmode, op1, op2);
if (GET_MODE_SIZE (mode) > 8 && REG_P (op2))
return force_reg (Pmode, y);
else
return y;
}
return force_reg (Pmode, x);
}