diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9af921975a3..4826bcba838 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-02-09 Jan Hubicka + + PR ipa/70795 + * cgraphunit.c (cgraph_node::add_new_function): Set externally_visible + flag if needed. + 2017-02-09 Jan Hubicka * tree-ssa-loop-unswitch.c (hoist_guard): Update profile. diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index cc49c798515..c82a88a599c 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -541,6 +541,8 @@ cgraph_node::add_new_function (tree fndecl, bool lowered) node->local.local = false; node->definition = true; node->force_output = true; + if (TREE_PUBLIC (fndecl)) + node->externally_visible = true; if (!lowered && symtab->state == EXPANSION) { push_cfun (DECL_STRUCT_FUNCTION (fndecl));