[parisc-linux-cvs] gcc amodra

Alan Modra alan@linuxcare.com.au
Sat, 24 Feb 2001 00:04:14 +1100 (EST)


On Fri, 23 Feb 2001, Alan Modra wrote:

> Call PROFILE_HOOK so we acually get _mcount calls.
> Disable generation of profiling insns for inline functions.

This should allay fears of wholescale gcc merges. :)

gcc/ChangeLog
2001-02-23  Alan Modra  <alan@linuxcare.com.au>

	* config/pa/pa.c (hppa_profile_hook): Don't emit profiler calls
	for inline functions.

	2001-02-05  Chandrakala Chavva  <cchavva@redhat.com>
	* final.c: Move the declaration of profile_label_no to ...
	* output.h: ... here.
	* function.c (expand_function_start): Call PROFILE_HOOK.


Index: gcc/function.c
===================================================================
RCS file: /home/cvs/parisc/gcc/gcc/function.c,v
retrieving revision 1.4
diff -u -p -r1.4 function.c
--- function.c	2001/02/19 13:53:44	1.4
+++ function.c	2001/02/23 12:35:36
@@ -6471,6 +6471,11 @@ expand_function_start (subr, parms_have_
 			 Pmode);
     }
 
+#ifdef PROFILE_HOOK
+  if (profile_flag)
+    PROFILE_HOOK (profile_label_no);
+#endif
+
   /* After the display initializations is where the tail-recursion label
      should go, if we end up needing one.   Ensure we have a NOTE here
      since some things (like trampolines) get placed before this.  */
Index: gcc/output.h
===================================================================
RCS file: /home/cvs/parisc/gcc/gcc/output.h,v
retrieving revision 1.3
diff -u -p -r1.3 output.h
--- output.h	2001/02/19 13:53:48	1.3
+++ output.h	2001/02/23 12:35:37
@@ -457,3 +457,6 @@ extern const char *user_label_prefix;
 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
   (VAR) = ((SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*'))
 #endif
+/* Assign unique numbers to labels generated for profiling.  */
+
+extern int profile_label_no;
Index: gcc/config/pa/pa.c
===================================================================
RCS file: /home/cvs/parisc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.12
diff -u -p -r1.12 pa.c
--- pa.c	2001/02/19 13:54:41	1.12
+++ pa.c	2001/02/23 12:45:15
@@ -3503,6 +3503,13 @@ void hppa_profile_hook (label_no)
 {
   rtx call_insn;
 
+  /* No profiling for inline functions.  We don't want extra calls to
+     _mcount when the inline function is expanded.  Even if that made
+     sense, it wouldn't work here as there is no function label for
+     the inline expansion.  */
+  if (DECL_INLINE (cfun->decl))
+    return;
+
   if (TARGET_64BIT)
     emit_move_insn (arg_pointer_rtx,
 		    gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx,