Message ID | 56903A2B.9060906@codesourcery.com |
---|---|
State | New |
Headers | show |
On 01/08/2016 11:37 PM, Cesar Philippidis wrote: > 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. Hmm, it might be good to have a testcase? Bernd
On 01/11/2016 07:34 AM, Bernd Schmidt wrote: > On 01/08/2016 11:37 PM, Cesar Philippidis wrote: >> 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. > > Hmm, it might be good to have a testcase? I'm not sure how to test it though. The only reproduce this problem using an offloaded compiler. Maybe I could add a libgomp test and expect it to fail. 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; }