pdp11: Fix epilogue generation [PR107841]
gcc/ PR target/107841 * config/pdp11/pdp11.cc (pdp11_expand_epilogue): Also deallocate alloca-only frame. gcc/testsuite/ PR target/107841 * gcc.target/pdp11/pr107841.c: New test.
This commit is contained in:
parent
ae862e0e47
commit
8f1a26ee25
2 changed files with 13 additions and 1 deletions
|
@ -393,7 +393,7 @@ pdp11_expand_epilogue (void)
|
|||
rtx x, reg, via_ac = NULL;
|
||||
|
||||
/* Deallocate the local variables. */
|
||||
if (fsize)
|
||||
if (fsize || cfun->calls_alloca)
|
||||
{
|
||||
if (frame_pointer_needed)
|
||||
{
|
||||
|
|
12
gcc/testsuite/gcc.target/pdp11/pr107841.c
Normal file
12
gcc/testsuite/gcc.target/pdp11/pr107841.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2" } */
|
||||
|
||||
/* Verify that the stack frame is deallocated using the frame pointer. */
|
||||
|
||||
void qq (int a)
|
||||
{
|
||||
char *s = __builtin_alloca (128);
|
||||
__builtin_sprintf (s, "qq %d", 3);
|
||||
}
|
||||
|
||||
/* { dg-final { scan-assembler "mov\tr5,sp" } } */
|
Loading…
Add table
Reference in a new issue