From patchwork Tue Jul 6 18:12:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 58052 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 86813B6EEB for ; Wed, 7 Jul 2010 04:12:33 +1000 (EST) Received: (qmail 27618 invoked by alias); 6 Jul 2010 18:12:31 -0000 Received: (qmail 27610 invoked by uid 22791); 6 Jul 2010 18:12:31 -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, 06 Jul 2010 18:12:26 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o66ICPHJ007071 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Jul 2010 14:12:25 -0400 Received: from redhat.com (vpn-11-210.rdu.redhat.com [10.11.11.210]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o66ICLUA031835 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 6 Jul 2010 14:12:24 -0400 Date: Tue, 6 Jul 2010 14:12:21 -0400 From: Aldy Hernandez To: Richard Henderson Cc: Patrick Marlier , FELBER Pascal , gcc-patches@gcc.gnu.org Subject: Re: [trans-mem] issue with openmp Message-ID: <20100706181221.GA21220@redhat.com> References: <4C04C24A.4080103@unine.ch> <20100618153140.GB7343@redhat.com> <4C221F08.2020403@unine.ch> <20100623172043.GB19259@redhat.com> <4C225BC3.9010301@unine.ch> <20100706162920.GA20816@redhat.com> <4C336C64.5070601@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4C336C64.5070601@redhat.com> 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 On Tue, Jul 06, 2010 at 10:48:20AM -0700, Richard Henderson wrote: > On 07/06/2010 09:29 AM, Aldy Hernandez wrote: > > -__attribute__((transaction_pure)) > > -extern void _ITM_dropReferences (void *, size_t) ITM_REGPARM; > > +extern void _ITM_dropReferences (void *, size_t) ITM_REGPARM ITM_PURE; > > + > > +__attribute__((__malloc__)) ITM_REGPARM ITM_PURE > > +extern void *_ITM_malloc (size_t); > > +__attribute__((__malloc__)) ITM_REGPARM ITM_PURE > > +extern void *_ITM_calloc (size_t, size_t); > > +extern void _ITM_free (void *) ITM_REGPARM ITM_PURE; > > I'm not sure that _ITM_malloc et al should include ITM_REGPARM. Arghh, I was getting confused by a complaint by Patrick about a %eax<->%rax problem in the calling sequence, but that must be something different because I can't reproduce it. Direct calls to _ITM_malloc() agree with the calling convention expected by such function. Patrick, if after a complete toolchain rebuild with this patch, you still see an ABI problem, send me the testcase. > Also, it's canonical to place these attributes before the ";", > not before the "extern". Fixed. OK? * libitm.h (ITM_PURE): Define. Declare _ITM_malloc, _ITM_calloc, and _ITM_free. Index: libitm.h =================================================================== --- libitm.h (revision 161512) +++ libitm.h (working copy) @@ -43,6 +43,7 @@ extern "C" { #endif #define ITM_NORETURN __attribute__((noreturn)) +#define ITM_PURE __attribute__((transaction_pure)) /* The following are externally visible definitions and functions, though only very few of these should be called by user code. */ @@ -152,8 +153,15 @@ extern void _ITM_addUserUndoAction(_ITM_ extern int _ITM_getThreadnum(void) ITM_REGPARM; -__attribute__((transaction_pure)) -extern void _ITM_dropReferences (void *, size_t) ITM_REGPARM; +extern void _ITM_dropReferences (void *, size_t) ITM_REGPARM ITM_PURE; + +extern void *_ITM_malloc (size_t) + __attribute__((__malloc__)) ITM_PURE; + +extern void *_ITM_calloc (size_t, size_t) + __attribute__((__malloc__)) ITM_PURE; + +extern void _ITM_free (void *) ITM_PURE; /* The following typedefs exist to make the macro expansions below work