* [Patch, Fortran, committed] Free loop and gfc_ss data
@ 2012-08-22 5:57 Tobias Burnus
2012-08-22 9:41 ` Mikael Morin
0 siblings, 1 reply; 2+ messages in thread
From: Tobias Burnus @ 2012-08-22 5:57 UTC (permalink / raw)
To: gcc patches, gfortran
[-- Attachment #1: Type: text/plain, Size: 373 bytes --]
Committed as Rev. 190586 after successful regtesting.
That's the version I also had attached to
http://gcc.gnu.org/ml/fortran/2012-08/msg00118.html; as written there:
"The patch is incomplete, e.g. "argss" of gfc_conv_procedure_call is not
(or not always) freed. Ditto for rss of gfc_trans_assignment_1; ditto
for lss and rss of gfc_trans_pointer_assignment."
Tobias
[-- Attachment #2: committed.diff --]
[-- Type: text/x-patch, Size: 1997 bytes --]
Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c (Revision 190585)
+++ gcc/fortran/trans-expr.c (Arbeitskopie)
@@ -533,6 +533,7 @@ gfc_copy_class_to_class (tree from, tree to, tree
loop.to[0] = nelems;
gfc_trans_scalarizing_loops (&loop, &loopbody);
gfc_add_block_to_block (&body, &loop.pre);
+ gfc_cleanup_loop (&loop);
tmp = gfc_finish_block (&body);
}
else
@@ -6770,6 +6771,7 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_
if (!expr2->value.function.isym)
{
realloc_lhs_loop_for_fcn_call (&se, &expr1->where, &ss, &loop);
+ gfc_cleanup_loop (&loop);
ss->is_alloc_lhs = 1;
}
else
@@ -6778,6 +6780,7 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_
gfc_conv_function_expr (&se, expr2);
gfc_add_block_to_block (&se.pre, &se.post);
+ gfc_free_ss (se.ss);
return gfc_finish_block (&se.pre);
}
Index: gcc/fortran/trans-intrinsic.c
===================================================================
--- gcc/fortran/trans-intrinsic.c (Revision 190585)
+++ gcc/fortran/trans-intrinsic.c (Arbeitskopie)
@@ -1328,6 +1328,7 @@ gfc_conv_intrinsic_rank (gfc_se *se, gfc_expr *exp
argse.descriptor_only = 1;
gfc_conv_expr_descriptor (&argse, expr->value.function.actual->expr, ss);
+ gfc_free_ss (ss);
gfc_add_block_to_block (&se->pre, &argse.pre);
gfc_add_block_to_block (&se->post, &argse.post);
Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog (Revision 190585)
+++ gcc/fortran/ChangeLog (Arbeitskopie)
@@ -1,3 +1,9 @@
+2012-08-22 Tobias Burnus <burnus@net-b.de>
+
+ * trans-expr.c (gfc_copy_class_to_class,
+ gfc_trans_arrayfunc_assign): Free loop and ss data.
+ * trans-intrinsic.c (gfc_trans_arrayfunc_assign): Free ss data.
+
2012-08-21 Tobias Burnus <burnus@net-b.de>
* parse.c (parse_contained): Include EXEC_END_PROCEDURE
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Patch, Fortran, committed] Free loop and gfc_ss data
2012-08-22 5:57 [Patch, Fortran, committed] Free loop and gfc_ss data Tobias Burnus
@ 2012-08-22 9:41 ` Mikael Morin
0 siblings, 0 replies; 2+ messages in thread
From: Mikael Morin @ 2012-08-22 9:41 UTC (permalink / raw)
To: Tobias Burnus; +Cc: gcc patches, gfortran
Hello,
On 22/08/2012 07:56, Tobias Burnus wrote:
> Committed as Rev. 190586 after successful regtesting.
>
> That's the version I also had attached to
> http://gcc.gnu.org/ml/fortran/2012-08/msg00118.html; as written there:
I have one minor comment about it. See below.
>
> "The patch is incomplete, e.g. "argss" of gfc_conv_procedure_call is not
> (or not always) freed. Ditto for rss of gfc_trans_assignment_1;
From glancing at the code, I don't see why rss is not freed by
gfc_cleanup_loop for the latter.
> Index: gcc/fortran/trans-expr.c
> ===================================================================
> --- gcc/fortran/trans-expr.c (Revision 190585)
> +++ gcc/fortran/trans-expr.c (Arbeitskopie)
> @@ -6770,6 +6771,7 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_
> if (!expr2->value.function.isym)
> {
> realloc_lhs_loop_for_fcn_call (&se, &expr1->where, &ss, &loop);
> + gfc_cleanup_loop (&loop);
> ss->is_alloc_lhs = 1;
> }
> else
This takes care of freeing ss along the way, but ss should be freed
outside of the conditional too.
Mikael
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-22 9:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-22 5:57 [Patch, Fortran, committed] Free loop and gfc_ss data Tobias Burnus
2012-08-22 9:41 ` Mikael Morin
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).