From 869936ae61d92855fd1c44bb1c603a71ea83717d Mon Sep 17 00:00:00 2001 From: zqchen Date: Wed, 2 Apr 2014 06:45:59 +0000 Subject: [PATCH] gcc/ 2014-04-02 Zhenqiang Chen Backport from trunk r208511 2014-03-12 Christian Bruel PR target/60264 * config/arm/arm.c (arm_emit_vfp_multi_reg_pop): Emit a REG_CFA_DEF_CFA note. (arm_expand_epilogue_apcs_frame): call arm_add_cfa_adjust_cfa_note. (arm_unwind_emit): Allow REG_CFA_DEF_CFA. gcc/testsuite/ 2014-04-02 Zhenqiang Chen Backport from trunk r208511 2014-03-12 Christian Bruel PR target/60264 * gcc.target/arm/pr60264.c git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro@209009 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc-4_8-branch/gcc/ChangeLog.linaro | 11 ++++++++ gcc-4_8-branch/gcc/config/arm/arm.c | 33 ++++++++++++++++------ gcc-4_8-branch/gcc/testsuite/ChangeLog.linaro | 8 ++++++ .../gcc/testsuite/gcc.target/arm/pr60264.c | 12 ++++++++ 4 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 gcc-4_8-branch/gcc/testsuite/gcc.target/arm/pr60264.c diff --git a/gcc-4_8-branch/gcc/ChangeLog.linaro b/gcc-4_8-branch/gcc/ChangeLog.linaro index 2b59b746c76..d6e53a5380e 100644 --- a/gcc-4_8-branch/gcc/ChangeLog.linaro +++ b/gcc-4_8-branch/gcc/ChangeLog.linaro @@ -1,3 +1,14 @@ +2014-04-02 Zhenqiang Chen + + Backport from trunk r208511 + 2014-03-12 Christian Bruel + + PR target/60264 + * config/arm/arm.c (arm_emit_vfp_multi_reg_pop): Emit a + REG_CFA_DEF_CFA note. + (arm_expand_epilogue_apcs_frame): call arm_add_cfa_adjust_cfa_note. + (arm_unwind_emit): Allow REG_CFA_DEF_CFA. + 2014-02-14 Yvan Roux * LINARO-VERSION: Bump version. diff --git a/gcc-4_8-branch/gcc/config/arm/arm.c b/gcc-4_8-branch/gcc/config/arm/arm.c index 36defc0428b..c3eacdd21bf 100644 --- a/gcc-4_8-branch/gcc/config/arm/arm.c +++ b/gcc-4_8-branch/gcc/config/arm/arm.c @@ -17435,8 +17435,15 @@ arm_emit_vfp_multi_reg_pop (int first_reg, int num_regs, rtx base_reg) par = emit_insn (par); REG_NOTES (par) = dwarf; - arm_add_cfa_adjust_cfa_note (par, 2 * UNITS_PER_WORD * num_regs, - base_reg, base_reg); + /* Make sure cfa doesn't leave with IP_REGNUM to allow unwinding fron FP. */ + if (TARGET_VFP && REGNO (base_reg) == IP_REGNUM) + { + RTX_FRAME_RELATED_P (par) = 1; + add_reg_note (par, REG_CFA_DEF_CFA, hard_frame_pointer_rtx); + } + else + arm_add_cfa_adjust_cfa_note (par, 2 * UNITS_PER_WORD * num_regs, + base_reg, base_reg); } /* Generate and emit a pattern that will be recognized as LDRD pattern. If even @@ -24573,15 +24580,19 @@ arm_expand_epilogue_apcs_frame (bool really_return) if (TARGET_HARD_FLOAT && TARGET_VFP) { int start_reg; + rtx ip_rtx = gen_rtx_REG (SImode, IP_REGNUM); /* The offset is from IP_REGNUM. */ int saved_size = arm_get_vfp_saved_size (); if (saved_size > 0) { + rtx insn; floats_from_frame += saved_size; - emit_insn (gen_addsi3 (gen_rtx_REG (SImode, IP_REGNUM), - hard_frame_pointer_rtx, - GEN_INT (-floats_from_frame))); + insn = emit_insn (gen_addsi3 (ip_rtx, + hard_frame_pointer_rtx, + GEN_INT (-floats_from_frame))); + arm_add_cfa_adjust_cfa_note (insn, -floats_from_frame, + ip_rtx, hard_frame_pointer_rtx); } /* Generate VFP register multi-pop. */ @@ -24654,11 +24665,15 @@ arm_expand_epilogue_apcs_frame (bool really_return) num_regs = bit_count (saved_regs_mask); if ((offsets->outgoing_args != (1 + num_regs)) || cfun->calls_alloca) { + rtx insn; emit_insn (gen_blockage ()); /* Unwind the stack to just below the saved registers. */ - emit_insn (gen_addsi3 (stack_pointer_rtx, - hard_frame_pointer_rtx, - GEN_INT (- 4 * num_regs))); + insn = emit_insn (gen_addsi3 (stack_pointer_rtx, + hard_frame_pointer_rtx, + GEN_INT (- 4 * num_regs))); + + arm_add_cfa_adjust_cfa_note (insn, - 4 * num_regs, + stack_pointer_rtx, hard_frame_pointer_rtx); } arm_emit_multi_reg_pop (saved_regs_mask); @@ -26645,11 +26660,11 @@ arm_unwind_emit (FILE * asm_out_file, rtx insn) emit unwind information for it because these are used either for pretend arguments or notes to adjust sp and restore registers from stack. */ + case REG_CFA_DEF_CFA: case REG_CFA_ADJUST_CFA: case REG_CFA_RESTORE: return; - case REG_CFA_DEF_CFA: case REG_CFA_EXPRESSION: case REG_CFA_OFFSET: /* ??? Only handling here what we actually emit. */ diff --git a/gcc-4_8-branch/gcc/testsuite/ChangeLog.linaro b/gcc-4_8-branch/gcc/testsuite/ChangeLog.linaro index fc5724a6871..6c0bc429c10 100644 --- a/gcc-4_8-branch/gcc/testsuite/ChangeLog.linaro +++ b/gcc-4_8-branch/gcc/testsuite/ChangeLog.linaro @@ -1,3 +1,11 @@ +2014-04-02 Zhenqiang Chen + + Backport from trunk r208511 + 2014-03-12 Christian Bruel + + PR target/60264 + * gcc.target/arm/pr60264.c + 2014-03-11 Yvan Roux GCC Linaro 4.8-2014.03 released. diff --git a/gcc-4_8-branch/gcc/testsuite/gcc.target/arm/pr60264.c b/gcc-4_8-branch/gcc/testsuite/gcc.target/arm/pr60264.c new file mode 100644 index 00000000000..4fe6aedb273 --- /dev/null +++ b/gcc-4_8-branch/gcc/testsuite/gcc.target/arm/pr60264.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-mapcs -g" } */ + +double bar(void); + +int foo(void) +{ + int i = bar() + bar(); + + return i; +} + -- 2.11.4.GIT