summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2013-01-02 22:16:16 +0000
committermiod <miod@openbsd.org>2013-01-02 22:16:16 +0000
commitf5c6f4e7e4cc5b271a76de52dae4b84aad54d110 (patch)
tree3c53f017af99c5a41c1db518dd98c9b768872c27
parentRemove last boolean argumont of output_function_profiler(), it is always invoked (diff)
downloadwireguard-openbsd-f5c6f4e7e4cc5b271a76de52dae4b84aad54d110.tar.xz
wireguard-openbsd-f5c6f4e7e4cc5b271a76de52dae4b84aad54d110.zip
Help the DWARF code to handle our prologues correctly:
- add the frame pointer to EPILOGUE_USES when profiling - when the initial stack adjustement is larger than 64KB and requires a temporary register to be used, add a REG_FRAME_RELATED_EXPR of the original computation (not constrained by the adjustement size) to the REG_NOTES of the stack pointer adjustement sequence. Borrowed from alpha which has a similar issue.
-rw-r--r--gnu/usr.bin/gcc/gcc/config/m88k/m88k.c10
-rw-r--r--gnu/usr.bin/gcc/gcc/config/m88k/m88k.h6
2 files changed, 14 insertions, 2 deletions
diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c
index da78aed7ca9..7701a393baf 100644
--- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c
+++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c
@@ -1921,6 +1921,16 @@ m88k_expand_prologue ()
{
insn = emit_add (stack_pointer_rtx, stack_pointer_rtx, -m88k_stack_size);
RTX_FRAME_RELATED_P (insn) = 1;
+
+ /* If the stack pointer adjustment has required a temporary register,
+ tell the DWARF code how to understand this sequence. */
+ if (! SMALL_INTVAL (m88k_stack_size))
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ gen_rtx_PLUS (Pmode, stack_pointer_rtx,
+ GEN_INT (-m88k_stack_size))),
+ REG_NOTES(insn));
}
if (nregs || nxregs)
diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.h b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.h
index fd4a8808832..2df19f0b144 100644
--- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.h
+++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.h
@@ -964,9 +964,11 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
|| !TARGET_OMIT_LEAF_FRAME_POINTER) \
|| (write_symbols != NO_DEBUG))
-
/* Define registers used by the epilogue and return instruction. */
-#define EPILOGUE_USES(REGNO) (reload_completed && (REGNO) == 1)
+#define EPILOGUE_USES(REGNO) \
+(reload_completed && ((REGNO) == 1 \
+ || (current_function_profile \
+ && (REGNO) == FRAME_POINTER_REGNUM)))
/* Before the prologue, RA is in r1. */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 1)