From 6cbde2e317bb4be42e88000de6b927e55904f0dc Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Wed, 26 Nov 2014 18:10:29 +0000 Subject: re PR ipa/61190 (g++.old-deja/g++.mike/p4736b.C FAILs at -O2/-Os/-O3) 2014-11-26 Bernd Edlinger PR ipa/61190 * cgraph.h (symtab_node::call_for_symbol_and_aliases): Fix comment. (cgraph_node::function_or_virtual_thunk_symbol): New function. (cgraph_node::call_for_symbol_and_aliases): Fix comment. (cgraph_node::call_for_symbol_thunks_and_aliases): Adjust comment. Add new optional parameter exclude_virtual_thunks. * cgraph.c (cgraph_node::call_for_symbol_thunks_and_aliases): Add new optional parameter exclude_virtual_thunks. (cgraph_node::set_const_flag): Don't propagate to virtual thunks. (cgraph_node::set_pure_flag): Likewise. (cgraph_node::function_symbol): Simplified. (cgraph_node::function_or_virtual_thunk_symbol): New function. * ipa-pure-const.c (analyze_function): For virtual thunks set pure_const_state to IPA_NEITHER. (propagate_pure_const): Use function_or_virtual_thunk_symbol. testsuite/ChangeLog: 2014-11-26 Bernd Edlinger PR ipa/61190 * g++.old-deja/g++.mike/p4736b.C: Use -O2. From-SVN: r218091 --- gcc/ipa-pure-const.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gcc/ipa-pure-const.c') diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 9c016c1..13e3a25 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -806,6 +806,8 @@ analyze_function (struct cgraph_node *fn, bool ipa) { /* Thunk gets propagated through, so nothing interesting happens. */ gcc_assert (ipa); + if (fn->thunk.thunk_p && fn->thunk.virtual_offset_p) + l->pure_const_state = IPA_NEITHER; return l; } @@ -1247,7 +1249,8 @@ propagate_pure_const (void) for (e = w->callees; e; e = e->next_callee) { enum availability avail; - struct cgraph_node *y = e->callee->function_symbol (&avail); + struct cgraph_node *y = e->callee-> + function_or_virtual_thunk_symbol (&avail); enum pure_const_state_e edge_state = IPA_CONST; bool edge_looping = false; @@ -1387,7 +1390,8 @@ propagate_pure_const (void) for (e = w->callees; e && !can_free; e = e->next_callee) { enum availability avail; - struct cgraph_node *y = e->callee->function_symbol (&avail); + struct cgraph_node *y = e->callee-> + function_or_virtual_thunk_symbol (&avail); if (avail > AVAIL_INTERPOSABLE) can_free = get_function_state (y)->can_free; @@ -1517,7 +1521,8 @@ propagate_nothrow (void) for (e = w->callees; e && !can_throw; e = e->next_callee) { enum availability avail; - struct cgraph_node *y = e->callee->function_symbol (&avail); + struct cgraph_node *y = e->callee-> + function_or_virtual_thunk_symbol (&avail); if (avail > AVAIL_INTERPOSABLE) { -- cgit v1.1