public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [gomp4] Allow parameter declarations with deviceptr
@ 2015-07-01 21:25 James Norris
  2015-07-01 23:33 ` Cesar Philippidis
  0 siblings, 1 reply; 9+ messages in thread
From: James Norris @ 2015-07-01 21:25 UTC (permalink / raw)
  To: gcc-patches; +Cc: Thomas Schwinge

[-- 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)
 	;

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-07-07 14:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-01 21:25 [gomp4] Allow parameter declarations with deviceptr James Norris
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

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).