From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106082 invoked by alias); 18 Nov 2015 15:22:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 106072 invoked by uid 89); 18 Nov 2015 15:22:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_05,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f177.google.com Received: from mail-yk0-f177.google.com (HELO mail-yk0-f177.google.com) (209.85.160.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 18 Nov 2015 15:22:24 +0000 Received: by ykba77 with SMTP id a77so68691293ykb.2 for ; Wed, 18 Nov 2015 07:22:22 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.46.76 with SMTP id u73mr383948ywu.147.1447860142438; Wed, 18 Nov 2015 07:22:22 -0800 (PST) Received: by 10.37.93.11 with HTTP; Wed, 18 Nov 2015 07:22:22 -0800 (PST) In-Reply-To: <2236493.73iOXXXDxp@polaris> References: <1750746.G8iFFmz9eE@polaris> <1948174.ZHELUNJJpu@polaris> <2236493.73iOXXXDxp@polaris> Date: Wed, 18 Nov 2015 15:22:00 -0000 Message-ID: Subject: Re: [patch] Fix PR middle-end/65958 From: Richard Biener To: Eric Botcazou Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg02229.txt.bz2 On Wed, Nov 18, 2015 at 3:28 PM, Eric Botcazou 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