Commit f8b68ed3 by Richard Earnshaw Committed by Richard Earnshaw

re PR target/42321 (NEON/VFP registers from inline assembly clobber list are…

re PR target/42321 (NEON/VFP registers from inline assembly clobber list are saved/restored incorrectly)

	PR target/42321
	* arm.c (arm_output_epilogue): Correctly match VFP pop instructions
	with their corresponding prologue pushes.

From-SVN: r157609
parent 474b97ce
2010-03-21 Richard Earnshaw <rearnsha@arm.com>
PR target/42321
* arm.c (arm_output_epilogue): Correctly match VFP pop instructions
with their corresponding prologue pushes.
2010-03-20 Andrew Pinski <pinskia@gmail.com> 2010-03-20 Andrew Pinski <pinskia@gmail.com>
PR target/43156 PR target/43156
......
...@@ -13731,24 +13731,29 @@ arm_output_epilogue (rtx sibling) ...@@ -13731,24 +13731,29 @@ arm_output_epilogue (rtx sibling)
if (TARGET_HARD_FLOAT && TARGET_VFP) if (TARGET_HARD_FLOAT && TARGET_VFP)
{ {
start_reg = FIRST_VFP_REGNUM; int end_reg = LAST_VFP_REGNUM + 1;
for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2)
/* Scan the registers in reverse order. We need to match
any groupings made in the prologue and generate matching
pop operations. */
for (reg = LAST_VFP_REGNUM - 1; reg >= FIRST_VFP_REGNUM; reg -= 2)
{ {
if ((!df_regs_ever_live_p (reg) || call_used_regs[reg]) if ((!df_regs_ever_live_p (reg) || call_used_regs[reg])
&& (!df_regs_ever_live_p (reg + 1) || call_used_regs[reg + 1])) && (!df_regs_ever_live_p (reg + 1)
|| call_used_regs[reg + 1]))
{ {
if (start_reg != reg) if (end_reg > reg + 2)
vfp_output_fldmd (f, SP_REGNUM, vfp_output_fldmd (f, SP_REGNUM,
(start_reg - FIRST_VFP_REGNUM) / 2, (reg + 2 - FIRST_VFP_REGNUM) / 2,
(reg - start_reg) / 2); (end_reg - (reg + 2)) / 2);
start_reg = reg + 2; end_reg = reg;
} }
} }
if (start_reg != reg) if (end_reg > reg + 2)
vfp_output_fldmd (f, SP_REGNUM, vfp_output_fldmd (f, SP_REGNUM, 0,
(start_reg - FIRST_VFP_REGNUM) / 2, (end_reg - (reg + 2)) / 2);
(reg - start_reg) / 2);
} }
if (TARGET_IWMMXT) if (TARGET_IWMMXT)
for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++) for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++)
if (df_regs_ever_live_p (reg) && !call_used_regs[reg]) if (df_regs_ever_live_p (reg) && !call_used_regs[reg])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment