Hi Jan,

> these two PRs are about C++ destructors that are not virtual but have
> virtual alias. The devirtualization machinery walks from alias to symbol
> and is then confused by not knowing the class symbol belongs to.
>
> I think it would make more sense to avoid these walks but that require
> more of surgery, so for GCC9 I think it is best to stop freeing contexts
> for desctructors. This does not save any stremaing because THIS pointer
> of the destructor has the same type.
>
> Bootstrapped/regtested x86_64-linux, OK?
>
> Honza
>
>       PR lto/87809
>       PR lto/89335
>       * tree.c (free_lang_data_in_decl): Do not free context of C++
>       destrutors.
>
>       * g++.dg/lto/pr87089_0.C: New testcase.
>       * g++.dg/lto/pr87089_1.C: New testcase.
>       * g++.dg/lto/pr89335_0.C: New testcase.

this test FAILs on Solaris with the native ld:

FAIL: g++.dg/lto/pr89335 cp_lto_pr89335_0.o assemble, -O2 -flto 
-Wsuggest-final-methods

/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/lto/pr89335_0.C:9:7: warning: 
Declaring virtual destructor of 'struct List' final would enable 
devirtualization of 1 call [-Wsuggest-final-methods]

The same failure can be seen on Linux/x86_64 with -fno-use-linker-plugin.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to