aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2018-02-16 23:37:22 -0700
committerJeff Law <law@gcc.gnu.org>2018-02-16 23:37:22 -0700
commit9f533a82db92db8c0772a0d75e6a76c98ad1bcc9 (patch)
tree4b324cb507da5900af1890737dc397edc176789f /gcc
parent1d569881592ea86828176843c77eec8f2719e4b2 (diff)
downloadgcc-9f533a82db92db8c0772a0d75e6a76c98ad1bcc9.zip
gcc-9f533a82db92db8c0772a0d75e6a76c98ad1bcc9.tar.gz
gcc-9f533a82db92db8c0772a0d75e6a76c98ad1bcc9.tar.bz2
rx.c (add_pop_cfi_notes): New function.;
* config/rx/rx.c (add_pop_cfi_notes): New function.; (pop_regs): Use it. From-SVN: r257780
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/rx/rx.c23
2 files changed, 25 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f41bb40..b47d282 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2018-02-16 Jeff Law <law@redhat.com>
+
+ * config/rx/rx.c (add_pop_cfi_notes): New function.;
+ (pop_regs): Use it.
+
2018-02-16 Jakub Jelinek <jakub@redhat.com>
PR ipa/84425
diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c
index de7af86..007e052 100644
--- a/gcc/config/rx/rx.c
+++ b/gcc/config/rx/rx.c
@@ -1644,6 +1644,20 @@ mark_frame_related (rtx insn)
}
}
+/* Create CFI notes for register pops. */
+static void
+add_pop_cfi_notes (rtx_insn *insn, unsigned int high, unsigned int low)
+{
+ rtx t = plus_constant (Pmode, stack_pointer_rtx,
+ (high - low + 1) * UNITS_PER_WORD);
+ t = gen_rtx_SET (stack_pointer_rtx, t);
+ add_reg_note (insn, REG_CFA_ADJUST_CFA, t);
+ RTX_FRAME_RELATED_P (insn) = 1;
+ for (unsigned int i = low; i <= high; i++)
+ add_reg_note (insn, REG_CFA_RESTORE, gen_rtx_REG (word_mode, i));
+}
+
+
static bool
ok_for_max_constant (HOST_WIDE_INT val)
{
@@ -2029,11 +2043,14 @@ rx_can_use_simple_return (void)
static void
pop_regs (unsigned int high, unsigned int low)
{
+ rtx_insn *insn;
if (high == low)
- emit_insn (gen_stack_pop (gen_rtx_REG (SImode, low)));
+ insn = emit_insn (gen_stack_pop (gen_rtx_REG (SImode, low)));
else
- emit_insn (gen_stack_popm (GEN_INT (((high - low) + 1) * UNITS_PER_WORD),
- gen_rx_popm_vector (low, high)));
+ insn = emit_insn (gen_stack_popm (GEN_INT (((high - low) + 1)
+ * UNITS_PER_WORD),
+ gen_rx_popm_vector (low, high)));
+ add_pop_cfi_notes (insn, high, low);
}
void