This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: alloca + inline
- From: dewar at gnat dot com (Robert Dewar)
- To: dewar at gnat dot com, sxanth at ceid dot upatras dot gr
- Cc: gcc at gcc dot gnu dot org, neil at daikokuya dot co dot uk
- Date: Sun, 16 Mar 2003 09:44:02 -0500 (EST)
- Subject: Re: alloca + inline
> So we can make this the standard behaviour:
>
> Inline functions that use alloca don't
> get inlined, but if the programmer
> specifies always_inline then it's
> guaranteed that the stack is preserved.
>
> Ok with everybody?
Well as has been pointed out, this is actually a really rather peculiar
language extension. To me the barrier for language extensions is far
higher than defining undefined behavior in certain cases. I would need
to see this extension worked out in full standard language and carefully
evaluated. It seems dubious to me.
Certainly I agree that the most natural option is 4), which is that the
storage should always be reclaimed regardless of whether the function is
inlined. I agree that it seems a bug if this is not the case, given the
clear language that describes alloca.