+2014-11-19 Ilya Verbin <ilya.verbin@intel.com>
+
+ PR regression/63868
+ * cgraph.c (cgraph_node::create): Guard g->have_offload with
+ ifdef ENABLE_OFFLOADING.
+ * omp-low.c (create_omp_child_function): Likewise.
+ (expand_omp_target): Guard node->mark_force_output and offload_funcs
+ with ifdef ENABLE_OFFLOADING.
+ * varpool.c (varpool_node::get_create): Guard g->have_offload and
+ offload_vars with ifdef ENABLE_OFFLOADING.
+
2014-11-19 Felix Yang <felix.yang@huawei.com>
Shanyao Chen <chenshanyao@huawei.com>
if (is_targetreg_ctx (octx))
{
cgraph_node::get_create (decl)->offloadable = 1;
+#ifdef ENABLE_OFFLOADING
g->have_offload = true;
+#endif
break;
}
}
if (kind == GF_OMP_TARGET_KIND_REGION)
{
unsigned srcidx, dstidx, num;
- struct cgraph_node *node;
/* If the target region needs data sent from the parent
function, then the very first statement (except possible
DECL_STRUCT_FUNCTION (child_fn)->curr_properties = cfun->curr_properties;
cgraph_node::add_new_function (child_fn, true);
+#ifdef ENABLE_OFFLOADING
/* Add the new function to the offload table. */
vec_safe_push (offload_funcs, child_fn);
+#endif
/* Fix the callgraph edges for child_cfun. Those for cfun will be
fixed in a following pass. */
push_cfun (child_cfun);
cgraph_edge::rebuild_edges ();
+#ifdef ENABLE_OFFLOADING
/* Prevent IPA from removing child_fn as unreachable, since there are no
refs from the parent function to child_fn in offload LTO mode. */
- node = cgraph_node::get (child_fn);
+ struct cgraph_node *node = cgraph_node::get (child_fn);
node->mark_force_output ();
+#endif
/* Some EH regions might become dead, see PR34608. If
pass_cleanup_cfg isn't the first pass to happen with the
varpool_node::finalize_decl (vars_decl);
varpool_node::finalize_decl (funcs_decl);
- }
+ }
else
{
for (unsigned i = 0; i < num_funcs; i++)