diff options
Diffstat (limited to 'gcc/tm.texi')
-rw-r--r-- | gcc/tm.texi | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/gcc/tm.texi b/gcc/tm.texi index 008ee50e0d1..6f714ad898c 100644 --- a/gcc/tm.texi +++ b/gcc/tm.texi @@ -3502,18 +3502,24 @@ These macros will help you generate code for profiling. @item FUNCTION_PROFILER (@var{file}, @var{labelno}) A C statement or compound statement to output to @var{file} some assembler code to call the profiling subroutine @code{mcount}. -Before calling, the assembler code must load the address of a -counter variable into a register where @code{mcount} expects to -find the address. The name of this variable is @samp{LP} followed -by the number @var{labelno}, so you would generate the name using -@samp{LP%d} in a @code{fprintf}. @findex mcount -The details of how the address should be passed to @code{mcount} are -determined by your operating system environment, not by GCC. To -figure them out, compile a small program for profiling using the -system's installed C compiler and look at the assembler code that -results. +The details of how @code{mcount} expects to be called are determined by +your operating system environment, not by GCC. To figure them out, +compile a small program for profiling using the system's installed C +compiler and look at the assembler code that results. + +Older implementations of @code{mcount} expect the address of a counter +variable to be loaded into some register. The name of this variable is +@samp{LP} followed by the number @var{labelno}, so you would generate +the name using @samp{LP%d} in a @code{fprintf}. + +@findex NO_PROFILE_COUNTERS +@item NO_PROFILE_COUNTERS +Define this macro if the @code{mcount} subroutine on your system does +not need a counter variable allocated for each function. This is true +for almost all modern implementations. If you define this macro, you +must not use the @var{labelno} argument to @code{FUNCTION_PROFILER}. @findex PROFILE_BEFORE_PROLOGUE @item PROFILE_BEFORE_PROLOGUE |