diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2014-04-17 04:22:57 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-04-17 02:22:57 +0000 |
commit | 789c274118d76ab0aab936c51e62a792bab3ab98 (patch) | |
tree | e83569f9f053202fd911a7bd3c28f928d43fec95 /gcc/ipa.c | |
parent | 9950a4f2121966e72c27406d7eeb4dc55b8e2eec (diff) | |
download | gcc-789c274118d76ab0aab936c51e62a792bab3ab98.zip gcc-789c274118d76ab0aab936c51e62a792bab3ab98.tar.gz gcc-789c274118d76ab0aab936c51e62a792bab3ab98.tar.bz2 |
re PR ipa/60854 (inline constructor of extern template)
PR ipa/60854
* ipa.c (symtab_remove_unreachable_nodes): Mark targets of
external aliases alive, too.
* g++.dg/torture/pr60854.C: New testcase.
From-SVN: r209459
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r-- | gcc/ipa.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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); } |