* [Bug libfortran/29101] memory leak in libgfortran
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 ` 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
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-09-16 1:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from jvdelisle at gcc dot gnu dot org 2006-09-16 01:28 -------
Confirmed: As can be seen here. We are allocating, but not freeing pstr.6
{
char[1:D.960] * pstr.6;
int4 D.960;
int4 D.959;
char[1:_input] & D.958;
static struct _jump_struct jumptable.5[2] = {{.string1=0B, .string1_len=0,
.string2=0B, .string2_len=0, .target=&L.3}, {.string1="x", .string1_len=1,
.string2="x", .string2_len=1, .target=&L.4}};
D.958 = input;
D.959 = _input;
D.960 = D.959;
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);
L.4:;
*value = 1;
goto L.5;
L.3:;
__result_validate_value = 0;
goto L.5;
L.5:;
}
return __result_validate_value;
--
jvdelisle at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-09-16 01:28:58
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/29101] Memory leak in gfortran
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 ` jvdelisle at gcc dot gnu dot org
2006-09-18 6:53 ` pault at gcc dot gnu dot org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-09-17 20:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jvdelisle at gcc dot gnu dot org 2006-09-17 20:14 -------
Problem is not in library side.
--
jvdelisle at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|libfortran |fortran
Summary|memory leak in libgfortran |Memory leak in gfortran
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/29101] Memory leak in gfortran
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
2006-09-18 7:50 ` pault at gcc dot gnu dot org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-09-18 6:53 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/29101] Memory leak in gfortran
2006-09-15 19:59 [Bug libfortran/29101] New: memory leak in libgfortran franke dot daniel at gmail dot com
` (2 preceding siblings ...)
2006-09-18 6:53 ` pault at gcc dot gnu dot org
@ 2006-09-18 7:50 ` pault at gcc dot gnu dot org
2006-09-18 17:15 ` patchapp at dberlin dot org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-09-18 7:50 UTC (permalink / raw)
To: gcc-bugs
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pault at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2006-09-16 01:28:58 |2006-09-18 07:49:56
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/29101] Memory leak in gfortran
2006-09-15 19:59 [Bug libfortran/29101] New: memory leak in libgfortran franke dot daniel at gmail dot com
` (3 preceding siblings ...)
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
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: patchapp at dberlin dot org @ 2006-09-18 17:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from patchapp at dberlin dot org 2006-09-18 17:15 -------
Subject: Bug number PR29101
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00715.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/29101] Memory leak in gfortran
2006-09-15 19:59 [Bug libfortran/29101] New: memory leak in libgfortran franke dot daniel at gmail dot com
` (4 preceding siblings ...)
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
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-09-18 19:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pault at gcc dot gnu dot org 2006-09-18 19:29 -------
Thanks Steven, it was just too obvious, wasn't it?
Index: gcc/fortran/trans-stmt.c
===================================================================
--- gcc/fortran/trans-stmt.c (revision 117030)
+++ gcc/fortran/trans-stmt.c (working copy)
@@ -1475,6 +1475,8 @@
if (n != 0)
gfc_free (labels);
+ gfc_add_block_to_block (&block, &se.post);
+
return gfc_finish_block (&block);
now gives
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);
L.4:;
*value = 1;
goto L.5;
L.3:;
__result_validate_value = 0;
goto L.5;
L.5:;
_gfortran_internal_free ((void *) pstr.6);
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |stevenb dot gcc at gmail dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/29101] Memory leak in gfortran
2006-09-15 19:59 [Bug libfortran/29101] New: memory leak in libgfortran franke dot daniel at gmail dot com
` (5 preceding siblings ...)
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
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-09-18 20:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pault at gcc dot gnu dot org 2006-09-18 20:20 -------
Subject: Bug 29101
Author: pault
Date: Mon Sep 18 20:19:50 2006
New Revision: 117034
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117034
Log:
2006-09-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28526
* primary.c (match_variable): If the compiler is in a module
specification block, an interface block or a contains section,
reset host_flag to force the changed symbols mechanism.
PR fortran/29101
* trans-stmt.c (gfc_trans_character_select): Add the post block
for the expression to the main block, after the call to
select_string and the last label.
2006-09-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28526
* gfortran.dg/keyword_symbol_1.f90: New test.
* gfortran.dg/spread_shape_1.f90: Add missing warning with
pedantic compilation option.
Added:
trunk/gcc/testsuite/gfortran.dg/keyword_symbol_1.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/primary.c
trunk/gcc/fortran/trans-stmt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/spread_shape_1.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/29101] Memory leak in gfortran
2006-09-15 19:59 [Bug libfortran/29101] New: memory leak in libgfortran franke dot daniel at gmail dot com
` (6 preceding siblings ...)
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
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-09-18 22:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pault at gcc dot gnu dot org 2006-09-18 22:24 -------
Fixed on trunk and 4.1
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/29101] Memory leak in gfortran
2006-09-15 19:59 [Bug libfortran/29101] New: memory leak in libgfortran franke dot daniel at gmail dot com
` (7 preceding siblings ...)
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
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: steven at gcc dot gnu dot org @ 2006-09-18 22:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from steven at gcc dot gnu dot org 2006-09-18 22:35 -------
Not fixed just yet.
--
steven at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/29101] Memory leak in gfortran
2006-09-15 19:59 [Bug libfortran/29101] New: memory leak in libgfortran franke dot daniel at gmail dot com
` (8 preceding siblings ...)
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
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-09-19 11:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pault at gcc dot gnu dot org 2006-09-19 11:05 -------
Subject: Bug 29101
Author: pault
Date: Tue Sep 19 11:04:55 2006
New Revision: 117053
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117053
Log:
2006-09-19 Paul Thomas <pault@gcc.gnu.org>
Steven Bosscher <steven@gcc.gnu.org>
PR fortran/29101
* trans-stmt.c (gfc_trans_character_select): Store the label
from select_string and then clean up any temporaries from the
conversion of the select expression, before branching to the
selected case.
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-stmt.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/29101] Memory leak in gfortran
2006-09-15 19:59 [Bug libfortran/29101] New: memory leak in libgfortran franke dot daniel at gmail dot com
` (9 preceding siblings ...)
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
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-09-19 11:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from pault at gcc dot gnu dot org 2006-09-19 11:24 -------
Subject: Bug 29101
Author: pault
Date: Tue Sep 19 11:24:44 2006
New Revision: 117054
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117054
Log:
2006-09-19 Paul Thomas <pault@gcc.gnu.org>
Steven Bosscher <steven@gcc.gnu.org>
PR fortran/29101
* trans-stmt.c (gfc_trans_character_select): Store the label
from select_string and then clean up any temporaries from the
conversion of the select expression, before branching to the
selected case.
Modified:
branches/gcc-4_1-branch/gcc/fortran/ChangeLog
branches/gcc-4_1-branch/gcc/fortran/trans-stmt.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/29101] Memory leak in gfortran
2006-09-15 19:59 [Bug libfortran/29101] New: memory leak in libgfortran franke dot daniel at gmail dot com
` (10 preceding siblings ...)
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
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-09-19 11:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from pault at gcc dot gnu dot org 2006-09-19 11:26 -------
Thanks to Steven's intervention, I can declare this bug well and truly closed.
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/29101] Memory leak in gfortran
2006-09-15 19:59 [Bug libfortran/29101] New: memory leak in libgfortran franke dot daniel at gmail dot com
` (11 preceding siblings ...)
2006-09-19 11:26 ` pault at gcc dot gnu dot org
@ 2006-09-19 11:56 ` paulthomas2 at wanadoo dot fr
12 siblings, 0 replies; 14+ messages in thread
From: paulthomas2 at wanadoo dot fr @ 2006-09-19 11:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from paulthomas2 at wanadoo dot fr 2006-09-19 11:56 -------
Subject: Re: Memory leak in gfortran
steven at gcc dot gnu dot org wrote:
>------- Comment #8 from steven at gcc dot gnu dot org 2006-09-18 22:35 -------
>Not fixed just yet.
>
>
>
>
Steven, I put it to rights this time. Thanks for your help. Can I lean
on you in future, please? I have been talking to myself of late.
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101
^ permalink raw reply [flat|nested] 14+ messages in thread