spu-elf.h (STARTFILE_SPEC): Add support for gprof startup files.
authorKen Werner <ken.werner@de.ibm.com>
Thu, 3 Dec 2009 11:47:11 +0000 (11:47 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Thu, 3 Dec 2009 11:47:11 +0000 (11:47 +0000)
2009-12-03  Ken Werner  <ken.werner@de.ibm.com>

        * config/spu/spu-elf.h (STARTFILE_SPEC): Add support for gprof
        startup files.
        * config/spu/spu-protos.h (spu_function_profiler): Add prototype.
        * config/spu/spu.c (spu_function_profiler): New function.
        * config/spu/spu.h (FUNCTION_PROFILER): Invoke
        spu_function_profiler.
        (NO_PROFILE_COUNTERS): Define.
        (PROFILE_BEFORE_PROLOGUE): Likewise.

From-SVN: r154942

gcc/ChangeLog
gcc/config/spu/spu-elf.h
gcc/config/spu/spu-protos.h
gcc/config/spu/spu.c
gcc/config/spu/spu.h

index 8385c3443168a0d9fd809389752f7efdbe5febfe..ac920ddcc88caf8dfbb12f80d9ab4954b62daaa7 100644 (file)
@@ -1,3 +1,14 @@
+2009-12-03  Ken Werner  <ken.werner@de.ibm.com>
+
+        * config/spu/spu-elf.h (STARTFILE_SPEC): Add support for gprof
+        startup files.
+        * config/spu/spu-protos.h (spu_function_profiler): Add prototype.
+        * config/spu/spu.c (spu_function_profiler): New function.
+        * config/spu/spu.h (FUNCTION_PROFILER): Invoke
+        spu_function_profiler.
+        (NO_PROFILE_COUNTERS): Define.
+        (PROFILE_BEFORE_PROLOGUE): Likewise.
+
 2009-12-03  Dave Korn  <dave.korn.cygwin@gmail.com>
 
        * ggc-page.c (struct free_object): Pull definition out ...
index 68982002103dd29d04027a2f3033f1c2d915f757..967c8abc6176d8fd543f101ae9e9a8832b3b8b63 100644 (file)
@@ -48,8 +48,9 @@
    object constructed before entering `main'.  */
 
 #undef  STARTFILE_SPEC 
-#define STARTFILE_SPEC "%{mstdmain: crt2.o%s} %{!mstdmain: crt1.o%s} \
-                       crti.o%s crtbegin.o%s"
+#define STARTFILE_SPEC "%{mstdmain: %{pg|p:gcrt2.o%s;:crt2.o%s}}\
+                        %{!mstdmain: %{pg|p:gcrt1.o%s;:crt1.o%s}}\
+                        crti.o%s crtbegin.o%s"
 
 #undef  ENDFILE_SPEC
 #define ENDFILE_SPEC   "crtend.o%s crtn.o%s"
index a1f5d13f17c67e504dd955e4c367962ad80a9de6..32bd25c30c9f77993e14f9e3610807942ec5a4af 100644 (file)
@@ -85,6 +85,7 @@ extern void spu_expand_sign_extend (rtx ops[]);
 extern void spu_expand_vector_init (rtx target, rtx vals);
 extern void spu_init_expanders (void);
 extern void spu_split_convert (rtx *);
+extern void spu_function_profiler (FILE *, int);
 
 /* spu-c.c */
 extern tree spu_resolve_overloaded_builtin (location_t, tree fndecl,
index a75f04a61ab5f371ec5d4ec1a4a05ec439c18c06..3e04c17d790c4f18fdd7933e4968e8f0c3420a1e 100644 (file)
@@ -7074,4 +7074,11 @@ spu_split_convert (rtx ops[])
     }
 }
 
+void
+spu_function_profiler (FILE * file, int labelno)
+{
+  fprintf (file, "# profile\n");
+  fprintf (file, "brsl $75,  _mcount\n");
+}
+
 #include "gt-spu.h"
index 369e6d76e9d0873151ca585faffa9a63aa3d9eb9..6d471cea333277bec99e96e4c3604244798c2004 100644 (file)
@@ -393,9 +393,12 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin;       \
 \f
 /* Profiling */
 
-/* Nothing, for now. */
 #define FUNCTION_PROFILER(FILE, LABELNO)  \
-   fprintf (FILE, "\t\n")
+  spu_function_profiler ((FILE), (LABELNO));
+
+#define NO_PROFILE_COUNTERS 1
+
+#define PROFILE_BEFORE_PROLOGUE 1
 
 \f
 /* Trampolines */