This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/14236] dynamically-sized arrays break alloca()
- From: "jsm at polyomino dot org dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Feb 2004 10:56:35 -0000
- Subject: [Bug middle-end/14236] dynamically-sized arrays break alloca()
- References: <20040221103623.14236.aoliva@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jsm at polyomino dot org dot uk 2004-02-21 10:56 -------
Subject: Re: New: dynamically-sized arrays break
alloca()
On Sat, 21 Feb 2004, aoliva at gcc dot gnu dot org wrote:
> If the same block contains a dynamically-sized array and alloca() calls, we
> release the memory allocated for both at the end of the block. Oops. This
> occurs in GCC 3.3.3, 3.4 CVS, mainline CVS and tree-ssa CVS (oh, and GCC 2.96 as
> well, but you don't want to know about that :-)
So where's the bug in this? It looks just like what the documentation
says:
# (If you use both variable-length arrays and
# @code{alloca} in the same function, deallocation of a variable-length array
# will also deallocate anything more recently allocated with @code{alloca}.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14236