diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-17 02:22:57 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-17 02:22:57 +0000 |
commit | 89ae81e0c119ac4365d3cd947c8f3da976acf1e4 (patch) | |
tree | e83569f9f053202fd911a7bd3c28f928d43fec95 /gcc | |
parent | e4b851a3643e241d70d9ce239b72963a700895a6 (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ipa.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr60854.C | 13 |
4 files changed, 36 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ef1da88cc74..5cff60ebc36 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-04-16 Jan Hubicka <hubicka@ucw.cz> + + PR ipa/60854 + * ipa.c (symtab_remove_unreachable_nodes): Mark targets of + external aliases alive, too. + 2014-04-16 Andrew Pinski <apinski@cavium.com> * config/host-linux.c (TRY_EMPTY_VM_SPACE): Change aarch64 ilp32 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); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8b83cd425dd..de911fd4f40 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-04-16 Jan Hubicka <hubicka@ucw.cz> + + PR ipa/60854 + * g++.dg/torture/pr60854.C: New testcase. + 2014-04-16 Catherine Moore <clm@codesourcery.com> * gcc.target/mips/umips-store16-2.c: New test. diff --git a/gcc/testsuite/g++.dg/torture/pr60854.C b/gcc/testsuite/g++.dg/torture/pr60854.C new file mode 100644 index 00000000000..fa4b2e71ab7 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr60854.C @@ -0,0 +1,13 @@ +template <typename T> +class MyClass +{ +public: + __attribute__ ((__always_inline__)) inline MyClass () { ; } +}; + +extern template class MyClass<double>; + +void Func() +{ + MyClass<double> x; +} |