summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2018-02-10 23:38:37 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2018-02-10 23:38:37 +0000
commite6cf07be417c9ea1adb4025f3089d41e926c8351 (patch)
treeb3cb8bf5516a1bbca25a4faadb057833896346d5
parent576a9301144d720b4ff24175e5f13f82c0a9dce1 (diff)
downloadgcc-e6cf07be417c9ea1adb4025f3089d41e926c8351.tar.gz
* config/pa/pa.c (hppa_profile_hook): Mark SYMBOL_REF for _mcount as
function label. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@257556 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/config/pa/pa.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 50e4dfa0851..f7a9ecef0ad 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
2018-02-10 John David Anglin <danglin@gcc.gnu.org>
+ * config/pa/pa.c (hppa_profile_hook): Mark SYMBOL_REF for _mcount as
+ function label.
+
Backport from mainline
2018-02-01 Aldy Hernandez <aldyh@redhat.com>
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index b4f7a7113ff..2ac2025e89d 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -4565,13 +4565,17 @@ hppa_profile_hook (int label_no)
lcla2 and load_offset_label_address insn patterns. */
rtx reg = gen_reg_rtx (SImode);
rtx_code_label *label_rtx = gen_label_rtx ();
- rtx mcount = gen_rtx_MEM (Pmode, gen_rtx_SYMBOL_REF (Pmode, "_mcount"));
int reg_parm_stack_space = REG_PARM_STACK_SPACE (NULL_TREE);
- rtx arg_bytes, begin_label_rtx;
+ rtx arg_bytes, begin_label_rtx, mcount, sym;
rtx_insn *call_insn;
char begin_label_name[16];
bool use_mcount_pcrel_call;
+ /* Set up call destination. */
+ sym = gen_rtx_SYMBOL_REF (Pmode, "_mcount");
+ pa_encode_label (sym);
+ mcount = gen_rtx_MEM (Pmode, sym);
+
/* If we can reach _mcount with a pc-relative call, we can optimize
loading the address of the current function. This requires linker
long branch stub support. */