This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]