From patchwork Fri May 20 12:49:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 96596 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id B179FB71A1 for ; Fri, 20 May 2011 22:49:49 +1000 (EST) Received: (qmail 23216 invoked by alias); 20 May 2011 12:49:46 -0000 Received: (qmail 23206 invoked by uid 22791); 20 May 2011 12:49:46 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 May 2011 12:49:31 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 20 May 2011 05:49:31 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by orsmga002.jf.intel.com with ESMTP; 20 May 2011 05:49:31 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 0FDD9180DE1; Fri, 20 May 2011 05:49:31 -0700 (PDT) Date: Fri, 20 May 2011 05:49:30 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: [x32] PATCH: Use ptr_mode instead of Pmode for vtable adjustment Message-ID: <20110520124930.GA6206@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 Date: Fri May 20 05:05:17 2011 -0700 Use ptr_mode instead of Pmode for vtable adjustment. 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 + + 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 * 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); }