Re: [PATCH] reduce large do_mount stack usage with noinlines

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Eric Sandeen <sandeen@...>
Cc: <linux-kernel@...>
Date: Wednesday, February 6, 2008 - 7:46 pm

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.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] reduce large do_mount stack usage with noinlines, Arjan van de Ven, (Thu Feb 7, 7:23 pm)
Re: [PATCH] reduce large do_mount stack usage with noinlines, Andrew Morton, (Wed Feb 6, 7:46 pm)
Re: [PATCH] reduce large do_mount stack usage with noinlines, Arjan van de Ven, (Wed Feb 6, 6:54 pm)