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.
rtx x, reg, via_ac = NULL;
/* Deallocate the local variables. */
- if (fsize)
+ if (fsize || cfun->calls_alloca)
{
if (frame_pointer_needed)
{
--- /dev/null
+/* { 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" } } */