From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23387 invoked by alias); 8 Mar 2011 10:45:44 -0000 Received: (qmail 23369 invoked by uid 22791); 8 Mar 2011 10:45:42 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx.meyering.net (HELO mx.meyering.net) (82.230.74.64) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Mar 2011 10:45:34 +0000 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id CB8106029C; Tue, 8 Mar 2011 11:45:29 +0100 (CET) From: Jim Meyering To: "Joseph S. Myers" Cc: gcc-patches@gcc.gnu.org, java-patches@gcc.gnu.org Subject: Re: avoid useless if-before-free tests In-Reply-To: (Joseph S. Myers's message of "Sat, 5 Mar 2011 19:16:31 +0000 (UTC)") References: <87zkp9zmq0.fsf@rho.meyering.net> Date: Tue, 08 Mar 2011 10:45:00 -0000 Message-ID: <87vcztriuu.fsf@rho.meyering.net> MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2011-q1/txt/msg00050.txt.bz2 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): ...