From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121014 invoked by alias); 5 Apr 2016 15:44:53 -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 119007 invoked by uid 89); 5 Apr 2016 15:44:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:uninit-, omp_context, sk:uninit, *gsi_p 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; Tue, 05 Apr 2016 15:44:42 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4665E804E7; Tue, 5 Apr 2016 15:44:41 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-113-22.phx2.redhat.com [10.3.113.22]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u35FidU6004999 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 Apr 2016 11:44:40 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u35Fibxb007017; Tue, 5 Apr 2016 17:44:38 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u35FiZR5005514; Tue, 5 Apr 2016 17:44:35 +0200 Date: Tue, 05 Apr 2016 15:44:00 -0000 From: Jakub Jelinek To: Tom de Vries Cc: GCC Patches Subject: Re: [PING][PATCH] Remove incorrect warning for parallel firstprivate clause Message-ID: <20160405154435.GP19207@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <56F41DB9.5000100@mentor.com> <570390AC.9000402@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <570390AC.9000402@mentor.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00243.txt.bz2 On Tue, Apr 05, 2016 at 12:17:16PM +0200, Tom de Vries wrote: > On 24/03/16 18:02, Tom de Vries wrote: > >Remove incorrect warning for parallel firstprivate clause > > > >2016-03-24 Tom de Vries > > > > * omp-low.c (lower_omp_target): Set TREE_NO_WARNING for oacc > > firstprivate clause. > > > > * c-c++-common/goacc/uninit-firstprivate-clause.c: New test. > > * gfortran.dg/goacc/uninit-firstprivate-clause.f95: New test. > > > >--- > > gcc/omp-low.c | 5 ++++- > > .../goacc/uninit-firstprivate-clause.c | 25 ++++++++++++++++++++++ > > .../goacc/uninit-firstprivate-clause.f95 | 18 ++++++++++++++++ > > 3 files changed, 47 insertions(+), 1 deletion(-) > > > >diff --git a/gcc/omp-low.c b/gcc/omp-low.c > >index d107961..41eb3c8 100644 > >--- a/gcc/omp-low.c > >+++ b/gcc/omp-low.c > >@@ -16068,7 +16068,10 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) > > { > > gcc_assert (is_gimple_omp_oacc (ctx->stmt)); > > if (!is_reference (var)) > >- var = build_fold_addr_expr (var); > >+ { > >+ TREE_NO_WARNING (var) = 1; > >+ var = build_fold_addr_expr (var); > >+ } IMHO it should be done only if var is is_gimple_reg (var), otherwise all that happens on the caller side is that you take the address of the actual variable. Also, I think it would be better to do this only for implicit firstprivate (and map) clauses, if somebody uses explicit firstprivate on a var, I think it is better to warn if the var is uninitialized, the user can then use private clause instead. BTW, some undesirable warnings are also on OpenMP code (I'm adding TREE_NO_WARNING already in case of shared clause), I've filed PR70550 to track this and will attach there a patch soon. Jakub