|Argument passing conventions and optimization email@example.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 firstname.lastname@example.org (Fergus Henderson) (2003-10-31)|
|Re: Argument passing conventions and optimization email@example.com (Marco van de Voort) (2003-10-31)|
|Re: Argument passing conventions and optimization firstname.lastname@example.org (2003-11-01)|
|Re: Argument passing conventions and optimization email@example.com (pradeep tumati) (2003-11-02)|
|Re: Argument passing conventions and optimization firstname.lastname@example.org (2003-11-08)|
|[3 later articles]|
|From:||pradeep tumati <email@example.com>|
|Date:||27 Oct 2003 16:08:13 -0500|
|Keywords:||code, question, optimize, comment|
|Posted-Date:||27 Oct 2003 16:08:13 EST|
In general whenever a function calls another function, it passes
arguments by pushing the values onto the stack. Similarly, when a
called function returns a value, it either pushes the value onto the
stack or puts the return value in one of the registers (dpending on
the compiler). Of course, this also depends on the processor that we
are looking at.
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?
For example, if I compile the C code using the -O0 (no optimization)
option, and say it generates the argument passing/return code by using
the standard calling convention of that platform. Now, if I compile
the same program with -O2 option on the same platform, do I get a
situation where the argument passing/return mechanism is changed all
together in the newly generated code? (I tried many cases, but this
never happened as yet. I am not sure if this happens or not.)
My question is: Does any of the known compiler (inter procedural)
optimizations which are in usage modify the standard argument passing
mechanism? Do I get a situation where I get two different argument
passing/ return mechanisms when I compile a program with no
optimization and Full optimization?
Thanks for you time.
[Other than inlining, I don't recall ever seeing an optimization that
affected the calling sequence. On architectures with more registers
than the x86, most arguments are passed in registers so it's less of
an issue. -John]
Return to the
Search the comp.compilers archives again.