This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfc] METHOD_REF tree node; devirtualizing calls


Richard Henderson wrote:

The following passes bootstrap, but I don't know how much that really
means it helps. We are in fact able to devirtualize


// { dg-do compile }
// { dg-options "-O" }
// { dg-final { scan-assembler "xyzzy" } }
struct S { S(); virtual void xyzzy(); };
inline void foo(S *s) { s->xyzzy(); }
void bar() { S s; foo(&s); }


which is certainly more than we could do before.

For Objective-C, -fnext-runtime, we no longer make an indirect call
when not optimizing (we never did when optimizing, afaik), which I
suppose is what Zem was complaining about.

Can anyone think of anything they'd like to see METHOD_REF handle
which it doesn't now?

This looks reasonable to me, from the point of view of C++.

--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]