This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR45878
On Wed, 13 Oct 2010, Andrew Pinski wrote:
> On Wed, Oct 13, 2010 at 6:14 PM, Nicola Pero
> <nicola.pero@meta-innovation.com> wrote:
> > Do you know what is the advantage or reason for using OBJ_TYPE_REFs for Objective-C method lookups as opposed to doing them via standard C casts and function calls ?
>
> IIRC the problem is that standard "C casts" (which is undefined
> behavior and will produce a trap if used in normal C) is not used is
> because at -O0, GCC will produce an indirect function call to one step
> function for the next runtime. The advantage is both for the tree
> level reasons of not calling a function via a different type and
> because using a cast will produce a secondary variable due to how
> gimple works.
Right. Of course that's a bad excuse to use OBJ_TYPE_REF ;)
I plan to make the function type in a call expression explicit to
aovid this (ok, heh - we could just allow a NOP_EXPR as gimple_call_fn
...).
Richard.