Re: Argument passing conventions and optimization

Rob Thorpe <robert.thorpe@antenova.com>
11 Nov 2003 13:48:13 -0500

          From comp.compilers

Related articles
[2 earlier articles]
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)
Re: Argument passing conventions and optimization nmm1@cus.cam.ac.uk (2003-11-11)
| List of all articles for this month |

From: Rob Thorpe <robert.thorpe@antenova.com>
Newsgroups: comp.compilers
Date: 11 Nov 2003 13:48:13 -0500
Organization: Compilers Central
References: 03-10-116 03-10-147 03-11-012
Keywords: code, optimize
Posted-Date: 11 Nov 2003 13:48:13 EST

> There could be a scenario where this kind of optimization can be
> entrusted to the linker, but I guess its going to be a costly
> stuff. Any thoughts...?


This is rather difficult. The linker could notice the relationships
between callers and callees, but it would be difficult since argument
passing is quite a high level business. The only way it can be done
generally is by burying the compiler in the linker, as some high
performance compilers do. Otherwise it would be limited to static
functions. The alternative is to have different types of calls as
windows compilers do (function attributes), for instance Borlands has
"fastcall" which passes some arguments in registers. So the
programmer can control it.


In the compilers I've seen even inlining doesn't affect the calling
convention, as a copy of the function uninlined is always added just in
case, it is later removed by the linker.


Post a followup to this message

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