From patchwork Tue Jul 13 15:52:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 58794 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 A6BA3B6EF7 for ; Wed, 14 Jul 2010 01:52:35 +1000 (EST) Received: (qmail 19931 invoked by alias); 13 Jul 2010 15:52:33 -0000 Received: (qmail 19922 invoked by uid 22791); 13 Jul 2010 15:52:33 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Jul 2010 15:52:27 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6DFqQD2006933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 13 Jul 2010 11:52:26 -0400 Received: from redhat.com (vpn-10-180.rdu.redhat.com [10.11.10.180]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6DFqNFo011063 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 13 Jul 2010 11:52:25 -0400 Date: Tue, 13 Jul 2010 11:52:22 -0400 From: Aldy Hernandez To: rth@redhat.com, gcc-patches@gcc.gnu.org Subject: [trans-mem] fix begin_transaction ABI on ia32 Message-ID: <20100713155219.GA24158@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) 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 were calling begin_transaction() with the arguments in the registers, but the function was expecting them on the stack. Richard said this was an oversight while converting into C++. With this patch transactions are now working on ia32, though there are still 2 distinct failures left on the testsuite. I will fix these next. Applying as obvious. * libitm.h: Add comment. * libitm_i.h (begin_transaction): Add ITM_REGPARM. Index: libitm.h =================================================================== --- libitm.h (revision 161883) +++ libitm.h (working copy) @@ -37,6 +37,7 @@ extern "C" { #endif #ifdef __i386__ +/* Only for 32-bit x86. */ # define ITM_REGPARM __attribute__((regparm(2))) #else # define ITM_REGPARM Index: libitm_i.h =================================================================== --- libitm_i.h (revision 161512) +++ libitm_i.h (working copy) @@ -244,7 +244,7 @@ struct gtm_transaction // Invoked from assembly language, thus the "asm" specifier on // the name, avoiding complex name mangling. static uint32_t begin_transaction(uint32_t, const gtm_jmpbuf *) - __asm__("GTM_begin_transaction"); + __asm__("GTM_begin_transaction") ITM_REGPARM; // In eh_cpp.cc void revert_cpp_exceptions ();