Set force_output in offload stream if offloadable
---
gcc/lto-cgraph.c | 2 +-
gcc/omp-low.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
@@ -511,7 +511,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
bp_pack_value (&bp, node->local.versionable, 1);
bp_pack_value (&bp, node->local.can_change_signature, 1);
bp_pack_value (&bp, node->local.redefined_extern_inline, 1);
- bp_pack_value (&bp, node->force_output, 1);
+ bp_pack_value (&bp, node->force_output || node->offloadable, 1);
bp_pack_value (&bp, node->forced_by_abi, 1);
bp_pack_value (&bp, node->unique_name, 1);
bp_pack_value (&bp, node->body_removed, 1);
@@ -12770,10 +12770,12 @@ expand_omp_target (struct omp_region *region)
assign_assembler_name_if_neeeded (child_fn);
cgraph_edge::rebuild_edges ();
+#if 0
/* Prevent IPA from removing child_fn as unreachable, since there are no
refs from the parent function to child_fn in offload LTO mode. */
if (ENABLE_OFFLOADING)
cgraph_node::get (child_fn)->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