This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi 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 08/16] aarch64: Tidy up abi manipulation


On Okt 28 2014, Richard Henderson <rth@twiddle.net> wrote:

> +	case FFI_TYPE_STRUCT:
> +	  {
> +	    void *dest;
> +	    int elems;
> +
> +	    h = is_hfa (ty);
> +	    if (h)
> +	      {
> +	    do_hfa:
> +		elems = h >> 8;
> +	        if (state.nsrn + elems <= N_V_ARG_REG)
> +		  {
> +		    dest = &context->v[state.nsrn];
> +		    state.nsrn += elems;
> +		    extend_hfa_type (dest, a, h);
> +		    break;
> +		  }
> +		state.nsrn = N_V_ARG_REG;
> +		dest = allocate_to_stack (&state, stack, ty->alignment, s);
> +	      }
> +	    else if (s > 16)
> +	      {
> +		/* If the argument is a composite type that is larger than 16
> +		   bytes, then the argument has been copied to memory, and
> +		   the argument is replaced by a pointer to the copy.  */
> +		a = &avalue[i];
> +		t = FFI_TYPE_POINTER;
> +		goto do_pointer;

I don't see where the argument has been copied to memory.  Doesn't that
need to call allocate_to_stack here?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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