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: Mon, 30 Jun 2014 15:26:13 +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 #4 from Rafael Avila de Espindola <rafael.espindola at gmail dot com> ---
I ran the testcase with just -O2 (original code with -O3, but the reduced
testcase with -O2).
getOption will be part of the vtable, but it can end up being hidden.
In the original source code it ends up being hidden because of
-fvisibility-inlines-hidden (I think, haven't checked).
It also seems invalid to produce the extra undefined at a more fundamental
level. The ABI doesn't say that symbol has to be exposed. In particular, the
vtable can be in another DSO and it is legal to remeve the symbol of getOption
from the dso since the compiler knows that any user can emit a copy.
The above optimization is why PREVAILING_DEF_IRONLY_EXP was added to the gold
plugin api and both gcc and llvm LTO's optimizations do it.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808 for a related
discussion.