In openacc there are situations where a user may fail to mark a variable
or function as offloadable (either using declare or routine). This patch
makes the lto wrapper reduce the missing decl assertion to an error.

I've applied this patch to gomp-4_0-branch.

Cesar
2016-01-08  Cesar Philippidis  <ce...@codesourcery.com>

	gcc/
	* lto-cgraph.c (input_varpool_node): Reduce the assert for
	missing variables to an error.


diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index c318aa4..eadf128 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -1422,9 +1422,11 @@ input_varpool_node (struct lto_file_decl_data *file_data,
     node->set_section_for_node (section);
   node->resolution = streamer_read_enum (ib, ld_plugin_symbol_resolution,
 					        LDPR_NUM_KNOWN);
-  gcc_assert (flag_ltrans
-	      || (!node->in_other_partition
-		  && !node->used_from_other_partition));
+
+  int success = flag_ltrans || (!node->in_other_partition
+				&& !node->used_from_other_partition);
+  if (!success)
+    error ("Missing %<%s%>", node->name ());
 
   return node;
 }

Reply via email to