"Muhammed Fawzy" <mfawzymkh@xxxxxxxxxxx> writes: > 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? Yes, I think so. I mentioned FUNCTION_PROFILER because that is the internal macro in gcc which you need to change. Look for FUNCTION_PROFILER in gcc/config/i386/i386.h. Ian > -------------------------------------------------- > From: "Ian Lance Taylor" <iant@xxxxxxxxxx> > Sent: Tuesday, December 22, 2009 2:59 PM > To: "Muhammed Fawzy" <mfawzymkh@xxxxxxxxxxx> > Cc: <gcc-help@xxxxxxxxxxx> > Subject: Re: DEFAULT_CALLER_SAVES doesn't work on the mac > >> "Muhammed Fawzy" <mfawzymkh@xxxxxxxxxxx> 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 >>