aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChung-Ju Wu <jasonwucj@gmail.com>2018-04-01 08:52:24 +0000
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>2018-04-01 08:52:24 +0000
commit9e362bd034571dd74db4b2874515f20d1731ab30 (patch)
treee4f30f22ea4378a502f6e34123c163ac35480247 /gcc
parent7f9833429c003af8af8b451a78a912f9080bef2c (diff)
downloadgcc-9e362bd034571dd74db4b2874515f20d1731ab30.zip
gcc-9e362bd034571dd74db4b2874515f20d1731ab30.tar.gz
gcc-9e362bd034571dd74db4b2874515f20d1731ab30.tar.bz2
[NDS32] Implement PROFILE_HOOK.
gcc/ * config/nds32/nds32.h (FUNCTION_PROFILER): Output newline character. (PROFILE_HOOK): Define its implementation. From-SVN: r258996
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/nds32/nds32.h10
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8c97086..a2a7151 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2018-04-01 Chung-Ju Wu <jasonwucj@gmail.com>
+ * config/nds32/nds32.h (FUNCTION_PROFILER): Output newline character.
+ (PROFILE_HOOK): Define its implementation.
+
+2018-04-01 Chung-Ju Wu <jasonwucj@gmail.com>
+
* config/nds32/nds32.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Use unsigned int
type and 32-bit size.
diff --git a/gcc/config/nds32/nds32.h b/gcc/config/nds32/nds32.h
index 3ac0718..42a1c12 100644
--- a/gcc/config/nds32/nds32.h
+++ b/gcc/config/nds32/nds32.h
@@ -801,7 +801,15 @@ enum reg_class
#define EXIT_IGNORE_STACK 1
#define FUNCTION_PROFILER(file, labelno) \
- fprintf (file, "/* profiler %d */", (labelno))
+ fprintf (file, "/* profiler %d */\n", (labelno))
+
+#define PROFILE_HOOK(LABEL) \
+ { \
+ rtx fun, lp; \
+ lp = get_hard_reg_initial_val (Pmode, LP_REGNUM); \
+ fun = gen_rtx_SYMBOL_REF (Pmode, "_mcount"); \
+ emit_library_call (fun, LCT_NORMAL, VOIDmode, lp, Pmode); \
+ }
/* Implementing the Varargs Macros. */