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=57804
Bootstrap and regression-tested on x86_64-linux.
In method "gfc_trans_transfer()" in gcc/fortran/trans-io.c, the loop
on line 2261 should break immediately after "seen_vector" is set to
"true".
2013-07-23 Chang <pcha...@cs.wisc.edu>
* trans-io.c (gfc_trans_transfer): Exit loop after
setting seen_vector.
Index: gcc/fortran/trans-io.c
===================================================================
--- gcc/fortran/trans-io.c (revision 201034)
+++ gcc/fortran/trans-io.c (working copy)
@@ -2260,7 +2260,10 @@
{
for (n = 0; n < ref->u.ar.dimen; n++)
if (ref->u.ar.dimen_type[n] == DIMEN_VECTOR)
- seen_vector = true;
+ {
+ seen_vector = true;
+ break;
+ }
}
if (seen_vector && last_dt == READ)
-Chang
Index: gcc/fortran/trans-io.c
===================================================================
--- gcc/fortran/trans-io.c (revision 201034)
+++ gcc/fortran/trans-io.c (working copy)
@@ -2260,7 +2260,10 @@
{
for (n = 0; n < ref->u.ar.dimen; n++)
if (ref->u.ar.dimen_type[n] == DIMEN_VECTOR)
- seen_vector = true;
+ {
+ seen_vector = true;
+ break;
+ }
}
if (seen_vector && last_dt == READ)