This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [10 PATCHES] inline functions to avoid stack overflow
- From: "Bart Van Assche" <bart dot vanassche at gmail dot com>
- To: "David Miller" <davem at davemloft dot net>
- Cc: mpatocka at redhat dot com, helge dot hafting at aitel dot hist dot no, sparclinux at vger dot kernel dot org, linux-kernel at vger dot kernel dot org, gcc at gcc dot gnu dot org
- Date: Thu, 26 Jun 2008 08:32:35 +0200
- Subject: Re: [10 PATCHES] inline functions to avoid stack overflow
- References: <Pine.LNX.4.64.0806240136200.27784@engineering.redhat.com> <486216E7.8000002@aitel.hist.no> <Pine.LNX.4.64.0806250843460.20379@engineering.redhat.com> <20080625.150931.182895076.davem@davemloft.net>
On Thu, Jun 26, 2008 at 12:09 AM, David Miller <davem@davemloft.net> wrote:
> From: Mikulas Patocka <mpatocka@redhat.com>
> Date: Wed, 25 Jun 2008 08:53:10 -0400 (EDT)
>
>> Even worse, gcc doesn't use these additional bytes. If you try this:
>>
>> extern void f(int *i);
>> void g()
>> {
>> int a;
>> f(&a);
>> }
>>
>> , it allocates additional 16 bytes for the variable "a" (so there's total
>> 208 bytes), even though it could place the variable into 48-byte
>> ABI-mandated area that it inherited from the caller or into it's own
>> 16-byte padding that it made when calling "f".
>
> The extra 16 bytes of space allocated is so that GCC can perform a
> secondary reload of a quad floating point value. It always has to be
> present, because we can't satisfy a secondary reload by emitting yet
> another reload, it's the end of the possible level of recursions
> allowed by the reload pass.
Is there any floating-point code present in the Linux kernel ? Would
it be a good idea to add an option to gcc that tells gcc that the
compiled code does not contain floating-point instructions, such that
gcc knows that no space has to be provided for a quad floating point
value ?
Bart.