aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKen Werner <ken.werner@de.ibm.com>2009-12-03 11:47:11 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2009-12-03 11:47:11 +0000
commit75741fedc51736373fbcd3a028af872791ac79e2 (patch)
tree7f5f51f98868e2a8b233b4416608dcf28a4a766c /gcc
parenta27c404027f2a072be6c085ff407977e244624ad (diff)
downloadgcc-75741fedc51736373fbcd3a028af872791ac79e2.zip
gcc-75741fedc51736373fbcd3a028af872791ac79e2.tar.gz
gcc-75741fedc51736373fbcd3a028af872791ac79e2.tar.bz2
spu-elf.h (STARTFILE_SPEC): Add support for gprof startup files.
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/spu/spu-elf.h5
-rw-r--r--gcc/config/spu/spu-protos.h1
-rw-r--r--gcc/config/spu/spu.c7
-rw-r--r--gcc/config/spu/spu.h7
5 files changed, 27 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8385c34..ac920dd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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 ...
diff --git a/gcc/config/spu/spu-elf.h b/gcc/config/spu/spu-elf.h
index 6898200..967c8ab 100644
--- a/gcc/config/spu/spu-elf.h
+++ b/gcc/config/spu/spu-elf.h
@@ -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"
diff --git a/gcc/config/spu/spu-protos.h b/gcc/config/spu/spu-protos.h
index a1f5d13..32bd25c 100644
--- a/gcc/config/spu/spu-protos.h
+++ b/gcc/config/spu/spu-protos.h
@@ -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,
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index a75f04a..3e04c17 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -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"
diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h
index 369e6d7..6d471ce 100644
--- a/gcc/config/spu/spu.h
+++ b/gcc/config/spu/spu.h
@@ -393,9 +393,12 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \
/* 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
/* Trampolines */