From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118620 invoked by alias); 25 Jul 2018 15:32:14 -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 117677 invoked by uid 89); 25 Jul 2018 15:32:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Jul 2018 15:32:12 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D4DD77D84D; Wed, 25 Jul 2018 15:32:10 +0000 (UTC) Received: from redhat.com (ovpn-123-206.rdu2.redhat.com [10.10.123.206]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 854561102E1F; Wed, 25 Jul 2018 15:32:10 +0000 (UTC) Date: Wed, 25 Jul 2018 15:32:00 -0000 From: Marek Polacek To: Cesar Philippidis Cc: gcc-patches@gcc.gnu.org, jakub@redhat.com Subject: Re: [PATCH 1/3] Correct the reported line number in fortran combined OpenACC directives Message-ID: <20180725153208.GA3030@redhat.com> References: <9787e49d3bb2bc96b16584590090e33b2f4dcce8.1532531520.git.cesar@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9787e49d3bb2bc96b16584590090e33b2f4dcce8.1532531520.git.cesar@codesourcery.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-SW-Source: 2018-07/txt/msg01553.txt.bz2 On Wed, Jul 25, 2018 at 08:29:17AM -0700, Cesar Philippidis wrote: > The fortran FE incorrectly records the line locations of combined acc > loop directives when it lowers the construct to gimple. Usually this > isn't a problem because the fortran FE is able to report problems with > acc loops itself. However, there will be inaccuracies if the ME tries > to use those locations. > > Note that test cases are inconspicuously absent in this patch. > However, without this bug fix, -fopt-info-note-omp will report bogus > line numbers. This code patch will be tested in a later patch in > this series. > > Is this OK for trunk? I bootstrapped and regtested it on x86_64 with > nvptx offloading. > > Thanks, > Cesar > > 2018-XX-YY Cesar Philippidis > > gcc/fortran/ > * trans-openmp.c (gfc_trans_oacc_combined_directive): Set the > location of combined acc loops. > > (cherry picked from gomp-4_0-branch r245653) > > diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c > index f038f4c..e7707d0 100644 > --- a/gcc/fortran/trans-openmp.c > +++ b/gcc/fortran/trans-openmp.c > @@ -3869,6 +3869,7 @@ gfc_trans_oacc_combined_directive (gfc_code *code) > gfc_omp_clauses construct_clauses, loop_clauses; > tree stmt, oacc_clauses = NULL_TREE; > enum tree_code construct_code; > + location_t loc = input_location; > > switch (code->op) > { > @@ -3930,12 +3931,16 @@ gfc_trans_oacc_combined_directive (gfc_code *code) > else > pushlevel (); > stmt = gfc_trans_omp_do (code, EXEC_OACC_LOOP, pblock, &loop_clauses, NULL); > + > + if (CAN_HAVE_LOCATION_P (stmt)) > + SET_EXPR_LOCATION (stmt, loc); This is protected_set_expr_location. Marek