aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorStafford Horne <shorne@gmail.com>2019-10-14 15:14:20 +0900
committerStafford Horne <shorne@gmail.com>2021-01-14 08:45:00 +0900
commit8cba7cb3202da8b83e4b90280bc42472e110c0d4 (patch)
treecfa4f9c8e04e99957c3826f4897dde0be754acc3 /gcc
parent796ead19f85372e59217c9888db688a2fe11b54f (diff)
downloadgcc-8cba7cb3202da8b83e4b90280bc42472e110c0d4.zip
gcc-8cba7cb3202da8b83e4b90280bc42472e110c0d4.tar.gz
gcc-8cba7cb3202da8b83e4b90280bc42472e110c0d4.tar.bz2
or1k: Implement profile hook calling _mcount
Defining this to not abort as found when working on running tests in the glibc test suite. We implement this with a call to _mcount with no arguments. The required return address's will be pulled from the stack. Passing the LR (r9) as an argument had problems as sometimes r9 is clobbered by the GOT logic in the prologue before the call to _mcount. gcc/ChangeLog: * config/or1k/or1k.h (NO_PROFILE_COUNTERS): Define as 1. (PROFILE_HOOK): Define to call _mcount. (FUNCTION_PROFILER): Change from abort to no-op.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/or1k/or1k.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/config/or1k/or1k.h b/gcc/config/or1k/or1k.h
index ab1c4bbd..dc579e4 100644
--- a/gcc/config/or1k/or1k.h
+++ b/gcc/config/or1k/or1k.h
@@ -379,8 +379,19 @@ do { \
/* Always pass the SYMBOL_REF for direct calls to the expanders. */
#define NO_FUNCTION_CSE 1
-/* Profiling */
-#define FUNCTION_PROFILER(FILE,LABELNO) (abort (), 0)
+#define NO_PROFILE_COUNTERS 1
+
+/* Emit rtl for profiling. Output assembler code to call "_mcount" for
+ profiling a function entry. */
+#define PROFILE_HOOK(LABEL) \
+ { \
+ rtx fun; \
+ fun = gen_rtx_SYMBOL_REF (Pmode, "_mcount"); \
+ emit_library_call (fun, LCT_NORMAL, VOIDmode); \
+ }
+
+/* All the work is done in PROFILE_HOOK, but this is still required. */
+#define FUNCTION_PROFILER(STREAM, LABELNO) do { } while (0)
/* Dwarf 2 Support */
#define DWARF2_DEBUGGING_INFO 1