This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/58817] optimize alloca with constant size
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 Oct 2013 08:36:07 +0000
- Subject: [Bug tree-optimization/58817] optimize alloca with constant size
- Auto-submitted: auto-generated
- References: <bug-58817-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58817
--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #1)
> Transforming VLAs that way isn't a good idea, at least if the size isn't
> really small, at least when the VLA isn't in a scope that dies at the
> function's end (or if there is a chance the function might be inlined
> because of that optimization). Because, unlike normal alloca, VLAs are
> deallocated already when leading the scope they were declared in, and tons
> of programs rely on that deallocation, otherwise you might have too big
> stack requirements.
Currently we are turning VLAs into regular arrays, but not alloca. From your
explanations, I understand we should basically do the converse? (do it for
alloca but not VLA)