From: James Norris <jnorris@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Cc: Thomas Schwinge <Thomas_Schwinge@mentor.com>
Subject: [gomp4] Allow parameter declarations with deviceptr
Date: Wed, 01 Jul 2015 21:25:00 -0000 [thread overview]
Message-ID: <55945AB8.40309@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 134 bytes --]
Hi,
This patch allows parameter declarations to be used as
arguments to deviceptr for C and C++.
Committed to gomp-4_0-branch.
Jim
[-- Attachment #2: bugfix.patch --]
[-- Type: text/x-patch, Size: 1060 bytes --]
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)
;
next reply other threads:[~2015-07-01 21:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-01 21:25 James Norris [this message]
2015-07-01 23:33 ` Cesar Philippidis
2015-02-16 18:26 ` [PATCH] Fix PR64748 James Norris
2015-03-10 13:37 ` James Norris
2015-03-10 18:48 ` Jeff Law
2015-03-13 15:24 ` Thomas Schwinge
2015-03-13 15:28 ` Jakub Jelinek
2015-03-13 15:20 ` [PATCH] Fix PR64748: OpenACC: "is not a variable" error with deviceptr() Thomas Schwinge
2015-07-07 14:01 ` [gomp4] Allow parameter declarations with deviceptr Thomas Schwinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55945AB8.40309@codesourcery.com \
--to=jnorris@codesourcery.com \
--cc=Thomas_Schwinge@mentor.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).