This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gomp4] teach the lto driver to error for missing decls
- From: Cesar Philippidis <cesar at codesourcery dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 8 Jan 2016 14:37:31 -0800
- Subject: [gomp4] teach the lto driver to error for missing decls
- Authentication-results: sourceware.org; auth=none
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 <cesar@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;
}