https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62071
--- Comment #7 from Jason Merrill <jason at redhat dot com> --- On 08/14/2014 07:13 PM, Jan Hubicka wrote: >> On 08/14/2014 02:10 PM, Jan Hubicka wrote: >>> I wonder what we should do with both external and comdat here. Jason, can >>> we devirtualize? >> >> No, we're setting comdat now to avoid devirtualization, because we >> can't be confident that we'll be able to refer to the definition >> where it gets emitted. > > We had issues where function body was not produced because it is not reachable > by the frontend's definition and it would be comdat otherwise. The case of > inline function whose out of line body is keyed to another unit seems bit > different... It doesn't seem that different to me. In both cases we don't have a local definition to refer to. >>> The constructor is keyed to other compilation unit here, but we are >>> provided with a body >>> that we will never use (modulo the tree-ssa-pre bug that brings the >>> reference into code). >> >> Hmm, we might consider overriding DECL_EXTERNAL so that there's a >> definition available for devirtualization. > > I can always implement logic to use it only when it is inlined, but that will > probably drag > in references to other symbols belonging to the class... I'm not too concerned about that; users should expect an inline function to be inlined. Jason