aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2011-07-13 15:54:15 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2011-07-13 08:54:15 -0700
commit72fbc381feb3f20f12ddaed9538fb1b719ffc164 (patch)
tree560438f61d7d459c686608149f83818948f6748b
parentdbf32ca5be8629b07348051cb86811c022449349 (diff)
downloadgcc-72fbc381feb3f20f12ddaed9538fb1b719ffc164.zip
gcc-72fbc381feb3f20f12ddaed9538fb1b719ffc164.tar.gz
gcc-72fbc381feb3f20f12ddaed9538fb1b719ffc164.tar.bz2
Support ptr_mode != Pmode in x86_output_mi_thunk.
2011-07-13 H.J. Lu <hongjiu.lu@intel.com> * config/i386/i386.c (x86_output_mi_thunk): Support ptr_mode != Pmode. * config/i386/i386.md (*addsi_1_zext): Renamed to ... (addsi_1_zext): This. From-SVN: r176238
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/i386/i386.c17
-rw-r--r--gcc/config/i386/i386.md2
3 files changed, 22 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7bb3a05..ed49313 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2011-07-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (x86_output_mi_thunk): Support ptr_mode
+ != Pmode.
+
+ * config/i386/i386.md (*addsi_1_zext): Renamed to ...
+ (addsi_1_zext): This.
+
2011-07-13 Bernd Schmidt <bernds@codesourcery.com>
* doc/tm.texi.in (TARGET_ASM_MERGEABLE_RODATA_PREFIX): Add hook.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 24c906c..f643efcd 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -29442,7 +29442,7 @@ x86_output_mi_thunk (FILE *file,
/* Adjust the this parameter by a value stored in the vtable. */
if (vcall_offset)
{
- rtx vcall_addr, vcall_mem;
+ rtx vcall_addr, vcall_mem, this_mem;
unsigned int tmp_regno;
if (TARGET_64BIT)
@@ -29457,7 +29457,10 @@ x86_output_mi_thunk (FILE *file,
}
tmp = gen_rtx_REG (Pmode, tmp_regno);
- emit_move_insn (tmp, gen_rtx_MEM (ptr_mode, this_reg));
+ this_mem = gen_rtx_MEM (ptr_mode, this_reg);
+ if (Pmode != ptr_mode)
+ this_mem = gen_rtx_ZERO_EXTEND (Pmode, this_mem);
+ emit_move_insn (tmp, this_mem);
/* Adjust the this parameter. */
vcall_addr = plus_constant (tmp, vcall_offset);
@@ -29469,8 +29472,14 @@ x86_output_mi_thunk (FILE *file,
vcall_addr = gen_rtx_PLUS (Pmode, tmp, tmp2);
}
- vcall_mem = gen_rtx_MEM (Pmode, vcall_addr);
- emit_insn (ix86_gen_add3 (this_reg, this_reg, vcall_mem));
+ vcall_mem = gen_rtx_MEM (ptr_mode, vcall_addr);
+ if (Pmode != ptr_mode)
+ emit_insn (gen_addsi_1_zext (this_reg,
+ gen_rtx_REG (ptr_mode,
+ REGNO (this_reg)),
+ vcall_mem));
+ else
+ emit_insn (ix86_gen_add3 (this_reg, this_reg, vcall_mem));
}
/* If necessary, drop THIS back to its stack slot. */
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 0451c67..cf0fdf4 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -5508,7 +5508,7 @@
;; operands so proper swapping will be done in reload. This allow
;; patterns constructed from addsi_1 to match.
-(define_insn "*addsi_1_zext"
+(define_insn "addsi_1_zext"
[(set (match_operand:DI 0 "register_operand" "=r,r,r")
(zero_extend:DI
(plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,r,r")