From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25873 invoked by alias); 24 Mar 2011 16:51:10 -0000 Received: (qmail 25848 invoked by uid 22791); 24 Mar 2011 16:51:09 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,TW_BG,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; Thu, 24 Mar 2011 16:51:02 +0000 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id D8B3B60279; Thu, 24 Mar 2011 17:51:00 +0100 (CET) From: Jim Meyering To: Janne Blomqvist Cc: "Joseph S. Myers" , gcc-patches@gcc.gnu.org, java-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: Re: [PATCH v3] Re: avoid useless if-before-free tests In-Reply-To: (Janne Blomqvist's message of "Tue, 15 Mar 2011 11:19:08 +0200") References: <87zkp9zmq0.fsf@rho.meyering.net> <877hc9r8w6.fsf_-_@rho.meyering.net> <877hc9pkhp.fsf_-_@rho.meyering.net> Date: Thu, 24 Mar 2011 16:51:00 -0000 Message-ID: <87ei5w8nt7.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/msg00092.txt.bz2 Janne Blomqvist wrote: > On Tue, Mar 8, 2011 at 19:53, Jim Meyering wrote: >> Relative to v2, I've added libgo/ to the list of exempt directories and added >> this recently discussed gfc_free patch, at the request of Tobias Burnus. >> Also, I corrected an error in fortran's ChangeLog and removed all >> whitespace changes from all ChangeLog files. > > The libgfortran changes are Ok for 4.7. > > For the gfortran frontend (gcc/fortran/*) I'd prefer if you'd > > - Replace all calls to "gfc_free (x)" with "free (x)". > - Remove the gfc_free() function and prototype. > - Remove the free() macro which currently prevents calling free() directly. Following up, I've refreshed the series but hit a minor snag while converting new uses of gfc_free, removing new tests-before-free and merging/reordering changes. Applying this fix first makes my problem go away: >From 77142dc7da9e1e11ef8b0c554df4ff5c1bbdda39 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 24 Mar 2011 17:45:42 +0100 Subject: [PATCH] gfortran: remove unneeded test-before-gfc_free * trans-openmp.c (gfc_trans_omp_reduction_list): Do not guard use of gfc_free; it can handle a NULL argument. --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/trans-openmp.c | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4e0a792..c532986 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2011-03-24 Jim Meyering + + * trans-openmp.c (gfc_trans_omp_reduction_list): Do not guard + use of gfc_free; it can handle a NULL argument. + 2010-03-21 Thomas Koenig PR fortran/22572 diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 53eb999..77ed3bb 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -714,8 +714,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where) gfc_free (symtree1); gfc_free (symtree2); gfc_free (symtree3); - if (symtree4) - gfc_free (symtree4); + gfc_free (symtree4); gfc_free_array_spec (outer_sym.as); } -- 1.7.4.1.686.g46300