This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: DEFAULT_CALLER_SAVES doesn't work on the mac
"Muhammed Fawzy" <mfawzymkh@hotmail.com> writes:
> However, I think I wasn't clear in my question, please let me try to
> explain.
> the problem I am trying to solve is that I want to save ecx, edx
> registers around a specific function call, In my case I want to save
> them around mcount call ( when you compile with -pg switch, mcount is
> inserted after the prolog of each function ).
>
> the problem is that mcount and moncount implementation on the MAC
> trashes the value of ecx register, and gcc doesn't emit code to save
> registers around mcount calls.. I was hoping to find a gcc code gen
> option to force gcc to save and restore register values around mcount
> call.
I see. The mcount function is a special part of the function prologue
and is not handled as a regular function call. I don't think there is
any way to do this without modifying gcc itself.
Ian