https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62051
--- Comment #7 from Jan Hubicka <hubicka at ucw dot cz> --- > > Yes, though I think for such a class we probably want to consider all virtual > methods unreachable unless they have explicit default visibility; in the > testcase the main program isn't being compiled with -fvisibility=hidden, so > ~Derived has implicit default visibility. Yes, I think this makes sense. Do you think you can implement the C++ FE part that will mark classes having methods with visibility specified? We do not LTO stream TYPE_METHODS so this is bit hard to determine at gimple-fold time. At some point I tried to enable TYPE_METHODS streaming but it had bad effect on firefox LTO linktimes by significantly increasing strongly connected component size.