Convert to Pmode if needed in ix86_legitimize_address.

2011-07-21  H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/i386.c (ix86_legitimize_address): Convert to
	Pmode if needed.

From-SVN: r176595
This commit is contained in:
H.J. Lu 2011-07-21 22:36:11 +00:00 committed by H.J. Lu
parent 08a8923efc
commit 628c1ac95a
2 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-07-21 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (ix86_legitimize_address): Convert to
Pmode if needed.
2011-07-21 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (function_value_64): Always return pointers

View File

@ -12644,7 +12644,11 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
rtx temp = gen_reg_rtx (Pmode);
rtx val = force_operand (XEXP (x, 1), temp);
if (val != temp)
emit_move_insn (temp, val);
{
if (GET_MODE (val) != Pmode)
val = convert_to_mode (Pmode, val, 1);
emit_move_insn (temp, val);
}
XEXP (x, 1) = temp;
return x;
@ -12655,7 +12659,11 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
rtx temp = gen_reg_rtx (Pmode);
rtx val = force_operand (XEXP (x, 0), temp);
if (val != temp)
emit_move_insn (temp, val);
{
if (GET_MODE (val) != Pmode)
val = convert_to_mode (Pmode, val, 1);
emit_move_insn (temp, val);
}
XEXP (x, 0) = temp;
return x;