This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gomp4] acc update bug


The OpenACC update directive would cause an ICE if there was an error
parsing one of its clauses in the c front end. E.g. #pragma acc update
copy(a(1:10)). This patch fixes that. Also, it declare GOACC_update
inside libgomp_g.h

I've committed this patch to gomp-4_0-branch. A test case will be
provided later.

Cesar
2014-10-20  Cesar Philippidis  <cesar@codesourcery.com>

	gcc/c/
	* c-parser.c (c_parser_oacc_update): Don't create a new stmt
	if the pragma is bogus.

	libgomp/
	* (GOACC_update): Declare.


diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 17085bf..d1956b8 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -12071,6 +12071,9 @@ c_parser_oacc_update (c_parser *parser)
       return;
     }
 
+  if (parser->error)
+    return;
+
   tree stmt = make_node (OACC_UPDATE);
   TREE_TYPE (stmt) = void_type_node;
   OACC_UPDATE_CLAUSES (stmt) = clauses;
diff --git a/libgomp/libgomp_g.h b/libgomp/libgomp_g.h
index 44f200c..35b0627 100644
--- a/libgomp/libgomp_g.h
+++ b/libgomp/libgomp_g.h
@@ -225,6 +225,10 @@ extern void GOACC_kernels (int, void (*) (void *), const void *,
 extern void GOACC_parallel (int, void (*) (void *), const void *,
 			    size_t, void **, size_t *, unsigned short *,
 			    int, int, int, int, int, ...);
+extern void GOACC_update (int device, const void *openmp_target, size_t mapnum,
+			  void **hostaddrs, size_t *sizes,
+			  unsigned short *kinds, int async,
+			  int num_waits, ...);
 extern void GOACC_wait (int, int, ...);
 
 #endif /* LIBGOMP_G_H */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]