diff options
author | Mark Mitchell <mark@codesourcery.com> | 2001-05-19 17:56:48 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2001-05-19 17:56:48 +0000 |
commit | 4da5f005d4453530e4498352d23960399670f462 (patch) | |
tree | e681110f1fb97b5f75bd65da47d3451a492fd3b2 | |
parent | e86f9f3267b0127af29d48afc8e803c8e0028ae2 (diff) | |
download | gcc-4da5f005d4453530e4498352d23960399670f462.zip gcc-4da5f005d4453530e4498352d23960399670f462.tar.gz gcc-4da5f005d4453530e4498352d23960399670f462.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 21 | ||||
-rw-r--r-- | gcc/config/i386/linux.h | 9 | ||||
-rw-r--r-- | gcc/defaults.h | 7 | ||||
-rw-r--r-- | gcc/tm.texi | 15 | ||||
-rw-r--r-- | gcc/toplev.c | 10 |
5 files changed, 62 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d859850..64a0c14 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2001-05-19 Mark Mitchell <mark@codesourcery.com> + + * 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 <kenner@vlsi1.ultra.nyu.edu> * 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 <jh@suse.cz> 2001-05-18 Mark Mitchell <mark@codesourcery.com> + * 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 a939550..108a6fb 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 45fb088..452bdfe 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 2c1fe71..d745902 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 d64cb3a..802446e 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) { |