Commit 628c1ac9 by H.J. Lu Committed by H.J. Lu

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
parent 08a8923e
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
in Pmode.
(ix86_promote_function_mode): New.
......
......@@ -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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment