------- 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

Reply via email to