From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27541 invoked by alias); 1 Jul 2015 21:25:20 -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 27532 invoked by uid 89); 1 Jul 2015 21:25:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_FROM_12LTRDOM autolearn=ham version=3.3.2 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, 01 Jul 2015 21:25:19 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1ZAPVL-00030c-6K from James_Norris@mentor.com for gcc-patches@gcc.gnu.org; Wed, 01 Jul 2015 14:25:15 -0700 Received: from [172.30.80.237] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.3.224.2; Wed, 1 Jul 2015 14:25:14 -0700 Message-ID: <55945AB8.40309@codesourcery.com> Date: Wed, 01 Jul 2015 21:25:00 -0000 From: James Norris User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: CC: Thomas Schwinge Subject: [gomp4] Allow parameter declarations with deviceptr Content-Type: multipart/mixed; boundary="------------040900050107020700000708" X-SW-Source: 2015-07/txt/msg00092.txt.bz2 --------------040900050107020700000708 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 134 Hi, This patch allows parameter declarations to be used as arguments to deviceptr for C and C++. Committed to gomp-4_0-branch. Jim --------------040900050107020700000708 Content-Type: text/x-patch; name="bugfix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bugfix.patch" Content-length: 1060 diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 88e68ae..dc244ce 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -10749,7 +10749,7 @@ c_parser_oacc_data_clause_deviceptr (c_parser *parser, tree list) c_parser_omp_var_list_parens() should construct a list of locations to go along with the var list. */ - if (TREE_CODE (v) != VAR_DECL) + if (TREE_CODE (v) != VAR_DECL && TREE_CODE (v) != PARM_DECL) error_at (loc, "%qD is not a variable", v); else if (TREE_TYPE (v) == error_mark_node) ; diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 41fb35e..c233595 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -28122,7 +28122,7 @@ cp_parser_oacc_data_clause_deviceptr (cp_parser *parser, tree list) c_parser_omp_var_list_parens should construct a list of locations to go along with the var list. */ - if (TREE_CODE (v) != VAR_DECL) + if (TREE_CODE (v) != VAR_DECL && TREE_CODE (v) != PARM_DECL) error_at (loc, "%qD is not a variable", v); else if (TREE_TYPE (v) == error_mark_node) ; --------------040900050107020700000708--