summaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-17 02:22:57 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-17 02:22:57 +0000
commit89ae81e0c119ac4365d3cd947c8f3da976acf1e4 (patch)
treee83569f9f053202fd911a7bd3c28f928d43fec95 /gcc/ipa.c
parente4b851a3643e241d70d9ce239b72963a700895a6 (diff)
downloadgcc-89ae81e0c119ac4365d3cd947c8f3da976acf1e4.tar.gz
PR ipa/60854
* ipa.c (symtab_remove_unreachable_nodes): Mark targets of external aliases alive, too. * g++.dg/torture/pr60854.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209459 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 26e9b03b9bd..3d82a39286c 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -415,7 +415,18 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
|| !DECL_EXTERNAL (e->callee->decl)
|| e->callee->alias
|| before_inlining_p))
- pointer_set_insert (reachable, e->callee);
+ {
+ /* Be sure that we will not optimize out alias target
+ body. */
+ if (DECL_EXTERNAL (e->callee->decl)
+ && e->callee->alias
+ && before_inlining_p)
+ {
+ pointer_set_insert (reachable,
+ cgraph_function_node (e->callee));
+ }
+ pointer_set_insert (reachable, e->callee);
+ }
enqueue_node (e->callee, &first, reachable);
}