From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1693 invoked by alias); 5 Feb 2010 09:32:51 -0000 Received: (qmail 1053 invoked by alias); 5 Feb 2010 09:32:32 -0000 Date: Fri, 05 Feb 2010 09:32:00 -0000 Message-ID: <20100205093232.1052.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/42958] Weird temporary array allocation In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenther at suse dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg00352.txt.bz2 ------- Comment #3 from rguenther at suse dot de 2010-02-05 09:32 ------- Subject: Re: Weird temporary array allocation On Fri, 5 Feb 2010, pault at gcc dot gnu dot org wrote: > ------- Comment #2 from pault at gcc dot gnu dot org 2010-02-05 05:36 ------- > (In reply to comment #1) > > > Why there is a negative check? Well, I do not know. I also can speculate about > > a poor man's overflow check, which sometimes indeed works, but often fails. > > I suspect that you are being generous and that this is rather a sin of omission > rather than commission. > > > > Paul, what do you think? > > I think that your arguments are correct. > > > > > (PS: POSIX Allows "ptr = malloc(0); free(ptr)", where "malloc(0)" returns > > either NULL or a unique pointer.) > > Indeed. Btw, should there be the same error reporting or if (allocated) behavior on Frontend-generated temporaries? I see this from the temporaries generated by the scalarizer and the introduced control-flow makes it very hard to remove unnecessary temporaries in the middle-end later. Thx, Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42958