From: Mark Mitchell Date: Sat, 19 May 2001 17:56:48 +0000 (+0000) Subject: defaults.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): New macro. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4da5f005d4453530e4498352d23960399670f462;p=gcc.git defaults.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): New macro. * defaults.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): New macro. * tm.texi (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): Document it. * toplev.c (main): If the target does not allow profiling without a frame pointer, issue an error message. * config/i386/linux.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): Define it to false. From-SVN: r42312 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d8598505427..64a0c145721 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2001-05-19 Mark Mitchell + + * defaults.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): New + macro. + * tm.texi (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): + Document it. + * toplev.c (main): If the target does not allow profiling without + a frame pointer, issue an error message. + * config/i386/linux.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): + Define it to false. + Sat May 19 07:53:42 2001 Richard Kenner * recog.c (general_operand): Modify last change to allow it if reload @@ -102,6 +113,16 @@ Fri May 18 15:39:16 CEST 2001 Jan Hubicka 2001-05-18 Mark Mitchell + * basic-block.h (struct basic_block_def): Add documentation about + what a basic block is, and what the various fields are used for. + * flow.c (calculate_globlal_regs_live): Add documentation about + how the algorithm works, and how we know that it will terminate. + Check that the the inductive assumption that guarantees + termination actually holds. + (mark_used_regs): Treat conditionally set registers as used. + (debug_regset): Add comment. + * rtl.texi (cond_exec): Add documentation. + * function.c (expand_function_start): Avoid creating BLKmode pseudos. diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h index a93955092f2..108a6fbaac8 100644 --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -73,6 +73,15 @@ Boston, MA 02111-1307, USA. */ fprintf (FILE, "\tcall\tmcount\n"); \ } +/* True if it is possible to profile code that does not have a frame + pointer. + + The GLIBC version of mcount for the x86 assumes that there is a + frame, so we cannot allow profiling without a frame pointer. */ + +#undef TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER +#define TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER false + #undef SIZE_TYPE #define SIZE_TYPE "unsigned int" diff --git a/gcc/defaults.h b/gcc/defaults.h index 45fb088785f..452bdfe44cd 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -336,5 +336,12 @@ do { \ ? ptrmemfunc_vbit_in_pfn : ptrmemfunc_vbit_in_delta) #endif +/* True if it is possible to profile code that does not have a frame + pointer. */ + +#ifndef TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER +#define TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER true +#endif + #endif /* GCC_DEFAULTS_H */ diff --git a/gcc/tm.texi b/gcc/tm.texi index 2c1fe71a8e5..d745902d90a 100644 --- a/gcc/tm.texi +++ b/gcc/tm.texi @@ -3992,6 +3992,21 @@ Registers or condition codes clobbered by @code{FUNCTION_PROLOGUE} or @item BLOCK_PROFILER_CODE A C function or functions which are needed in the library to support block profiling. + +@findex TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER +@item TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER +On some targets, it is impossible to use profiling when the frame +pointer has been omitted. For example, on x86 GNU/Linux systems, +the @code{mcount} routine provided by the GNU C Library finds the +address of the routine that called the routine that called @code{mcount} +by looking in the immediate caller's stack frame. If the immediate +caller has no frame pointer, this lookup will fail. + +By default, GCC assumes that the target does allow profiling when the +frame pointer is omitted. This macro should be defined to a C +expression that evaluates to @code{false} if the target does not allow +profiling when the frame pointer is omitted. + @end table @node Inlining diff --git a/gcc/toplev.c b/gcc/toplev.c index d64cb3a2173..802446e4bb5 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -4932,6 +4932,16 @@ toplev_main (argc, argv) warning ("this target machine does not have delayed branches"); #endif + /* Some operating systems do not allow profiling without a frame + pointer. */ + if (!TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER + && profile_flag + && flag_omit_frame_pointer) + { + error ("profiling does not work without a frame pointer"); + flag_omit_frame_pointer = 0; + } + user_label_prefix = USER_LABEL_PREFIX; if (flag_leading_underscore != -1) {