This is the mail archive of the gcc-bugs@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]

[Bug c/12122] gcc do not respect stack argument list order


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12122



------- Additional Comments From zack at gcc dot gnu dot org  2003-09-01 06:01 -------
To clarify what Andrew has said:

In the abstract, there is absolutely no guarantee anywhere that arguments are
passed in any particular order, nor that they are necessarily all in memory. For
any given platform, the ABI does specify where the arguments will be found, and
in what order.  However, that only controls what the call setup sequence and
function prologue look like.  The compiler is completely free to rearrange
things afterward.  Your program's output is not defined either by the C standard
or any platform ABI.

To give a concrete example, on a sparc all four of the arguments to fn1 will be
passed in registers.  Since you took their addresses, GCC must copy them from
the registers to temporary locations on the stack.  It is free to organize those
locations any way it likes.


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