public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/42958] Weird temporary array allocation
Date: Fri, 05 Feb 2010 14:24:00 -0000 [thread overview]
Message-ID: <20100205142348.21521.qmail@sourceware.org> (raw)
In-Reply-To: <bug-42958-10053@http.gcc.gnu.org/bugzilla/>
------- Comment #4 from rguenth at gcc dot gnu dot org 2010-02-05 14:23 -------
(In reply to comment #3)
> 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.
Thus, basically adding an argument to gfc_call_malloc () specifying
whether we want to do checking at all and shortcut it from at least
gfc_trans_allocate_array_storage ().
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42958
next prev parent reply other threads:[~2010-02-05 14:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-04 16:56 [Bug fortran/42958] New: " rguenth at gcc dot gnu dot org
2010-02-04 19:33 ` [Bug fortran/42958] " burnus at gcc dot gnu dot org
2010-02-05 5:36 ` pault at gcc dot gnu dot org
2010-02-05 9:32 ` rguenther at suse dot de
2010-02-05 14:24 ` rguenth at gcc dot gnu dot org [this message]
2010-02-17 20:17 ` jvdelisle at gcc dot gnu dot org
2010-02-20 8:31 ` burnus at gcc dot gnu dot org
2010-03-27 18:55 ` pault at gcc dot gnu dot org
2010-03-27 19:06 ` rguenth at gcc dot gnu dot org
2010-03-27 19:06 ` rguenth at gcc dot gnu dot org
2010-03-27 19:08 ` rguenth at gcc dot gnu dot org
2010-03-27 19:12 ` rguenth at gcc dot gnu dot org
2010-03-28 12:57 ` burnus at gcc dot gnu dot org
2010-03-28 13:05 ` burnus at gcc dot gnu dot org
2010-03-28 13:57 ` burnus at gcc dot gnu dot org
2010-03-28 14:11 ` burnus at gcc dot gnu dot org
2010-03-28 14:45 ` rguenther at suse dot de
2010-04-16 8:18 ` burnus at gcc dot gnu dot org
2010-04-28 14:52 ` rguenth at gcc dot gnu dot org
2010-04-28 15:16 ` amonakov at gcc dot gnu dot org
2010-04-28 15:20 ` jv244 at cam dot ac dot uk
2010-04-28 15:43 ` jb at gcc dot gnu dot org
2010-04-29 10:02 ` paul dot richard dot thomas at gmail dot com
2010-04-29 13:19 ` jakub at gcc dot gnu dot org
2010-04-29 19:09 ` tkoenig at gcc dot gnu dot org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100205142348.21521.qmail@sourceware.org \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).