On Wed, 06 Feb 2008 17:34:39 -0600
Eric Sandeen <sandeen@redhat.com> wrote:
The auto inlining is OK. The problem is that when gcc handles this:
static inline foo()
{
char a[10];
}
static inline bar()
{
char a[10];
}
zot()
{
foo();
bar();
}
it will use 20 bytes of stack instead of using the same 10 bytes for both
"calls". It doesn't need to do that, and other compilers avoid it, iirc.
Now, it _used_ to be the case that when presented with this:
foo()
{
{
char a[10];
bar(a);
}
{
char a[10];
bar(a);
}
}
gcc would also consume 20 bytes of stack. But I see that this is fixed in
gcc-4.0.3.
These two things are equivalent and hopefully gcc will soon fix the
inlined-functions-use-too-much-stack thing. Once that happens, we don't
need your patch.
yup.
--