This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Inserting NOPs for profiling.
- To: Philip Blundell <philb at gnu dot org>
- Subject: Re: RFA: Inserting NOPs for profiling.
- From: Nick Clifton <nickc at redhat dot com>
- Date: 25 Mar 2001 12:39:48 -0800
- Cc: gcc-patches at gcc dot gnu dot org
- References: <E14hBYM-0002H9-00@kings-cross.london.uk.eu.org>
Hi Philip,
> > If profiling is enabled (with -pg) then GCC will emit a NOP at the
> > start of the file, between the .gcc2_compiled symbol and the start
> > of the first function. This ensures that the address of the first
> > function is not the same as the address of the .gcc2_compiled
> > symbol, and so ensures that the profiler's output does not refer to
> > the first function as if it were the .gcc2_compiled symbol.
> >
> > Unfortunately the code that is currently in GCC to generate this NOP
> > does not work if the NOP pattern is a define_expand or if it is a
> > define_insn which has a C body to compute the emitted assembler
> > string. In both cases the code will abort inside
> > get_insn_template. One particular case where this happens is the
> > ARM port where the NOP pattern is complicated by the fact that there
> > are two NOP instructions, one for ARM mode and one for Thumb mode.
>
> Hi Nick,
>
> Was there ever a resolution to this issue? Profiling still seems to
> be busted at least on the 3.0 branch.
The issue was never resolved. Jim Wilson pointed out that using the
special symbol .gcc2_compiled was actually a bad idea:
http://gcc.gnu.org/ml/gcc-patches/2000-10/msg00477.html
It was suggested that putting symbols into a special section might be
a better solution:
http://gcc.gnu.org/ml/gcc-patches/2000-10/msg00537.html
But I do not think anyone has actually gotten around to doing this.
The patch was never officially accepted, however, which is why it is
not in the sources.
Cheers
Nick