defaults.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): Kill.
authorRichard Henderson <rth@redhat.com>
Thu, 30 May 2002 21:01:20 +0000 (14:01 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 30 May 2002 21:01:20 +0000 (14:01 -0700)
        * defaults.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): Kill.
        * toplev.c (process_options): Don't check it.
        * doc/tm.texi: Don't document it.
        * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): New.
        (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): Kill.
        * config/i386/i386.c (ix86_frame_pointer_required): Suppress leaf
        frame pointer optimization if current_function_profile.

From-SVN: r54072

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/linux.h
gcc/defaults.h
gcc/doc/tm.texi
gcc/toplev.c

index 2da19626416c21249788ed51212e6cfe10a7f286..f1451581a5a848ddf7e6a2577dc8b19fd0129264 100644 (file)
@@ -1,3 +1,13 @@
+2002-05-30  Richard Henderson  <rth@redhat.com>
+
+       * defaults.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): Kill.
+       * toplev.c (process_options): Don't check it.
+       * doc/tm.texi: Don't document it.
+       * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): New.
+       (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): Kill.
+       * config/i386/i386.c (ix86_frame_pointer_required): Suppress leaf
+       frame pointer optimization if current_function_profile.
+
 2002-05-30  Kazu Hirata  <kazu@cs.umass.edu>
 
        * langhooks.c: Fix formatting.
index 1715ca02a2102565dd4dff1c94db999757b4faa8..f89d1630bb9829dce5cd5cdc55d626c59c3a285f 100644 (file)
@@ -3885,7 +3885,8 @@ ix86_frame_pointer_required ()
   /* In override_options, TARGET_OMIT_LEAF_FRAME_POINTER turns off
      the frame pointer by default.  Turn it back on now if we've not
      got a leaf function.  */
-  if (TARGET_OMIT_LEAF_FRAME_POINTER && ! leaf_function_p ())
+  if (TARGET_OMIT_LEAF_FRAME_POINTER
+      && (!current_function_is_leaf || current_function_profile))
     return 1;
 
   return 0;
index fd4d7a0ccd3ce20b4feb1836fd1d30e2b553cf03..db1583ff9d56330e3e4344386a102eeb6d30b04c 100644 (file)
@@ -62,14 +62,11 @@ 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
+/* 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 SUBTARGET_FRAME_POINTER_REQUIRED
+#define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile
 
 #undef SIZE_TYPE
 #define SIZE_TYPE "unsigned int"
index 8ff73b160a05f71c88facbd24980c88e4e6f218f..6a1802722654ed37525115f03d5c11e328105759 100644 (file)
@@ -397,13 +397,6 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
    ? 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
-
 #ifndef DEFAULT_GDB_EXTENSIONS
 #define DEFAULT_GDB_EXTENSIONS 1
 #endif
index f82fd6099084f36084ab6204bbed90d2345171a1..cc87da63325a03e5d347caea337635721388ea32 100644 (file)
@@ -4160,22 +4160,6 @@ must not use the @var{labelno} argument to @code{FUNCTION_PROFILER}.
 @item PROFILE_BEFORE_PROLOGUE
 Define this macro if the code for function profiling should come before
 the function prologue.  Normally, the profiling code comes after.
-
-
-@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 Tail Calls
index ccbb4bc08a5b557e871121299ec565d150cf8131..b37a4f5a3232654784a9a5f4a2b3ee081a0ed6a7 100644 (file)
@@ -4893,16 +4893,6 @@ process_options ()
     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)
     {