Commit 824ca15e by Jan Hubicka Committed by Jan Hubicka

re PR ipa/68148 (Devirtualization only applies to last of multiple successive calls)


	PR ipa/68148
	* ipa-icf.c (sem_function::merge): Virtual functions may become
	reachable even if they address is not taken and there are no
	idrect calls.
	* g++.dg/ipa/devirt-49.C: New testcase.

From-SVN: r232410
parent 155768d6
2016-01-15 Jan Hubicka <hubicka@ucw.cz> 2016-01-15 Jan Hubicka <hubicka@ucw.cz>
PR ipa/68148
* ipa-icf.c (sem_function::merge): Virtual functions may become
reachable even if they address is not taken and there are no
idrect calls.
2016-01-15 Jan Hubicka <hubicka@ucw.cz>
* lto-streamer-out.c (subtract_estimated_size): New function. * lto-streamer-out.c (subtract_estimated_size): New function.
(get_symbol_initial_value): Use it. (get_symbol_initial_value): Use it.
......
...@@ -1305,6 +1305,7 @@ sem_function::merge (sem_item *alias_item) ...@@ -1305,6 +1305,7 @@ sem_function::merge (sem_item *alias_item)
/* If all callers was redirected, do not produce wrapper. */ /* If all callers was redirected, do not produce wrapper. */
if (alias->can_remove_if_no_direct_calls_p () if (alias->can_remove_if_no_direct_calls_p ()
&& !DECL_VIRTUAL_P (alias->decl)
&& !alias->has_aliases_p ()) && !alias->has_aliases_p ())
{ {
create_wrapper = false; create_wrapper = false;
......
2016-01-15 Jan Hubicka <hubicka@ucw.cz>
PR ipa/68148
* g++.dg/ipa/devirt-49.C: New testcase.
2016-01-15 Christian Bruel <christian.bruel@st.com> 2016-01-15 Christian Bruel <christian.bruel@st.com>
PR target/65837 PR target/65837
......
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-devirt" } */
struct Interface {
virtual ~Interface() {}
virtual void virtualFunc() = 0;
virtual void virtualFunc2() = 0;
};
struct Concrete : Interface {
int counter_;
Concrete() : counter_(0) {}
void virtualFunc() { counter_++; }
void virtualFunc2() { counter_++; }
};
void test(Interface &c) {
c.virtualFunc();
c.virtualFunc2();
}
/* { dg-final { scan-ipa-dump "2 speculatively devirtualized" "devirt" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment