This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR middle-end/65958
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 18 Nov 2015 16:22:22 +0100
- Subject: Re: [patch] Fix PR middle-end/65958
- Authentication-results: sourceware.org; auth=none
- References: <1750746 dot G8iFFmz9eE at polaris> <1948174 dot ZHELUNJJpu at polaris> <CAFiYyc3KutSELxKYaPOysjsTs0u7aiAizGDP9O6FHLTCuM_jJw at mail dot gmail dot com> <2236493 dot 73iOXXXDxp at polaris>
On Wed, Nov 18, 2015 at 3:28 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Looks good to me. I also found the Arrays of Variable Length section
>> in extend.texi which also refers to alloca as doing the same. We may
>> want to add a note there that you should not mix both and that only
>> VLAs (when not mixed with alloca) are freed at scope boundary.
>
> It's already there and in fact the current behavior is documented:
>
> There are other differences between these two methods. Space allocated
> with `alloca' exists until the containing _function_ returns. The
> space for a variable-length array is deallocated as soon as the array
> name's scope ends. (If you use both variable-length arrays and
> `alloca' in the same function, deallocation of a variable-length array
> also deallocates anything more recently allocated with `alloca'.)
>
> so we need to amend the documentation if we go for the patch.
Ah. I think the patch is good and we should reflect this in the
documentation.
Richard.
> --
> Eric Botcazou