From: Kaz Kojima Date: Mon, 20 Sep 2004 23:10:00 +0000 (+0000) Subject: sh.c (sh_expand_prologue): Add a REG_FRAME_RELATED_EXPR note to pretend a direct... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=455786b6c75af58bd20f39f00148c12562d65863;p=gcc.git sh.c (sh_expand_prologue): Add a REG_FRAME_RELATED_EXPR note to pretend a direct save from the original... * config/sh/sh.c (sh_expand_prologue): Add a REG_FRAME_RELATED_EXPR note to pretend a direct save from the original register when an intermediate register is used for the save. From-SVN: r87778 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 919059442c8..135da237ed1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-09-20 Kaz Kojima + + * config/sh/sh.c (sh_expand_prologue): Add a REG_FRAME_RELATED_EXPR + note to pretend a direct save from the original register when an + intermediate register is used for the save. + 2004-09-20 Kaveh R. Ghazi * tsystem.h (alloca): Provide a default definition. diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index c7d158cfeb6..0e98ee3ef45 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -5558,6 +5558,7 @@ sh_expand_prologue (void) enum machine_mode mode = entry->mode; int reg = entry->reg; rtx reg_rtx, mem_rtx, pre_dec = NULL_RTX; + rtx orig_reg_rtx; offset = entry->offset; @@ -5647,6 +5648,7 @@ sh_expand_prologue (void) abort (); addr_ok: + orig_reg_rtx = reg_rtx; if (TARGET_REGISTER_P (reg) || ((reg == PR_REG || SPECIAL_REGISTER_P (reg)) && mem_rtx != pre_dec)) @@ -5674,6 +5676,22 @@ sh_expand_prologue (void) /* Mark as interesting for dwarf cfi generator */ insn = emit_move_insn (mem_rtx, reg_rtx); RTX_FRAME_RELATED_P (insn) = 1; + /* If we use an intermediate register for the save, we can't + describe this exactly in cfi as a copy of the to-be-saved + register into the temporary register and then the temporary + register on the stack, because the temporary register can + have a different natural size than the to-be-saved register. + Thus, we gloss over the intermediate copy and pretend we do + a direct save from the to-be-saved register. */ + if (REGNO (reg_rtx) != reg) + { + rtx set, note_rtx; + + set = gen_rtx_SET (VOIDmode, mem_rtx, orig_reg_rtx); + note_rtx = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, set, + REG_NOTES (insn)); + REG_NOTES (insn) = note_rtx; + } if (TARGET_SHCOMPACT && (offset_in_r0 != -1)) {