When an alloca() is used with large auto variable area, a stack pointer is not recovered correctly.
Created attachment 11078 [details] testcase m32r-linux-gnu-gcc -S alloca.c Asm output has the following code. ; EPILOGUE ld24 r4,#32768 add sp,r4 <== NG (a stack pointer must be recovered with fp.) pop fp jmp lr
Created attachment 11079 [details] ng output NG case.
The 3.4 branch is closed, can you check 4.0.3 or 4.1.0 please?
4.0.3 and 4.1.0 have a same problem.
Changing back to new then.
Subject: Bug 26775 Author: nickc Date: Tue Apr 4 09:18:38 2006 New Revision: 112659 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112659 Log: PR target/26775 PR target/26776 * config/m32r/m32r.c (m32r_output_function_epilogue): Case for a large stack frame at epilogue. Use fp to recover a stack pointer for alloca function at epilogue. Modified: branches/gcc-4_0-branch/gcc/ChangeLog branches/gcc-4_0-branch/gcc/config/m32r/initfini.c branches/gcc-4_0-branch/gcc/config/m32r/m32r.c
Subject: Bug 26775 Author: nickc Date: Tue Apr 4 09:20:35 2006 New Revision: 112660 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112660 Log: PR target/26775 PR target/26776 * config/m32r/m32r.c (m32r_output_function_epilogue): Case for a large stack frame at epilogue. Use fp to recover a stack pointer for alloca function at epilogue. Modified: branches/gcc-3_4-branch/gcc/ChangeLog branches/gcc-3_4-branch/gcc/config/m32r/m32r.c
Fixed.