[PATCH] -mcount-nofp patch for committing

Andi Kleen andi@firstfloor.org
Sat Jan 3 13:10:00 GMT 2009


On Sat, Jan 03, 2009 at 11:18:13AM +0100, Paolo Bonzini wrote:
> 
> > +@item -mcount-nofp
> > +Don't force the frame counter with @option{-pg} function profiling.
> 
> Typo (-mmcount-nofp).

Thanks.

> 
> > +  if (flag_omit_frame_pointer && profile_flag && ix86_mcount_nofp)
> > +    targetm.profile_before_prologue = true;
> 
> Do you still need an error if -pg -fomit-frame-pointer is given without
> -mmcount-nofp?

I did it this way because you need a new glibc version, older versions
don't have the nofp hook. So if I didn't give the error and people
specified this accidentially they would get an obscure linker error
later. The idea was that only the new option requires the new glibc
version.


> > -  if (crtl->profile)
> > +  if (crtl->profile && targetm.profile_before_prologue && !ix86_mcount_nofp)
> 
> This is wrong, you can never have "targetm.profile_before_prologue &&
> !ix86_mcount_nofp" on e.g. Linux; you would remove the frame from
> profiled functions even without -mmcount-nofp.  Did you mean any of

The frame is still there for -fno-omit-frame-pointer -pg builds in 
my testing.

-Andi
-- 
ak@linux.intel.com



More information about the Gcc-patches mailing list