From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38430 invoked by alias); 8 Apr 2016 09:36:02 -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 38413 invoked by uid 89); 8 Apr 2016 09:36:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy= 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; Fri, 08 Apr 2016 09:35:51 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 8603C85A00; Fri, 8 Apr 2016 09:35:50 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-113-22.phx2.redhat.com [10.3.113.22]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u389Zn75013549 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 8 Apr 2016 05:35:50 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u389ZkWB017422; Fri, 8 Apr 2016 11:35:47 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u389ZjVe017421; Fri, 8 Apr 2016 11:35:45 +0200 Date: Fri, 08 Apr 2016 09:36: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: <20160408093545.GQ19207@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <56F41DB9.5000100@mentor.com> <570390AC.9000402@mentor.com> <20160405154435.GP19207@tucnak.redhat.com> <57077AB2.6000808@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57077AB2.6000808@mentor.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00386.txt.bz2 On Fri, Apr 08, 2016 at 11:32:34AM +0200, Tom de Vries wrote: > Patch updated as attached. > > OK for stage4/stage1 trunk? Ok for stage4, thanks. > Remove incorrect warning for parallel implicit firstprivate clause > > 2016-03-24 Tom de Vries > > * omp-low.c (lower_omp_target): Set TREE_NO_WARNING for oacc > implicit 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 | 7 +++++- > .../goacc/uninit-firstprivate-clause.c | 25 ++++++++++++++++++++++ > .../goacc/uninit-firstprivate-clause.f95 | 18 ++++++++++++++++ > 3 files changed, 49 insertions(+), 1 deletion(-) > > diff --git a/gcc/omp-low.c b/gcc/omp-low.c > index 979926d..7105194 100644 > --- a/gcc/omp-low.c > +++ b/gcc/omp-low.c > @@ -16077,7 +16077,12 @@ 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); > + { > + if (is_gimple_reg (var) > + && OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT (c)) > + TREE_NO_WARNING (var) = 1; > + var = build_fold_addr_expr (var); > + } > else > talign = TYPE_ALIGN_UNIT (TREE_TYPE (TREE_TYPE (ovar))); > gimplify_assign (x, var, &ilist); > diff --git a/gcc/testsuite/c-c++-common/goacc/uninit-firstprivate-clause.c b/gcc/testsuite/c-c++-common/goacc/uninit-firstprivate-clause.c > new file mode 100644 > index 0000000..2584033 > --- /dev/null > +++ b/gcc/testsuite/c-c++-common/goacc/uninit-firstprivate-clause.c > @@ -0,0 +1,25 @@ > +/* { dg-do compile } */ > +/* { dg-additional-options "-Wuninitialized" } */ > + > +void > +foo (void) > +{ > + int i; > + > +#pragma acc parallel > + { > + i = 1; > + } > +} > + > + > +void > +foo2 (void) > +{ > + int i; > + > +#pragma acc parallel firstprivate (i) /* { dg-warning "is used uninitialized in this function" } */ > + { > + i = 1; > + } > +} > diff --git a/gcc/testsuite/gfortran.dg/goacc/uninit-firstprivate-clause.f95 b/gcc/testsuite/gfortran.dg/goacc/uninit-firstprivate-clause.f95 > new file mode 100644 > index 0000000..14d960a > --- /dev/null > +++ b/gcc/testsuite/gfortran.dg/goacc/uninit-firstprivate-clause.f95 > @@ -0,0 +1,18 @@ > +! { dg-do compile } > +! { dg-additional-options "-Wuninitialized" } > + > +subroutine test > + INTEGER :: i > + > + !$acc parallel > + i = 1 > + !$acc end parallel > +end subroutine test > + > +subroutine test2 > + INTEGER :: i > + > + !$acc parallel firstprivate (i) ! { dg-warning "is used uninitialized in this function" } > + i = 1 > + !$acc end parallel > +end subroutine test2 Jakub