Re: Argument passing conventions and optimization

Fergus Henderson <fjh@cs.mu.oz.au>
31 Oct 2003 23:08:20 -0500

          From comp.compilers

Related articles
Argument passing conventions and optimization ptumati@yahoo.com (pradeep tumati) (2003-10-27)
Re: Argument passing conventions and optimization derkgwen@HotPOP.com (Derk Gwen) (2003-10-31)
Re: Argument passing conventions and optimization fjh@cs.mu.oz.au (Fergus Henderson) (2003-10-31)
Re: Argument passing conventions and optimization marcov@stack.nl (Marco van de Voort) (2003-10-31)
Re: Argument passing conventions and optimization nmm1@cus.cam.ac.uk (2003-11-01)
Re: Argument passing conventions and optimization ptumati@yahoo.com (pradeep tumati) (2003-11-02)
Re: Argument passing conventions and optimization nmm1@cus.cam.ac.uk (2003-11-08)
Re: Argument passing conventions and optimization bobduff@shell01.TheWorld.com (Robert A Duff) (2003-11-08)
Re: Argument passing conventions and optimization robert.thorpe@antenova.com (Rob Thorpe) (2003-11-11)
[1 later articles]
| List of all articles for this month |

From: Fergus Henderson <fjh@cs.mu.oz.au>
Newsgroups: comp.compilers
Date: 31 Oct 2003 23:08:20 -0500
Organization: The University of Melbourne
References: 03-10-116
Keywords: code, optimize
Posted-Date: 31 Oct 2003 23:08:20 EST

pradeep tumati <ptumati@yahoo.com> writes:


>Now, assuming that we are using GCC 3.2.x (x86, linux) does the
>following situation ever arise?
>
>Do we ever get a situation where one of the GCC optimizations changes
>the argument passing mechanism?


In GCC 3.2.x, the -O* and -f* options will not change the argument
passing mechanism. Some other options, e.g. `-mrtd' and
`-mregparm-N', do change it.


In future versions of GCC, this is likely to change. For example,
argument passing conventions for static functions whose address is not
taken will use different (more efficient) calling conventions.


Our moderator replied:


>[Other than inlining, I don't recall ever seeing an optimization that
>affected the calling sequence.


There are others, e.g. tail call and sibling call optimization.
However, although they affect the calling sequence, they do not affect
the argument passing mechanism.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.