Hmm don't VLA's obey the same lifetime rules as regular automatic arrays on the stack?
On Mon, Nov 18, 2013 at 11:48 AM, Jakub Jelinek <ja...@redhat.com> wrote: > On Mon, Nov 18, 2013 at 11:22:22AM -0800, Hendrik Greving wrote: >> Interesting, I just read up on it and I didn't know that. Thanks. Is >> it correct to say though that it is a missing optimization and >> frame_pointer_needed shouldn't evaluate to true? > > Certainly not unconditionally. It depends on the size and in which scope > it is declared. If user meant to use a VLA and compiler optimizes it into > non-VLA, then it isn't deallocated at the end of it's scope, so if it e.g. > is very large or there are many of those, the optimization can break valid > programs (especially if it's scope isn't the function scope but some smaller > scope). > > Jakub