mirror of git://gcc.gnu.org/git/gcc.git
re PR tree-optimization/64330 (IPA-ICF merges const exported vars that could be addressable in other TUs)
Fix for PR64330. PR tree-optimization/64330 * ipa-icf.c (sem_variable::parse): Add checking for externally visible symbols and do not introduce an alias for an external declaration. From-SVN: r218864
This commit is contained in:
parent
2ddeb89bf5
commit
09cb9532c4
|
|
@ -1,3 +1,10 @@
|
||||||
|
2014-12-18 Martin Liska <mliska@suse.cz>
|
||||||
|
|
||||||
|
PR tree-optimization/64330
|
||||||
|
* ipa-icf.c (sem_variable::parse): Add checking
|
||||||
|
for externally visible symbols and do not introduce
|
||||||
|
an alias for an external declaration.
|
||||||
|
|
||||||
2014-12-18 Jan Hubicka <hubicka@ucw.cz>
|
2014-12-18 Jan Hubicka <hubicka@ucw.cz>
|
||||||
|
|
||||||
PR bootstrap/63573
|
PR bootstrap/63573
|
||||||
|
|
|
||||||
|
|
@ -1139,10 +1139,14 @@ sem_variable::parse (varpool_node *node, bitmap_obstack *stack)
|
||||||
tree decl = node->decl;
|
tree decl = node->decl;
|
||||||
|
|
||||||
bool readonly = TYPE_P (decl) ? TYPE_READONLY (decl) : TREE_READONLY (decl);
|
bool readonly = TYPE_P (decl) ? TYPE_READONLY (decl) : TREE_READONLY (decl);
|
||||||
bool can_handle = readonly && (DECL_VIRTUAL_P (decl)
|
if (!readonly)
|
||||||
|| !TREE_ADDRESSABLE (decl));
|
return NULL;
|
||||||
|
|
||||||
if (!can_handle)
|
bool can_handle = DECL_VIRTUAL_P (decl)
|
||||||
|
|| flag_merge_constants >= 2
|
||||||
|
|| (!TREE_ADDRESSABLE (decl) && !node->externally_visible);
|
||||||
|
|
||||||
|
if (!can_handle || DECL_EXTERNAL (decl))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
tree ctor = ctor_for_folding (decl);
|
tree ctor = ctor_for_folding (decl);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue