public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Edelsohn <dje@watson.ibm.com>
To: Richard.Earnshaw@arm.com
Cc: jeroen dobbelaere <jeroen.dobbelaere@acunia.com>, gcc@gcc.gnu.org
Subject: Re: ARM: testsuite gcc.c-torture/execute/20020307-2.c failure
Date: Tue, 12 Nov 2002 11:05:00 -0000	[thread overview]
Message-ID: <200211121853.NAA24694@makai.watson.ibm.com> (raw)
In-Reply-To: Message from Richard Earnshaw <rearnsha@arm.com>  of "Tue, 12 Nov 2002 18:25:30 GMT." <200211121825.gACIPU801856@pc960.cambridge.arm.com>

>>>>> Richard Earnshaw writes:

Richard> Where is 99 put?  Answer: it depends on the value of i.  If i < 3, then 99 
Richard> is placed in a register, otherwise it is on the stack.  For the register 
Richard> case even that can vary.

Richard> That makes compiling the call to foo very difficult, if not impossible.

Richard> It's even worse for passing d itself, part of it (sometimes all of it) is 
Richard> in registers, and the remainder of it (if there is any) is on the stack.  
Richard> How much stack space do we have to allocate...

	Passing the arguments in registers is difficult if one constructs
the arguments one at a time.  On AIX, at least, the registers are an image
of the beginning of the argument list on the stack.  When passing
arguments in registers, GCC can handle fixed-size arguments to varadic
functions and a fixed number of variable-sized arguments.  Also, passing
the variable-sized argument by reference requires that the argument be
constructed on the stack.

	I believe that GCC could handle variable-sized arguments to
varadic functions if it constructed the entire argument list on the stack
and then copied the memory image of the beginning of the argument list
into the argument registers.  GCC would perform a block load of all
argument registers, regardless the actual number of arguments  This is a
finite, well-defined operation and does not require that GCC construct the
actual register argument list piece by piece.

	I do not know if the ARM ABI calling convention allows for this
technique, and GCC currently does not support it, but it allows GCC to
generate the register arguments without knowing their size, thereby
supporting the GCC extension and conforming to the target calling
convention for passing structures.

David

  reply	other threads:[~2002-11-12 18:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-12  5:39 jeroen dobbelaere
2002-11-12  8:07 ` Richard Earnshaw
2002-11-12  8:46   ` jeroen dobbelaere
2002-11-12 10:36     ` Richard Earnshaw
2002-11-12 11:05       ` David Edelsohn [this message]
2002-11-13  2:06         ` Richard Earnshaw
2002-11-13  5:43           ` [patch] " jeroen dobbelaere
2002-11-13  8:36             ` jeroen dobbelaere
2002-11-13  9:50               ` Richard Earnshaw
2002-11-14  2:40                 ` jeroen dobbelaere
2002-11-14  6:37                   ` Richard Earnshaw
  -- strict thread matches above, loose matches on Subject: below --
2003-01-14  0:34 PCH tests fail on sparc-sun-solaris2.7 Kaveh R. Ghazi
2003-01-14  2:03 ` Geoff Keating
2003-01-14 18:10   ` Richard Earnshaw
2003-01-14 20:05     ` David Edelsohn
2003-01-14 20:38     ` David Edelsohn
2003-01-19 17:37   ` Kaveh R. Ghazi
2003-01-20  0:31     ` Geoff Keating
2003-01-21  8:03       ` Segher Boessenkool
2003-01-23  2:16         ` Kaveh R. Ghazi
2002-01-08 16:45 rfc: clobber all call-saved registers Richard Henderson
2002-01-08 17:39 ` Hans-Peter Nilsson
2002-01-09  3:06   ` Richard Earnshaw
2002-01-09  3:14     ` Richard Henderson
2002-01-09  4:40       ` Richard Earnshaw
2002-01-09  5:15         ` Joseph S. Myers
2002-01-09  4:07     ` Gabriel Dos Reis
2002-01-09 15:44 ` Alexandre Oliva
2002-01-10  4:37   ` Richard Earnshaw
2002-01-10 10:13     ` David Edelsohn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200211121853.NAA24694@makai.watson.ibm.com \
    --to=dje@watson.ibm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jeroen.dobbelaere@acunia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).