From: David O'Brien Date: Tue, 20 Mar 2001 19:51:59 +0000 (+0000) Subject: from 2000-07-12 Zack Weinberg X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29ff7d21429d2eb44401f55c416a99b00ccce425;p=thirdparty%2Fgcc.git from 2000-07-12 Zack Weinberg * 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 * config/i386/freebsd.h (NO_PROFILE_COUNTERS): Define. Approved by: Bernd Schmidt From-SVN: r40669 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 41bbf78a10bc..190cc59ebc2b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2001-03-20 David O'Brien + + from 2000-07-12 Zack Weinberg + * 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 + * config/i386/freebsd.h (NO_PROFILE_COUNTERS): Define. + 2001-03-19 Bernd Schmidt * version.c: Bump. diff --git a/gcc/config/i386/freebsd-elf.h b/gcc/config/i386/freebsd-elf.h index e97d4ca07bb2..4e4502040941 100644 --- a/gcc/config/i386/freebsd-elf.h +++ b/gcc/config/i386/freebsd-elf.h @@ -135,6 +135,9 @@ Boston, MA 02111-1307, USA. */ : ((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 diff --git a/gcc/final.c b/gcc/final.c index 11cfebf34624..d12ec87ec475 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1701,7 +1701,9 @@ static void 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 @@ profile_function (file) #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); diff --git a/gcc/tm.texi b/gcc/tm.texi index a13c6d97424b..484c73c10dc1 100644 --- a/gcc/tm.texi +++ b/gcc/tm.texi @@ -3464,6 +3464,13 @@ figure them out, compile a small program for profiling using the 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