You seemed to have missed this: [PATCH 2.95.3] add NO_PROFILE_COUNTERS

David O'Brien obrien@FreeBSD.org
Fri Mar 2 00:34:00 GMT 2001


You seem to have ignored this patch.  It needs to be in 2.95.3.
Note that Zack also wanted this for Linux.
Can I check it into the branch?


----- Forwarded message from David O'Brien <obrien@FreeBSD.org> -----
To: gcc-patches@gcc.gnu.org
Subject: [PATCH 2.95.3] add NO_PROFILE_COUNTERS
Date: Sun, 10 Dec 2000 20:29:06 -0800

This patch adds the NO_PROFILE_COUNTERS changes from HEAD to 2.95.3.
This change is the most universally made change I've seen in *numerous*
local GCC source tress.


Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ChangeLog,v
retrieving revision 1.3667.4.286
diff -u -r1.3667.4.286 ChangeLog
--- ChangeLog	2000/12/05 19:59:32	1.3667.4.286
+++ ChangeLog	2000/12/11 04:26:48
@@ -1,3 +1,14 @@
+2000-12-10  David O'Brien  <obrien@FreeBSD.org>
+
+	from 2000-07-12  Zack Weinberg  <zack@wolery.cumb.org>
+	* final.c (profile_function): Do not emit profile counters in
+	the data section, if NO_PROFILE_COUNTERS is defined.
+	* tm.texi: Document NO_PROFILE_COUNTERS.  Update doc for
+	FUNCTION_PROFILER.
+
+	from 2000-10-02  David O'Brien  <obrien@dragon.nuxi.com>
+	* config/i386/freebsd.h (NO_PROFILE_COUNTERS): Define.
+
 2000-12-05  Bernd Schmidt  <bernds@redhat.co.uk>
 
 	* version.c: Bump.
Index: final.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/final.c,v
retrieving revision 1.77.4.1
diff -u -r1.77.4.1 final.c
--- final.c	1999/06/21 23:21:23	1.77.4.1
+++ final.c	2000/12/11 04:26:48
@@ -1701,7 +1701,9 @@
 profile_function (file)
      FILE *file;
 {
+#ifndef NO_PROFILE_COUNTERS
   int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif
 #if defined(ASM_OUTPUT_REG_PUSH)
 #if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
   int sval = current_function_returns_struct;
@@ -1711,10 +1713,12 @@
 #endif
 #endif /* ASM_OUTPUT_REG_PUSH */
 
+#ifndef NO_PROFILE_COUNTERS
   data_section ();
   ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
   ASM_OUTPUT_INTERNAL_LABEL (file, "LP", profile_label_no);
   assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif
 
   function_section (current_function_decl);
 
Index: tm.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tm.texi,v
retrieving revision 1.75.4.1
diff -u -r1.75.4.1 tm.texi
--- tm.texi	1999/05/31 02:56:15	1.75.4.1
+++ tm.texi	2000/12/11 04:26:51
@@ -3464,6 +3464,13 @@
 system's installed C compiler and look at the assembler code that
 results.
 
+@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
 Define this macro if the code for function profiling should come before
Index: config/i386/freebsd-elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/Attic/freebsd-elf.h,v
retrieving revision 1.13.4.7
diff -u -r1.13.4.7 freebsd-elf.h
--- freebsd-elf.h	2000/04/12 06:53:25	1.13.4.7
+++ freebsd-elf.h	2000/12/11 04:26:51
@@ -135,6 +135,9 @@
  : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
  : (-1))
 
+#undef  NO_PROFILE_COUNTERS
+#define NO_PROFILE_COUNTERS
+
 /* Tell final.c that we don't need a label passed to mcount.  */
 
 #undef FUNCTION_PROFILER



More information about the Gcc-patches mailing list