From patchwork Tue Oct 28 16:37:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 404292 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4A76214007D for ; Wed, 29 Oct 2014 03:37:52 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=vn0w+dz8h27YzQ+TFVN4CL7qYqpfHKxdZn5xvSmJjYhN6W02Xf bb6rFzh6RZDVL+8CtaJ/SXbB1ru1rpx+S4WwmUsYtHSlLWkhATkU0aoI156kMczE aLVRX0oMBBa8FA1XMCifLsQWRhziejjDucI13ec8MSrARetSwlzsOM8MA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=D9+SdR+g/HOny4E/FVQZVpauYT8=; b=PcSOYBkxdK7nUy2jAkk9 5tmew312fKkhooWNoyu6/0USuiWGH7InipHLvnlwrDFhILwc1Sg7HFSPhdOOLv29 t01K+4TD/j4776JGNeYvwywUcv1+wpYa9As123GERz0DpMxtIaZppN+Ey90VPvEE /8QLPhBUYSLVFtCDd2QHfNU= Received: (qmail 16301 invoked by alias); 28 Oct 2014 16:37:44 -0000 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 Received: (qmail 16287 invoked by uid 89); 28 Oct 2014 16:37:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Oct 2014 16:37:42 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Xj9m6-0007Il-4e from Julian_Brown@mentor.com ; Tue, 28 Oct 2014 09:37:38 -0700 Received: from octopus (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.181.6; Tue, 28 Oct 2014 16:37:36 +0000 Date: Tue, 28 Oct 2014 16:37:29 +0000 From: Julian Brown To: CC: Thomas Schwinge , Jakub Jelinek Subject: [gomp4] Don't put acc_notify_var in thread-local struct Message-ID: <20141028163729.45bc231b@octopus> MIME-Version: 1.0 X-IsSubscribed: yes Hi, This patch moves acc_notify_var out of gomp_task_icv and makes it simply a global variable instead. OK for gomp4 branch? Thanks, Julian ChangeLog libgomp/ * env.c (goacc_notify_var): New. (initialize_env): Use above instead of gomp_global_icv.acc_notify_var. * error.c (gomp_vnotify): Use goacc_notify_var. (gomp_notify): Fix formatting. * libgomp.h (gomp_task_icv): Remove acc_notify_var field. (goacc_notify_var): Add extern declaration. commit 5b18c3e134779ee562af11702d2ba2c4baa66370 Author: Julian Brown Date: Tue Oct 28 06:45:41 2014 -0700 acc_notify_var tweaks diff --git a/libgomp/env.c b/libgomp/env.c index 02bce0c..03206dd 100644 --- a/libgomp/env.c +++ b/libgomp/env.c @@ -79,6 +79,7 @@ unsigned long gomp_bind_var_list_len; void **gomp_places_list; unsigned long gomp_places_list_len; +int goacc_notify_var; int goacc_device_num; char* goacc_device_type; @@ -1196,7 +1197,7 @@ initialize_env (void) gomp_global_icv.thread_limit_var = thread_limit_var > INT_MAX ? UINT_MAX : thread_limit_var; } - parse_int ("GCC_ACC_NOTIFY", &gomp_global_icv.acc_notify_var, true); + parse_int ("GCC_ACC_NOTIFY", &goacc_notify_var, true); #ifndef HAVE_SYNC_BUILTINS gomp_mutex_init (&gomp_managed_threads_lock); #endif diff --git a/libgomp/error.c b/libgomp/error.c index 5f400cc..320b4d2 100644 --- a/libgomp/error.c +++ b/libgomp/error.c @@ -76,13 +76,12 @@ gomp_fatal (const char *fmt, ...) void gomp_vnotify (const char *msg, va_list list) { - struct gomp_task_icv *icv = gomp_icv (false); - if (icv->acc_notify_var) + if (goacc_notify_var) vfprintf (stderr, msg, list); } void -gomp_notify(const char *msg, ...) +gomp_notify (const char *msg, ...) { va_list list; diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h index 8b7327d..206b293 100644 --- a/libgomp/libgomp.h +++ b/libgomp/libgomp.h @@ -238,7 +238,6 @@ struct gomp_task_icv bool dyn_var; bool nest_var; char bind_var; - int acc_notify_var; /* Internal ICV. */ struct target_mem_desc *target_data; }; @@ -257,6 +256,7 @@ extern unsigned long gomp_bind_var_list_len; extern void **gomp_places_list; extern unsigned long gomp_places_list_len; +extern int goacc_notify_var; extern int goacc_device_num; extern char* goacc_device_type;