diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-12-08 23:01:41 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-12-08 22:01:41 +0000 |
commit | ced7e9584b848a8d5975b23efb5eac04ee2aee6f (patch) | |
tree | fccadd5a0c819417c9fa8a460d16af2c7d45ea94 /gcc/ipa-visibility.c | |
parent | 54f97f900086fcc62411261205dd61e50f460421 (diff) | |
download | gcc-ced7e9584b848a8d5975b23efb5eac04ee2aee6f.zip gcc-ced7e9584b848a8d5975b23efb5eac04ee2aee6f.tar.gz gcc-ced7e9584b848a8d5975b23efb5eac04ee2aee6f.tar.bz2 |
re PR lto/61886 (LTO breaks fread with _FORTIFY_SOURCE=2)
PR ipa/61886
* ipa-visibility.c (can_replace_by_local_alias): Look through transparent
aliaes; refuse weakrefs.
(update_visibility_by_resolution_info): Skip transparent aliases in the
analysis part
From-SVN: r231428
Diffstat (limited to 'gcc/ipa-visibility.c')
-rw-r--r-- | gcc/ipa-visibility.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ipa-visibility.c b/gcc/ipa-visibility.c index 0423f24..5b03159 100644 --- a/gcc/ipa-visibility.c +++ b/gcc/ipa-visibility.c @@ -332,6 +332,13 @@ varpool_node::externally_visible_p (void) bool can_replace_by_local_alias (symtab_node *node) { + /* Weakrefs have a reason to be non-local. Be sure we do not replace + them. */ + while (node->transparent_alias && node->definition && !node->weakref) + node = node->get_alias_target (); + if (node->weakref) + return false; + return (node->get_availability () > AVAIL_INTERPOSABLE && !decl_binds_to_current_def_p (node->decl) && !node->can_be_discarded_p ()); @@ -392,7 +399,7 @@ update_visibility_by_resolution_info (symtab_node * node) for (symtab_node *next = node->same_comdat_group; next != node; next = next->same_comdat_group) { - if (!next->externally_visible) + if (!next->externally_visible || next->transparent_alias) continue; bool same_def |