Hi,
The problem appears in revision 201034 in version 4.9. I attached a
one-line patch that fixes it. I also reported this problem
at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57803
I bootstrapped and ran the regression tests for this patch on x86_64-linux
and all tests pass.
In method "gfc_build_dummy_array_decl()" in gcc/fortran/trans-decl.c,
the loop on line 978 should break immediately after "packed" is set to
"PACKED_PARTIAL". All the iterations after "packed" set to
"PACKED_PARTIAL" do not perform any useful work, at best they just set
"packed" again to "PACKED_PARTIAL".
Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c (revision 201034)
+++ gcc/fortran/trans-decl.c (working copy)
@@ -975,7 +975,10 @@
&& as->lower[n]
&& as->upper[n]->expr_type == EXPR_CONSTANT
&& as->lower[n]->expr_type == EXPR_CONSTANT))
- packed = PACKED_PARTIAL;
+ {
+ packed = PACKED_PARTIAL;
+ break;
+ }
}
}
else
-Chang
Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c (revision 201034)
+++ gcc/fortran/trans-decl.c (working copy)
@@ -975,7 +975,10 @@
&& as->lower[n]
&& as->upper[n]->expr_type == EXPR_CONSTANT
&& as->lower[n]->expr_type == EXPR_CONSTANT))
- packed = PACKED_PARTIAL;
+ {
+ packed = PACKED_PARTIAL;
+ break;
+ }
}
}
else