summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2007-03-15 06:44:25 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2007-03-15 06:44:25 +0000
commit096d4ad965f3a571d7b223a076fabe87d07994bc (patch)
tree5cb4c73baa1e5f429a60e96974501d4c438fcd54 /gcc/fortran/trans-array.c
parentf96273b619200047da26b62ee44f8003f57d0475 (diff)
downloadgcc-096d4ad965f3a571d7b223a076fabe87d07994bc.tar.gz
2007-03-15 Tobias Burnus <burnus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org> PR fortran/30922 * decl.c (gfc_match_import): If the parent of the current name- space is null, try looking for an imported symbol in the parent of the proc_name interface. * resolve.c (resolve_fl_variable): Do not check for blocking of host association by a same symbol, if the symbol is in an interface body. 2007-03-15 Paul Thomas <pault@gcc.gnu.org> PR fortran/30879 * decl.c (match_data_constant): Before going on to try to match a name, try to match a structure component. PR fortran/30870 * resolve.c (resolve_actual_arglist): Do not reject a generic actual argument if it has a same name specific interface. PR fortran/31163 * trans-array.c (parse_interface): Do not nullify allocatable components if the symbol has the saved attribute. 2007-03-15 Paul Thomas <pault@gcc.gnu.org> PR fortran/30922 * gfortran.dg/import5.f90.f90: New test. PR fortran/30879 * gfortran.dg/data_components_1.f90: New test. PR fortran/30870 * gfortran.dg/generic_13.f90: New test. PR fortran/31163 * gfortran.dg/alloc_comp_basics_5.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122944 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 5d413310735..00e54c830ce 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -5216,9 +5216,12 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body)
if (sym_has_alloc_comp && !(sym->attr.pointer || sym->attr.allocatable))
{
- rank = sym->as ? sym->as->rank : 0;
- tmp = gfc_nullify_alloc_comp (sym->ts.derived, descriptor, rank);
- gfc_add_expr_to_block (&fnblock, tmp);
+ if (!sym->attr.save)
+ {
+ rank = sym->as ? sym->as->rank : 0;
+ tmp = gfc_nullify_alloc_comp (sym->ts.derived, descriptor, rank);
+ gfc_add_expr_to_block (&fnblock, tmp);
+ }
}
else if (!GFC_DESCRIPTOR_TYPE_P (type))
{
@@ -5239,7 +5242,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body)
/* Allocatable arrays need to be freed when they go out of scope.
The allocatable components of pointers must not be touched. */
if (sym_has_alloc_comp && !(sym->attr.function || sym->attr.result)
- && !sym->attr.pointer)
+ && !sym->attr.pointer && !sym->attr.save)
{
int rank;
rank = sym->as ? sym->as->rank : 0;