From patchwork Thu Sep 21 14:05:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cesar Philippidis X-Patchwork-Id: 816882 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-462706-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="DNVDFppl"; 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 3xydgv0hnDz9s7g for ; Fri, 22 Sep 2017 00:06: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=GyxL6yDjkO7n0/SRt/D+1qk7UtSe5Iddan71RMKjjsIl0bqr9y6Xl CqdR7sY43vOAr4uYLB8oh5skL4QiLutsutIh13hyO01UJPQgsV0lPZfTp3T5CDRo 3LGLICFTryegPJjuuFbpMFKJ1t4SOMLCX8VIQUDfCSIHmQfEYJwc+0= 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=vPmHc1s0aIiqIWCERwTLksLCp7M=; b=DNVDFpplVx9aO4j0m7yL k6f3Bd/JZlj58NUmKtUz9U4SleWB9wAjkQHlUrauwRPuG02G6UuAoMtrinTTmU7X 2GKpTBpacHBuGFGzHQpNdcwyEAk8tA682AZ0kIioqdni2Q2w9To3kxSqymZoMXFF NwUv7x4sV6qpfN735e6IA5E= Received: (qmail 20084 invoked by alias); 21 Sep 2017 14:06:07 -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 19081 invoked by uid 89); 21 Sep 2017 14:06:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 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= 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; Thu, 21 Sep 2017 14:06:04 +0000 Received: from svr-orw-mbx-04.mgc.mentorg.com ([147.34.90.204]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1dv278-0002hn-3F from Cesar_Philippidis@mentor.com ; Thu, 21 Sep 2017 07:06:02 -0700 Received: from [127.0.0.1] (147.34.91.1) by SVR-ORW-MBX-04.mgc.mentorg.com (147.34.90.204) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 21 Sep 2017 07:05:59 -0700 From: Cesar Philippidis Subject: [OpenACC] Don't restrict ACC wait arguments to constants in fortran To: "gcc-patches@gcc.gnu.org" , Fortran List Message-ID: <60414f82-92b1-c2b4-1b6b-347822256771@codesourcery.com> Date: Thu, 21 Sep 2017 07:05:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-07.mgc.mentorg.com (147.34.90.207) To SVR-ORW-MBX-04.mgc.mentorg.com (147.34.90.204) I noticed that gfortran complains when the integer wait queue argument for the acc wait directive is not a constant value. That's an odd restriction, that not even the wait clause enforces. Considering that this patch is one-liner, I've committed this patch to trunk as obvious to remove this restriction. I'll backport this patch to og7 shortly. Cesar 2017-09-21 Cesar Philippidis gcc/fortran/ * openmp.c (gfc_match_oacc_wait): Don't restrict wait directive arguments to constant integers. gcc/testsuite/ * gfortran.dg/goacc/wait.f90: New test. diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 8400354181c..c5e00888bbe 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -2185,8 +2185,7 @@ gfc_match_oacc_wait (void) } if (!gfc_resolve_expr (el->expr) - || el->expr->ts.type != BT_INTEGER || el->expr->rank != 0 - || el->expr->expr_type != EXPR_CONSTANT) + || el->expr->ts.type != BT_INTEGER || el->expr->rank != 0) { gfc_error ("WAIT clause at %L requires a scalar INTEGER expression", &el->expr->where); diff --git a/gcc/testsuite/gfortran.dg/goacc/wait.f90 b/gcc/testsuite/gfortran.dg/goacc/wait.f90 new file mode 100644 index 00000000000..9cdbcdf822e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/wait.f90 @@ -0,0 +1,12 @@ +! Ensure that ACC WAIT accept integer arguments. + +subroutine foo (wqueue) + implicit none + integer :: wqueue, waitno + integer, parameter :: waitp = 100 + + !$acc wait (wqueue) + !$acc wait (waitno) + !$acc wait (waitp) + !$acc wait (0) +end subroutine foo