From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114151 invoked by alias); 23 Apr 2015 08:32:21 -0000 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 Received: (qmail 114104 invoked by uid 89); 23 Apr 2015 08:32:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 23 Apr 2015 08:32:20 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3N8WG3A007793 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 23 Apr 2015 04:32:17 -0400 Received: from tucnak.zalov.cz (ovpn-116-89.ams2.redhat.com [10.36.116.89]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3N8WE4P031726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 23 Apr 2015 04:32:16 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t3N8WDk8002083; Thu, 23 Apr 2015 10:32:13 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t3N8WBDB002082; Thu, 23 Apr 2015 10:32:11 +0200 Date: Thu, 23 Apr 2015 08:32:00 -0000 From: Jakub Jelinek To: Julian Brown Cc: gcc-patches@gcc.gnu.org, Thomas Schwinge Subject: Re: [PATCH] Tidy up locking for libgomp OpenACC entry points Message-ID: <20150423083211.GA1751@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20150422194243.115f26fa@octopus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150422194243.115f26fa@octopus> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg01388.txt.bz2 On Wed, Apr 22, 2015 at 07:42:43PM +0100, Julian Brown wrote: > @@ -120,25 +116,32 @@ acc_free (void *d) > { > splay_tree_key k; > struct goacc_thread *thr = goacc_thread (); > + struct gomp_device_descr *acc_dev = thr->dev; IMHO you want to move this line after: > > if (!d) > return; > > assert (thr && thr->dev); the assert. Supposedly also the thr = line after the return; line, no need to do it if returning early. As gcc now defaults to -std=gnu11 for C, libgomp is written in C11 and you don't need to limit to C89 (and even back then, it was compiled by gcc and thus you could use GNU extensions, such as mixed declarations and code). Otherwise, I have no problem with this going to trunk, if Thomas is ok with it. Jakub