[Patch, Fortran] PR fortran/40850 derived type allocatables freed before their components
Mikael Morin
mikael.morin@sfr.fr
Sun Feb 20 23:54:00 GMT 2011
Hello,
an oldie bug today; not a regression, but a wrong code.
So possibly suitable for stage4.
What the patch does is use the new function `gfc_prepend_expr_to_block'
function instead of `gfc_add_expr_to_block' whose code it duplicates, with the
`front' flag of the helper `add_expr_to_chain' set to true instead of false.
The patch fixes the comment 5 in the PR, but not the rest (comment 8).
I will regression test this tomorrow; OK for trunk if it passes?
Mikael
2011-02-21 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/40850
* trans.c (gfc_prepend_expr_to_block): New function.
* trans.h (gfc_prepend_expr_to_block): Declare.
* trans-array.c (gfc_conv_array_parameter): Replace gfc_add_expr_to_block
with gfc_prepend_expr_to_block.
2011-02-21 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/40850
* gfortran.dg/nested_allocatables_1.f90: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr40850.diff
Type: text/x-patch
Size: 1965 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20110220/290e3006/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nested_allocatables_1.f90
Type: text/x-fortran
Size: 543 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20110220/290e3006/attachment-0001.bin>
More information about the Fortran
mailing list