public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jim Meyering <jim@meyering.net>
To: Janne Blomqvist <blomqvist.janne@gmail.com>
Cc: "Joseph S. Myers" <joseph@codesourcery.com>,
	 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
Date: Thu, 24 Mar 2011 16:51:00 -0000	[thread overview]
Message-ID: <87ei5w8nt7.fsf@rho.meyering.net> (raw)
In-Reply-To: <AANLkTimAfkfmmfxrNp4w_wD2rGiQ7x07esgtVDT_-8Cj@mail.gmail.com>	(Janne Blomqvist's message of "Tue, 15 Mar 2011 11:19:08 +0200")

Janne Blomqvist wrote:
> On Tue, Mar 8, 2011 at 19:53, Jim Meyering <jim@meyering.net> 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 <meyering@redhat.com>
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  <meyering@redhat.com>
+
+	* 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  <tkoenig@gcc.gnu.org>

 	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

  parent reply	other threads:[~2011-03-24 16:51 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
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         ` Jim Meyering [this message]
2011-04-15  7:26           ` [PATCH v3] Re: avoid useless if-before-free tests 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=87ei5w8nt7.fsf@rho.meyering.net \
    --to=jim@meyering.net \
    --cc=blomqvist.janne@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --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).