This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: side effects of the compiler-generated calls
Tobias Schlüter wrote:
Tobias Schlüter wrote:
David Livshin wrote:
gfortran generated code uses calls to routines with the names that
begin with “_gfortran_”, e.g. “_gfortran_set_std”,
“_gfortran_st_write” etc. What are the side effects of these
routines? What registers are used/affected by them? And most
importantly, do they affect the value of the stack pointer ( %esp )?
They are normal function calls in the C sense, so arguments are
pushed on the stack by the caller, and the caller pops them off the
stack after the callee has returned, so it's a bit of a matter of
definition to say if the call affects %esp or not, but the _callee_
will return it unchanged.
But maybe that's not your question, could you give more detail on
what you're trying to achieve?
Forgot to say this: the point of these calls are for a large part
their side-effects: be it writing to some file (_gfortran_st_write),
be it initializing the library to use some conventions
(_gfortran_set_std).
Again, more details would be helpful.
Actually I hoped that as routines from the fortran library, they might
have "simplified" calling convention, e.g. affect less ( then normal
calls ) resources ( registers ). As to the stack pointer, analyzing the
compiler generated code, I didn't see any cases of stack-adjustment
after the calls to these routines - the question is if I may assume it
to be a rule; for what routines is it a rule?
I need all this to perform an efficient data flow analysis of the
gfortran generated assembly code ( part of the x86 optimizer ).
Thank you,
David
--
David Livshin
http://www.dalsoft.com