DEFAULT_CALLER_SAVES doesn't work on the mac

Muhammed Fawzy mfawzymkh@hotmail.com
Tue Dec 22 23:09:00 GMT 2009


FUNCTION_PROFILER means I am going to write my own profiler and not rely on 
gprof /( mcount ),  unfortunately, the we need to use gprof output because 
It would be used later for link time code optimization step, so we are bound 
with -pg switch and mcount.
It looks like the only way to solve this problem is to fix gcc, is this 
correct?
Thanks


--------------------------------------------------
From: "Ian Lance Taylor" <iant@google.com>
Sent: Tuesday, December 22, 2009 2:59 PM
To: "Muhammed Fawzy" <mfawzymkh@hotmail.com>
Cc: <gcc-help@gcc.gnu.org>
Subject: Re: DEFAULT_CALLER_SAVES doesn't work on the mac

> "Muhammed Fawzy" <mfawzymkh@hotmail.com> writes:
>
>> I see,  so even writing a plugin to alter the instruction stream
>> wouldn't help?
>
> In this case, probably not.  The call to mcount is generated very
> late.
>
>> is it possible to have a flag for gcc to store registers around mcount
>> calls - through a patch or something, right now apple implementation
>> for mcount doesn't store registers - except for ebx, esi , and edi,
>> which technically render the -pg switch broken when profiling fast
>> call functions, where arguments are passed in ecx and edx
>> any help regarding this issue is REALLY appreciated.
>
> Sure, that is possible.
>
> Look for FUNCTION_PROFILER in the relevant backend.
>
> Ian
> 



More information about the Gcc-help mailing list