From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22723 invoked by alias); 28 Nov 2012 17:53:34 -0000 Received: (qmail 22708 invoked by uid 22791); 28 Nov 2012 17:53:32 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Nov 2012 17:53:26 +0000 Received: by mail-wg0-f51.google.com with SMTP id ei8so4977710wgb.8 for ; Wed, 28 Nov 2012 09:53:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.206.152 with SMTP id l24mr4270815weo.93.1354125205391; Wed, 28 Nov 2012 09:53:25 -0800 (PST) Received: by 10.216.153.132 with HTTP; Wed, 28 Nov 2012 09:53:25 -0800 (PST) In-Reply-To: <50B63460.7000902@redhat.com> References: <50B63460.7000902@redhat.com> Date: Wed, 28 Nov 2012 17:53:00 -0000 Message-ID: Subject: Re: [patch i386} Fix PR 55171 - [4.7/4.8 Regression] incorrect virtual thunk on mingw From: Kai Tietz To: Richard Henderson Cc: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg02350.txt.bz2 2012/11/28 Richard Henderson : > On 11/25/2012 07:26 AM, Kai Tietz wrote: >> - if ((ccvt & (IX86_CALLCVT_FASTCALL | IX86_CALLCVT_THISCALL)) != 0) >> + if ((ccvt & IX86_CALLCVT_FASTCALL) != 0) >> { >> /* Fastcall functions use ecx/edx for arguments, which leaves >> us with EAX for the static chain. >> @@ -25142,6 +25160,12 @@ ix86_static_chain (const_tree fndecl, bo >> leaves us with EAX for the static chain. */ >> regno = AX_REG; >> } >> + else if ((ccvt & IX86_CALLCVT_THISCALL) != 0) >> + { >> + /* Thiscall functions use ecx for arguments, which leaves >> + us with EDX for the static chain. */ >> + regno = DX_REG; >> + } > > How is this not abi breakage? Why not leave eax as the static chain? > > > r~ Well, interesting function here is get_scratch_register_on_entry, where for thiscall (it uses just ecx) we have by this %eax remaining as scratch. Well, we could switch that here and make scratch %edx for thiscall? Kai