This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ipa/61659] [4.9/4.10 Regression] Extra undefined symbol because of devirtualization
- From: "rafael.espindola at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 01 Jul 2014 12:57:58 +0000
- Subject: [Bug ipa/61659] [4.9/4.10 Regression] Extra undefined symbol because of devirtualization
- Auto-submitted: auto-generated
- References: <bug-61659-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61659
--- Comment #15 from Rafael Avila de Espindola <rafael.espindola at gmail dot com> ---
(In reply to Jason Merrill from comment #14)
> Right. My patch causes us to synthesize ~I so that it's available for
> devirtualization, which we weren't doing before. This is allowed by the C++
> standard: 3.2p3 says "A virtual member function is odr-used if it is not
> pure." so the compiler is free to instantiate/synthesize any virtual
> function.
>
> Avoiding this while still getting the devirtualization benefit would require
> some mechanism for devirtualization to call back into the front end to
> trigger the instantiation/synthesis directly. This might be workable for an
> individual translation unit, but not for LTO.
And make which c++ errors user see dependent on which optimizations they run,
which is not very friendly. I agree your approach is better.
Markus Trippelsdorf:
The include should go where it is used, so in GCMetadata.h.