public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ian Lance Taylor <iant@google.com>
Cc: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>,
	Jim Meyering <jim@meyering.net>,
	       "Joseph S. Myers" <joseph@codesourcery.com>,
	gcc-patches@gcc.gnu.org,        java-patches@gcc.gnu.org
Subject: Re: [PATCH v2] Re: avoid useless if-before-free tests
Date: Tue, 08 Mar 2011 15:36:00 -0000	[thread overview]
Message-ID: <20110308153632.GB30899@tyan-ft48-01.lab.bos.redhat.com> (raw)
In-Reply-To: <mcrr5ahtyvu.fsf@google.com>

On Tue, Mar 08, 2011 at 07:28:37AM -0800, Ian Lance Taylor wrote:
> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> 
> >> I found no ChangeLog for libgo and no other libgo-related entries.
> >> I suspect that means I should omit this change because it belongs upstream.
> >
> > Indeed, cf. libgo/README*.  I've Cc'ed Ian who maintains this part of
> > GCC.
> 
> Yes, libgo is upstream but in any case I'd prefer that you not make the
> change to libgo/runtime/go-select.c.  I'm aware that free (NULL) is a
> no-op but I wrote the code that way because it is extremely unlikely
> that allocated_buffer != NULL.  I am simply inlining the common case.
> Thanks.

I guess such reason is sometimes legitimate, but it would be nice (and
better for generated code) to make it explicit in that case, i.e.
	if (__builtin_expect (allocated_buffer != NULL, 0))
		free (allocated_buffer);
could be a sign for anyone coming after Jim that this case is on purpose
and should be left as is.
allocated_buffer != NULL is normally predicted as true, not false.

	Jakub

  reply	other threads:[~2011-03-08 15:36 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87zkp9zmq0.fsf@rho.meyering.net>
2011-03-05 19:16 ` Joseph S. Myers
2011-03-07 19:52   ` Dr Andrew John Hughes
2011-03-07 22:47     ` Joseph S. Myers
2011-03-08 16:57       ` Dr Andrew John Hughes
2011-03-08 17:07         ` Andrew Haley
2011-03-08 17:17         ` Jim Meyering
2011-03-08 10:45   ` Jim Meyering
2011-03-08 14:21   ` [PATCH v2] " Jim Meyering
2011-03-08 14:30     ` Rainer Orth
2011-03-08 15:28       ` Ian Lance Taylor
2011-03-08 15:36         ` Jakub Jelinek [this message]
2011-03-08 17:03       ` Jim Meyering
2011-03-08 18:45         ` Rainer Orth
2011-03-08 19:13           ` Jim Meyering
2011-03-08 19:20             ` Rainer Orth
2011-03-08 19:39               ` Jakub Jelinek
2011-03-08 17:54     ` [PATCH v3] " Jim Meyering
2011-03-08 19:34       ` DJ Delorie
2011-03-15  9:19       ` Janne Blomqvist
2011-03-15 10:03         ` [PATCH gcc/fortran] get rid of gfc_free Jim Meyering
2011-03-15 10:08           ` Jakub Jelinek
2011-03-15 10:27             ` Jim Meyering
2011-03-15 14:18           ` Janne Blomqvist
2011-03-15 18:21             ` Jim Meyering
2011-03-24 16:51         ` [PATCH v3] Re: avoid useless if-before-free tests Jim Meyering
2011-04-15  7:26           ` Janne Blomqvist
2011-04-15  7:54             ` Jim Meyering
2011-04-15  8:20               ` Janne Blomqvist
2011-04-15  8:23                 ` Jim Meyering
2011-04-15 13:20                 ` Tom Tromey
2011-04-15 17:52                   ` Jim Meyering

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=20110308153632.GB30899@tyan-ft48-01.lab.bos.redhat.com \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iant@google.com \
    --cc=java-patches@gcc.gnu.org \
    --cc=jim@meyering.net \
    --cc=joseph@codesourcery.com \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    /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).