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: [PATCH] Fix PR 14262 breakage on Darwin


On Thu, 2004-03-25 at 08:36, Ulrich Weigand wrote:
> Well, passing the same argument in two places seems rather weird to me
> in the first place :-/

This is not uncommon.  One use for this is to make code that is missing
prototypes work.  Suppose an FP arg goes in FP regs in a normal function
and in an INT reg in a varargs function.  What happens if a prototype is
missing?  Either the ABI says such code can not work, or you pass it in
both places so it will work regardless of the type of function you are
calling.

In this case, however, the problem seems to be a bug in the darwin
support.  It is using the default MUST_PASS_IN_STACK value which puts
BLKmode values on the stack, but function_args returns a register for
them.  This is wrong.  It should be one or the other.  And if we need
both, then we should return a PARALLEL.  It looks like maybe the 32-bit
linux support has the same problem.  I haven't done a build yet to
confirm this.  I can't really fault the rs6000 port for getting this
wrong though.  The calling convention code is too obtuse.

> Anyway, would you agree that gcc should keep its old behaviour in this
> case (as implemented by my patch)?  Or do say that this is just a
> libffi bug?

I think Apple cares deeply about maintaining ABI compatibility across
releases.  So it is probably not safe to change the ABI.  We could
perhaps fix this by modifying the rs6000 backend to return a PARALLEL in
this case, and then document it as compatibility for a historical
error.  This is probably better than hacking up the calls.c code if it
works.

If we can't make that work, then we have to go with the calls.c patch. 
This patch desperately needs comments explaining why this weirdness is
needed though.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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