Commit 544a4843 by Claudiu Zissulescu Committed by Claudiu Zissulescu

[ARC] Fix millicode wrong blink restore.

The blink is restored wrongly when using millicode and regular load
instructions.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.c (arc_restore_callee_milli) Don't clobber off
	variable.

testsuite/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* gcc.target/arc/milli-1.c: New test.

From-SVN: r267129
parent d77aa5cd
2018-12-14 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.c (arc_restore_callee_milli) Don't clobber off
variable.
2018-12-14 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.h (reg_class): Add SIBCALL_REGS.
2018-12-14 Richard Biener <rguenther@suse.de>
......@@ -3597,9 +3597,7 @@ arc_restore_callee_milli (unsigned int gmask,
insn = frame_insn (insn);
/* Add DWARF info. */
for (regno = start_reg, off = 0;
regno <= end_reg;
regno++, off += UNITS_PER_WORD)
for (regno = start_reg; regno <= end_reg; regno++)
{
reg = gen_rtx_REG (SImode, regno);
add_reg_note (insn, REG_CFA_RESTORE, reg);
......
2018-12-14 Claudiu Zissulescu <claziss@synopsys.com>
* gcc.target/arc/milli-1.c: New test.
2018-12-13 Michael Ploujnikov <michael.ploujnikov@oracle.com>
* gcc.dg/lto/pr88297_0.c: New test.
......
/* { dg-do compile } */
/* { dg-options "-Os" } */
/* Test if we restore correctly blink when using millicode. */
extern void bar (void);
void foo (void)
{
__asm__ volatile ( "" : : : "r13","r14","r15","r16","r17","r18","r20","r21");
bar();
}
void foo2 (void)
{
bar();
__asm__ volatile ( "" : : : "r13","r14","r15","r16","r17","r18","r20","r21");
}
/* { dg-final { scan-assembler-not "st.*r13,\\\[sp" } } */
/* { dg-final { scan-assembler-not "st.*r14,\\\[sp" } } */
/* { dg-final { scan-assembler-not "st.*r15,\\\[sp" } } */
/* { dg-final { scan-assembler "ld.*blink,\\\[sp,32" } } */
/* { dg-final { scan-assembler "mov_s.*r12,32" } } */
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