[Bug target/32577] [SH] static inline attribute causes stack overflow
kkojima at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Jul 2 14:21:00 GMT 2007
------- Comment #1 from kkojima at gcc dot gnu dot org 2007-07-02 14:21 -------
I don't think that this is a bug. Without optimization, all
intermediate variables can be allocated on stack. It's the case
even on other architectures. The test case #2 is compiled to
pushl %ebp
movl %esp, %ebp
subl $16, %esp
movl y, %edx
movl x, %eax
movl %eax, -12(%ebp)
on x86 with -O0 and if you added two more x = add(x,y); lines to
#2, you got
pushl %ebp
movl %esp, %ebp
subl $32, %esp
movl y, %edx
movl x, %eax
movl %eax, -28(%ebp)
i.e. more invocations of inline functions requires more intermediate
variables and stack area. Reducing the number of such variables or
using hardware registers for them if possible is already an optimization
and is not expected with -O0.
--
kkojima at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |WONTFIX
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32577
More information about the Gcc-bugs
mailing list