aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2012-03-11 16:37:45 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2012-03-11 09:37:45 -0700
commitba61421d583a66b86edcbc7a259875ca61f2ef6e (patch)
tree517bb1e2aae3b7213523a6823f60e4af1a2c39b0
parent649507afb03f0e5cc688215f49fce8597518f0dd (diff)
downloadgcc-ba61421d583a66b86edcbc7a259875ca61f2ef6e.zip
gcc-ba61421d583a66b86edcbc7a259875ca61f2ef6e.tar.gz
gcc-ba61421d583a66b86edcbc7a259875ca61f2ef6e.tar.bz2
Check ptr_mode and use Pmode in ix86_trampoline_init
2012-03-11 H.J. Lu <hongjiu.lu@intel.com> * config/i386/i386.c (ix86_trampoline_init): Use movl for 64bit if ptr_mode == SImode. Replace DImode with Pmode or ptr_mode. From-SVN: r185197
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i386/i386.c15
2 files changed, 14 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5a74c5f..a3b1351 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2012-03-11 H.J. Lu <hongjiu.lu@intel.com>
+ * config/i386/i386.c (ix86_trampoline_init): Use movl for 64bit if
+ ptr_mode == SImode. Replace DImode with Pmode or ptr_mode.
+
+2012-03-11 H.J. Lu <hongjiu.lu@intel.com>
+
* config/i386/i386.c (x86_this_parameter): Replace DImode with
Pmode.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 30dac59..f74914f 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -24309,10 +24309,13 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
/* Load the function address to r11. Try to load address using
the shorter movl instead of movabs. We may want to support
movq for kernel mode, but kernel does not use trampolines at
- the moment. */
- if (x86_64_zext_immediate_operand (fnaddr, VOIDmode))
+ the moment. FNADDR is a 32bit address and may not be in
+ DImode when ptr_mode == SImode. Always use movl in this
+ case. */
+ if (ptr_mode == SImode
+ || x86_64_zext_immediate_operand (fnaddr, VOIDmode))
{
- fnaddr = copy_to_mode_reg (DImode, fnaddr);
+ fnaddr = copy_to_mode_reg (Pmode, fnaddr);
mem = adjust_address (m_tramp, HImode, offset);
emit_move_insn (mem, gen_int_mode (0xbb41, HImode));
@@ -24331,9 +24334,9 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
offset += 10;
}
- /* Load static chain using movabs to r10. Use the
- shorter movl instead of movabs for x32. */
- if (TARGET_X32)
+ /* Load static chain using movabs to r10. Use the shorter movl
+ instead of movabs when ptr_mode == SImode. */
+ if (ptr_mode == SImode)
{
opcode = 0xba41;
size = 6;