From patchwork Wed Jun 13 13:55:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cesar Philippidis X-Patchwork-Id: 928893 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-479634-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="LrxtZcnD"; dkim-atps=neutral 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 415Stt3W20z9s2g for ; Wed, 13 Jun 2018 23:55:18 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:message-id:date:mime-version:content-type; q=dns; s= default; b=gFeD4XfwOcx9Hn0aYi9x2RbwPnJA2IzSdTx3HChzlhEwfPY9q6h3o Z5+2pOnggcQbr2L3FffiY+hVdYkyazTpt0+8V/vdk8ZckwHdVoWBbE1LqA5yK6kW /54dwZcgMCNzX2Ihm/Caa3pNGjf2JFFRXsrUiDPIADazlYouoSEyfA= 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:from :subject:to:message-id:date:mime-version:content-type; s= default; bh=9ZeiCYwOxCIJzK6v1tvkwoY7k70=; b=LrxtZcnD+RCA7q6NwuTs yGKzDYHmtcWNJeif7AF8lgm1sjhHSWSS4vQBnc9EV76i2iStrARy2HmOE9Yy8cK0 N3R9Yz+PrFEuGIB8quIKJMrbH+ryPdSwES8vnFRkOGliqM+1Aije1D16lczPthpZ gc536hMFKZXqdQdkJiuGHHQ= Received: (qmail 13332 invoked by alias); 13 Jun 2018 13:55:10 -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 13307 invoked by uid 89); 13 Jun 2018 13:55:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=H*r:0700 X-Spam-User: qpsmtpd, 2 recipients 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; Wed, 13 Jun 2018 13:55:08 +0000 Received: from svr-orw-mbx-01.mgc.mentorg.com ([147.34.90.201]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1fT6Es-00078G-Nj from Cesar_Philippidis@mentor.com ; Wed, 13 Jun 2018 06:55:06 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 13 Jun 2018 06:55:04 -0700 From: Cesar Philippidis Subject: [PATCH] update error reporting for OpenACC wait (PR85702) To: "gcc-patches@gcc.gnu.org" , Fortran List Message-ID: <77fde9dd-f203-9b7d-18be-5fc2b04579aa@codesourcery.com> Date: Wed, 13 Jun 2018 06:55:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-07.mgc.mentorg.com (147.34.90.207) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) Prior to this patch, when the Fortran FE detected an invalid argument to the OpenACC wait directive, it was trying to read the location of the expression after it checked does not exist to error diagnostics. This patch resolves that issue by reporting the error using %C. I'll commit this patch to trunk as obvious. Cesar 2018-06-13 Cesar Philippidis PR fortran/85702 gcc/fortran/ * openmp.c (gfc_match_oacc_wait): Use %C to report error location. gcc/testsuite/ * gfortran.dg/goacc/pr85702.f90: New test. From 07022efa1ba4a58fa12c3f8a3b911fba32a5df1b Mon Sep 17 00:00:00 2001 From: Cesar Philippidis Date: Mon, 11 Jun 2018 14:03:47 -0700 Subject: [PATCH] fix PR85702 --- gcc/fortran/openmp.c | 3 +-- gcc/testsuite/gfortran.dg/goacc/pr85702.f90 | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/goacc/pr85702.f90 diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 5c13312..97d6e78 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -2177,8 +2177,7 @@ gfc_match_oacc_wait (void) { if (el->expr == NULL) { - gfc_error ("Invalid argument to !$ACC WAIT at %L", - &wait_list->expr->where); + gfc_error ("Invalid argument to !$ACC WAIT at %C"); return MATCH_ERROR; } diff --git a/gcc/testsuite/gfortran.dg/goacc/pr85702.f90 b/gcc/testsuite/gfortran.dg/goacc/pr85702.f90 new file mode 100644 index 0000000..7488618 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/pr85702.f90 @@ -0,0 +1,6 @@ +! PR fortran/85702 +! { dg-do compile } + +subroutine s + !$acc wait(*) ! { dg-error "Invalid argument to ..ACC WAIT" } +end -- 2.7.4