+cgraph_node::call_for_symbol_thunks_and_aliases_1 (bool (*callback) + (cgraph_node *, void *), + void *data, + bool include_overwritable, + bool exclude_virtual_thunks)
Instead of adding _1 variant into public API, please just add implicit agrumnet bool exclude_virtual_thunks=false into +cgraph_node::call_for_symbol_thunks_and_aliases Index: gcc/ipa-pure-const.c =================================================================== --- gcc/ipa-pure-const.c (revision 215888) +++ gcc/ipa-pure-const.c (working copy) @@ -744,6 +744,8 @@ analyze_function (struct cgraph_node *fn, bool ipa { /* Thunk gets propagated through, so nothing interesting happens. */ gcc_assert (ipa); + if (fn->thunk.virtual_offset_p) + l->pure_const_state = IPA_NEITHER; return l; } This makes the lattice to be initialized correctly, but you also need the function_symbol calls that will skip thunks replaced by something like function_or_non_virtual_thunk_symbol. Can you, please, send the updated patch? Sorry for late review, Honza Index: gcc/testsuite/g++.old-deja/g++.mike/p4736b.C =================================================================== --- gcc/testsuite/g++.old-deja/g++.mike/p4736b.C (revision 215888) +++ gcc/testsuite/g++.old-deja/g++.mike/p4736b.C (working copy) @@ -1,4 +1,5 @@ // { dg-do run } +// { dg-options "-O2" } // prms-id: 4736 class Rep {