From: Jim Meyering <jim@meyering.net>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org, java-patches@gcc.gnu.org
Subject: Re: avoid useless if-before-free tests
Date: Tue, 08 Mar 2011 10:45:00 -0000 [thread overview]
Message-ID: <87vcztriuu.fsf@rho.meyering.net> (raw)
In-Reply-To: <Pine.LNX.4.64.1103051908320.3878@digraph.polyomino.org.uk> (Joseph S. Myers's message of "Sat, 5 Mar 2011 19:16:31 +0000 (UTC)")
Joseph S. Myers wrote:
Thank you for the prompt feedback.
> On Sat, 5 Mar 2011, Jim Meyering wrote:
>
>> diff --git a/gcc/config/i386/gmm_malloc.h b/gcc/config/i386/gmm_malloc.h
>> index 7a7e840..8993fc7 100644
>> --- a/gcc/config/i386/gmm_malloc.h
>> +++ b/gcc/config/i386/gmm_malloc.h
>> @@ -67,8 +67,7 @@ _mm_malloc (size_t size, size_t align)
>> static __inline__ void
>> _mm_free (void * aligned_ptr)
>> {
>> - if (aligned_ptr)
>> - free (((void **) aligned_ptr) [-1]);
>> + free (((void **) aligned_ptr) [-1]);
>> }
>
> This one looks suspicious; it's not if (p) free (p); but if (p) free
> (something-derived-from-p);.
Good catch. That is an invalid transformation. I've reverted it.
It is also the first one like that that I've seen.
Calling free (((void **) 0) [-1]); would not go down well.
>> diff --git a/libjava/classpath/native/fdlibm/dtoa.c
>> b/libjava/classpath/native/fdlibm/dtoa.c
>> index 458e629..92aa793 100644
>
> http://gcc.gnu.org/codingconventions.html says Classpath changes should go
> via Classpath upstream, not directly into GCC. I don't know if that's
> still accurate.
Thanks for the tip and for Cc'ing java-patches.
I've omitted the classpath/ changes.
>> diff --git a/zlib/contrib/minizip/unzip.c b/zlib/contrib/minizip/unzip.c
>> index 9ad4766..644ef1b 100644
>
> We definitely don't want to make local changes to zlib for this sort of
> issue, though importing a new upstream version of zlib (making sure the
> local configure code still works) should be fine for 4.7.
I've also omitted zlib/ and intl/ changes.
Is libgo/ in the same boat? Only one of its files is affected, but
I found no ChangeLog for libgo and no libgo-related ChangeLog entries.
I could always add an entry at the top,
* libgo/runtime/go-select.c (__go_select): ...
next prev parent reply other threads:[~2011-03-08 10:45 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-05 14:06 Jim Meyering
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:17 ` Jim Meyering
2011-03-08 10:45 ` Jim Meyering [this message]
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
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:54 ` Janne Blomqvist
2011-04-15 8:18 ` Jim Meyering
2011-04-15 8:48 ` Janne Blomqvist
2011-04-15 8:56 ` Jim Meyering
2011-04-15 13:23 ` Tom Tromey
2011-04-15 18:12 ` Jim Meyering
2011-04-18 15:33 ` Jim Meyering
2011-04-18 16:32 ` Janne Blomqvist
2011-04-18 16:39 ` Jim Meyering
2011-04-18 19:59 ` Jim Meyering
2011-04-18 20:37 ` [PATCH v4] " Jim Meyering
2011-04-18 20:42 ` Tom Tromey
2011-04-18 20:43 ` Jim Meyering
2011-04-19 13:00 ` [PATCH v3] " Michael Matz
2011-04-19 16:04 ` Jim Meyering
2011-03-05 19:19 ` Joseph S. Myers
2011-03-07 22:56 ` Paolo Carlini
2011-03-08 16:34 ` Jeff Law
2011-03-09 9:39 ` Richard Guenther
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=87vcztriuu.fsf@rho.meyering.net \
--to=jim@meyering.net \
--cc=gcc-patches@gcc.gnu.org \
--cc=java-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
/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).