This is the mail archive of the 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

Alan Modra wrote:
> On Thu, Mar 25, 2004 at 12:00:32AM +0100, Ulrich Weigand wrote:
> > unfortunately my patch to fix PR 14262 broke Darwin, as pointed out
> > by Andreas Tobler (in the PR record).
> I suspect that libffi for darwin ought to use the stack copy..
> > happens on Darwin, where 3-byte structs are supposed to be passed
> > left-aligned on the stack *and* left-aligned in a register, and
> > the callee reads them left-aligned from the stack.
> ..because this seems a little weird.  I don't think the function call
> machinery in gcc is intended to support args passed both in regs and
> on the stack, at least not without using PARALLELs to describe the
> reg and stack copies separately.  See the struct arg_data.pass_on_stack
> comment.

Well, passing the same argument in two places seems rather weird to me
in the first place :-/

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?

> > PS: Alan, I'm not sure what to do if BLOCK_REG_PADDING is defined.
> > Should this also be applied for arguments passed both in registers
> > and on the stack?  It doesn't matter for Darwin right now, which
> > doesn't currently define BLOCK_REG_PADDING ...
> locate.where_pad will be "none" when pass_on_stack is true, so adding
> !args[i].pass_on_stack won't do anything.

OK, so that's fine, thanks.


  Dr. Ulrich Weigand

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