diff mbox

[gomp4] Remove unnecessary attribute.

Message ID 5697CD29.1030808@codesourcery.com
State New
Headers show

Commit Message

James Norris Jan. 14, 2016, 4:30 p.m. UTC
Hi,

This patch removes an attribute which was not required
and replaces the previous checks with an alternative
function call.

Regtested with x86_64 and committed to gomp4.

Jim
diff mbox

Patch

Index: gcc/c/ChangeLog.gomp
===================================================================
--- gcc/c/ChangeLog.gomp	(revision 232371)
+++ gcc/c/ChangeLog.gomp	(revision 232372)
@@ -1,3 +1,8 @@ 
+2016-01-14  James Norris  <jnorris@codesourcery.com>
+
+	* c-parser.c (c_finish_oacc_routine): Remove attribute.
+	* c-typeck.c (build_external_ref): Change usage check.
+
 2016-01-07  James Norris  <jnorris@codesourcery.com>
 
 	* c-parser.c (c_finish_oacc_routine): Add new attribute.
Index: gcc/c/c-parser.c
===================================================================
--- gcc/c/c-parser.c	(revision 232371)
+++ gcc/c/c-parser.c	(revision 232372)
@@ -14187,10 +14187,6 @@ 
   /* Also add an "omp declare target" attribute, with clauses.  */
   DECL_ATTRIBUTES (fndecl) = tree_cons (get_identifier ("omp declare target"),
 					clauses, DECL_ATTRIBUTES (fndecl));
-
-  DECL_ATTRIBUTES (fndecl)
-    = tree_cons (get_identifier ("oacc routine"),
-		 clauses, DECL_ATTRIBUTES (fndecl));
 }
 
 /* OpenACC 2.0:
Index: gcc/c/c-typeck.c
===================================================================
--- gcc/c/c-typeck.c	(revision 232371)
+++ gcc/c/c-typeck.c	(revision 232372)
@@ -2682,9 +2682,9 @@ 
       && current_function_decl
       && TREE_CODE (decl) == VAR_DECL
       && is_global_var (decl)
-      && lookup_attribute ("oacc routine",
-			   DECL_ATTRIBUTES (current_function_decl)))
+      && get_oacc_fn_attrib (current_function_decl))
     {
+      /* Validate data type for use with routine directive.  */
       if (lookup_attribute ("omp declare target link",
 			    DECL_ATTRIBUTES (decl))
 	  || ((!lookup_attribute ("omp declare target",
Index: gcc/cp/ChangeLog.gomp
===================================================================
--- gcc/cp/ChangeLog.gomp	(revision 232371)
+++ gcc/cp/ChangeLog.gomp	(revision 232372)
@@ -1,3 +1,8 @@ 
+2016-01-14  James Norris  <jnorris@codesourcery.com>
+
+	* parser.c (cp_finalize_oacc_routine): Remove attribute.
+	* semantics.c (finish_id_expression): Change usage check.
+
 2016-01-07  James Norris  <jnorris@codesourcery.com>
 
 	* parser.c (cp_finalize_oacc_routine): Add new attribute.
Index: gcc/cp/semantics.c
===================================================================
--- gcc/cp/semantics.c	(revision 232371)
+++ gcc/cp/semantics.c	(revision 232372)
@@ -3717,9 +3717,9 @@ 
 	  && current_function_decl
 	  && TREE_CODE (decl) == VAR_DECL
 	  && is_global_var (decl)
-	  && lookup_attribute ("oacc routine",
-			       DECL_ATTRIBUTES (current_function_decl)))
+          && get_oacc_fn_attrib (current_function_decl))
 	{
+	  /* Validate data type for use with routine directive.  */
 	  if (lookup_attribute ("omp declare target link",
 				DECL_ATTRIBUTES (decl))
 	      || ((!lookup_attribute ("omp declare target",
Index: gcc/cp/parser.c
===================================================================
--- gcc/cp/parser.c	(revision 232371)
+++ gcc/cp/parser.c	(revision 232372)
@@ -36799,10 +36799,6 @@ 
       DECL_ATTRIBUTES (fndecl)
 	= tree_cons (get_identifier ("omp declare target"),
 		     clauses, DECL_ATTRIBUTES (fndecl));
-
-      DECL_ATTRIBUTES (fndecl)
-	= tree_cons (get_identifier ("oacc routine"),
-		     NULL_TREE, DECL_ATTRIBUTES (fndecl));
     }
 }