public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pault at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/29101] Memory leak in gfortran
Date: Mon, 18 Sep 2006 06:53:00 -0000 [thread overview]
Message-ID: <20060918065323.26111.qmail@sourceware.org> (raw)
In-Reply-To: <bug-29101-6552@http.gcc.gnu.org/bugzilla/>
------- Comment #3 from pault at gcc dot gnu dot org 2006-09-18 06:53 -------
(In reply to comment #2)
> Problem is not in library side.
>
Jerry,
This is an easy one: Somebody forgot to add the post block for the evaluation
of the select expression to the block of code, for the specific case of
character expressions.
This
Index: gcc/fortran/trans-stmt.c
===================================================================
*** gcc/fortran/trans-stmt.c (revision 117013)
--- gcc/fortran/trans-stmt.c (working copy)
*************** gfc_trans_character_select (gfc_code *co
*** 1467,1472 ****
--- 1467,1474 ----
tmp = build1 (GOTO_EXPR, void_type_node, tmp);
gfc_add_expr_to_block (&block, tmp);
+ gfc_add_block_to_block (&block, &se.post);
+
tmp = gfc_finish_block (&body);
gfc_add_expr_to_block (&block, tmp);
tmp = build1_v (LABEL_EXPR, end_label);
fixes it by producing the code:
pstr.6 = (char[1:D.960] *) _gfortran_internal_malloc (D.960);
tolower (pstr.6, D.960, D.958, D.959);
goto _gfortran_select_string ((void *) &jumptable.5, 2, &L.5, pstr.6,
D.960);
_gfortran_internal_free ((void *) pstr.6);
L.4:;
*value = 1;
goto L.5;
L.3:;
__result_validate_value = 0;
goto L.5;
L.5:;
I am not going to be in a position to do anything about this for two weeks -
"I'm on the road again...". I can submit it today; if it is determined to be
essential to get into the 4.2 release, could you do the honors with the commit?
Are there any more such constructs in fortran that take a character expression?
I could not immediately think of any.
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jvdelisle at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
next prev parent reply other threads:[~2006-09-18 6:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-15 19:59 [Bug libfortran/29101] New: memory leak in libgfortran franke dot daniel at gmail dot com
2006-09-16 1:29 ` [Bug libfortran/29101] " jvdelisle at gcc dot gnu dot org
2006-09-17 20:14 ` [Bug fortran/29101] Memory leak in gfortran jvdelisle at gcc dot gnu dot org
2006-09-18 6:53 ` pault at gcc dot gnu dot org [this message]
2006-09-18 7:50 ` pault at gcc dot gnu dot org
2006-09-18 17:15 ` patchapp at dberlin dot org
2006-09-18 19:29 ` pault at gcc dot gnu dot org
2006-09-18 20:20 ` pault at gcc dot gnu dot org
2006-09-18 22:24 ` pault at gcc dot gnu dot org
2006-09-18 22:35 ` steven at gcc dot gnu dot org
2006-09-19 11:05 ` pault at gcc dot gnu dot org
2006-09-19 11:25 ` pault at gcc dot gnu dot org
2006-09-19 11:26 ` pault at gcc dot gnu dot org
2006-09-19 11:56 ` paulthomas2 at wanadoo dot fr
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=20060918065323.26111.qmail@sourceware.org \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/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).