https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85078
--- Comment #8 from rguenther at suse dot de <rguenther at suse dot de> --- On Sun, 8 Apr 2018, hubicka at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85078 > > --- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> --- > The problem is that we build type inheritance graph earlier and at that time > there are still virtual functions in the callgraph that are optimized out > before free-lang-data. Their types however remain in ODR hash and thus are > considered by devirtualization. I guess easiest fix is to simply rebuild ODR > hash. We could also walk it and free lang data on them, but I think that > would > be just wasted effort. Note the testcase shows we perform devirtualization after free-lang-data using the "stale" data. So walking the ODR hash looks like the simplest fix here?