Patchwork [x32] PATCH: Use ptr_mode instead of Pmode for vtable adjustment

login
register
mail settings
Submitter H.J. Lu
Date May 20, 2011, 12:49 p.m.
Message ID <20110520124930.GA6206@intel.com>
Download mbox | patch
Permalink /patch/96596/
State New
Headers show

Comments

H.J. Lu - May 20, 2011, 12:49 p.m.
We should use ptr_mode instead of Pmode for vtable adjustment.  This
patch fixed:

FAIL: ext/ext_pointer/1.cc execution test
FAIL: gcc.dg/c99-stdint-1.c (test for excess errors)
FAIL: g++.dg/abi/covariant3.C execution test
FAIL: g++.dg/abi/vcall1.C execution test
FAIL: g++.dg/inherit/covariant17.C execution test
FAIL: g++.dg/inherit/covariant18.C execution test
FAIL: g++.dg/inherit/covariant3.C execution test
FAIL: g++.dg/inherit/covariant4.C execution test
FAIL: g++.old-deja/g++.abi/vtable3a.C execution test
FAIL: g++.old-deja/g++.abi/vtable3b.C execution test
FAIL: g++.old-deja/g++.abi/vtable3c.C execution test
FAIL: g++.old-deja/g++.abi/vtable3d.C execution test
FAIL: g++.old-deja/g++.abi/vtable3e.C execution test
FAIL: g++.old-deja/g++.abi/vtable3f.C execution test
FAIL: g++.old-deja/g++.abi/vtable3g.C execution test
FAIL: g++.old-deja/g++.abi/vtable3h.C execution test
FAIL: g++.old-deja/g++.abi/vtable3i.C execution test
FAIL: g++.old-deja/g++.abi/vtable3j.C execution test
FAIL: g++.old-deja/g++.mike/p4736b.C execution test
FAIL: g++.old-deja/g++.mike/p4736c.C execution test
FAIL: g++.old-deja/g++.mike/virt2.C execution test
FAIL: g++.old-deja/g++.mike/virt5.C execution test
FAIL: g++.old-deja/g++.oliva/thunk1.C execution test


H.J.
---
commit f18335eabb233ebe05ee1b0b0dc64ce0be5d88cd
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri May 20 05:05:17 2011 -0700

    Use ptr_mode instead of Pmode for vtable adjustment.

Patch

diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32
index 227b377..abd57a4 100644
--- a/gcc/ChangeLog.x32
+++ b/gcc/ChangeLog.x32
@@ -1,3 +1,9 @@ 
+2011-05-20  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR target/48529
+	* config/i386/i386.c (x86_output_mi_thunk): Use ptr_mode instead
+	of Pmode for vtable adjustment.
+
 2011-05-19  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* config/i386/x86-64.h (SIZE_TYPE): Check TARGET_LP64 instead
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index f4a74da..b68e2e8 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -30249,7 +30249,7 @@  x86_output_mi_thunk (FILE *file,
   if (vcall_offset)
     {
       if (TARGET_64BIT)
-	tmp = gen_rtx_REG (DImode, R10_REG);
+	tmp = gen_rtx_REG (ptr_mode, R10_REG);
       else
 	{
 	  int tmp_regno = CX_REG;
@@ -30259,7 +30259,7 @@  x86_output_mi_thunk (FILE *file,
 	  tmp = gen_rtx_REG (SImode, tmp_regno);
 	}
 
-      xops[0] = gen_rtx_MEM (Pmode, this_reg);
+      xops[0] = gen_rtx_MEM (ptr_mode, this_reg);
       xops[1] = tmp;
       output_asm_insn ("mov%z1\t{%0, %1|%1, %0}", xops);
 
@@ -30271,9 +30271,10 @@  x86_output_mi_thunk (FILE *file,
 	  xops[0] = GEN_INT (vcall_offset);
 	  xops[1] = tmp2;
 	  output_asm_insn ("mov{q}\t{%0, %1|%1, %0}", xops);
-	  xops[0] = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, tmp, tmp2));
+	  xops[0] = gen_rtx_MEM (ptr_mode,
+				 gen_rtx_PLUS (Pmode, tmp, tmp2));
 	}
-      xops[1] = this_reg;
+      xops[1] = gen_rtx_REG (ptr_mode, REGNO (this_reg));
       output_asm_insn ("add%z1\t{%0, %1|%1, %0}", xops);
     }