@@ -1,5 +1,10 @@
2011-03-06 H.J. Lu <hongjiu.lu@intel.com>
+ * config/i386/i386.c (ix86_expand_call): Convert function address
+ to Pmode if needed.
+
+2011-03-06 H.J. Lu <hongjiu.lu@intel.com>
+
PR other/48007
* unwind-dw2.c (_Unwind_Context): Save call frame hard registers
as _Unwind_Word.
@@ -22041,7 +22041,10 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
? !sibcall_insn_operand (XEXP (fnaddr, 0), Pmode)
: !call_insn_operand (XEXP (fnaddr, 0), Pmode))
{
- fnaddr = copy_to_mode_reg (Pmode, XEXP (fnaddr, 0));
+ fnaddr = XEXP (fnaddr, 0);
+ if (GET_MODE (fnaddr) != Pmode)
+ fnaddr = convert_to_mode (Pmode, fnaddr, 1);
+ fnaddr = copy_to_mode_reg (Pmode, fnaddr);
fnaddr = gen_rtx_MEM (QImode, fnaddr);
}