[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFC: Support non-standard extension (call via casted function pointer)



On 27.01.2016 16:40, Thorsten Otto wrote:
> > We are trying to support ... a direct call to a function with a
> (wrong) prototype via a function
> > pointer cast to the correct type and having a matching implementation of
> > that function elsewhere.
>
> Yes, i did understand that. But you are trying to do that by hacking
> gcc's m68k backend. I still think that's the wrong place to fix.
The non-support of "direct call to a function with a (wrong) prototype
via a function pointer cast" on m68k is not caused by a general issue in
gcc (gcc tracks the return type of the function pointer used to call the
function), but because of a pecularity of the m68k backend (the backend
ignores the return type of the function pointer in certain
circumstances). I don't see how this can be catered for outside of the
backend.

The effect of the patch I posted is reducing the effect of the "return
pointer in both a0 and d0" hack, which interferes with the usual
decision of the return value register. We do agree that the way the
patch achieves this result is ugly and a better way has been proposed.

Regards,
  Michael Karcher


Reply to: