This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mips profiling patch


Gcc by default emits a counter word in every function for use by
mcount.  Modern profilers don't need or use this counter word.  I
checked some old gcc versions, 1.42, 2.0, 2.95, and it appears that no
mips port has ever used this counter word.  The fact that current gcc
does not use this counter word can be seen by looking at the definition
of FUNCTION_PROFILER, and noting that it does not use the LABELNO
argument.  If we avoid emitting the counter word, we can reduce data
space used by profiled code.  This also makes profiling easier to use in
some cases, e.g. embedded applications where object files are not
allowed to contain data.

This has been tested by an sb1-elf toolchain build from a combined tree,
C and C++ only, followed by a make check.  There were no regressions.

The only question I have about the patch is whether it should go in
gcc-4.0.  I think it is harmless and should be included, but I don't
feel strongly about that.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com

Attachment: patch.mips.no-counter
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]