xtensa: fix PR target/90922

Message ID 20190618212715.10938-1-jcmvbkbc@gmail.com
State New
Headers show
Series
  • xtensa: fix PR target/90922
Related show

Commit Message

Max Filippov June 18, 2019, 9:27 p.m.
Stack pointer adjustment code in prologue missed a case of no
callee-saved registers and a stack frame size bigger than 128 bytes.
Handle that case.

This fixes the following gcc tests with call0 ABI:
  gcc.c-torture/execute/stdarg-2.c
  gcc.dg/torture/pr55882.c
  gcc.dg/torture/pr57569.c

2019-06-18  Max Filippov  <jcmvbkbc@gmail.com>
gcc/
	* config/xtensa/xtensa.c (xtensa_expand_prologue): Add stack
	pointer adjustment for the case of no callee-saved registers and
	stack frame bigger than 128 bytes.
---
 gcc/config/xtensa/xtensa.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.11.0

Comments

augustine.sterling@gmail.com June 18, 2019, 10:09 p.m. | #1
On Tue, Jun 18, 2019 at 2:27 PM Max Filippov <jcmvbkbc@gmail.com> wrote:
>

> Stack pointer adjustment code in prologue missed a case of no

> callee-saved registers and a stack frame size bigger than 128 bytes.

> Handle that case.

>

> This fixes the following gcc tests with call0 ABI:

>   gcc.c-torture/execute/stdarg-2.c

>   gcc.dg/torture/pr55882.c

>   gcc.dg/torture/pr57569.c


Approved, please apply.
Max Filippov June 18, 2019, 10:23 p.m. | #2
On Tue, Jun 18, 2019 at 3:09 PM augustine.sterling@gmail.com
<augustine.sterling@gmail.com> wrote:
>

> On Tue, Jun 18, 2019 at 2:27 PM Max Filippov <jcmvbkbc@gmail.com> wrote:

> >

> > Stack pointer adjustment code in prologue missed a case of no

> > callee-saved registers and a stack frame size bigger than 128 bytes.

> > Handle that case.

> >

> > This fixes the following gcc tests with call0 ABI:

> >   gcc.c-torture/execute/stdarg-2.c

> >   gcc.dg/torture/pr55882.c

> >   gcc.dg/torture/pr57569.c

>

> Approved, please apply.


Thanks. Applied to trunk.
I'll backport it later to gcc-7..9 branches.

-- 
Thanks.
-- Max
Max Filippov Sept. 23, 2019, 7:59 a.m. | #3
On Tue, Jun 18, 2019 at 3:23 PM Max Filippov <jcmvbkbc@gmail.com> wrote:
>

> On Tue, Jun 18, 2019 at 3:09 PM augustine.sterling@gmail.com

> <augustine.sterling@gmail.com> wrote:

> >

> > On Tue, Jun 18, 2019 at 2:27 PM Max Filippov <jcmvbkbc@gmail.com> wrote:

> > >

> > > Stack pointer adjustment code in prologue missed a case of no

> > > callee-saved registers and a stack frame size bigger than 128 bytes.

> > > Handle that case.

> > >

> > > This fixes the following gcc tests with call0 ABI:

> > >   gcc.c-torture/execute/stdarg-2.c

> > >   gcc.dg/torture/pr55882.c

> > >   gcc.dg/torture/pr57569.c

> >

> > Approved, please apply.

>

> Thanks. Applied to trunk.

> I'll backport it later to gcc-7..9 branches.


I've committed the backported versions to gcc-7..9 branches.

-- 
Thanks.
-- Max

Patch

diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 19bd616d67f6..ee5612441e25 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -2865,7 +2865,8 @@  xtensa_expand_prologue (void)
 			    gen_rtx_SET (mem, reg));
 	    }
 	}
-      if (total_size > 1024)
+      if (total_size > 1024
+	  || (!callee_save_size && total_size > 128))
 	{
 	  rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG);
 	  emit_move_insn (tmp_reg, GEN_INT (total_size -