]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/46010 (I/O: Namelist-reading bug)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 4 Nov 2010 00:34:16 +0000 (00:34 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 4 Nov 2010 00:34:16 +0000 (00:34 +0000)
2010-11-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/46010
Backport from mainline:
* io/list_read.c (nml_parse_qualifier): Add additional conditions for
setting the end index for loop specification. Fix some whitespace.

From-SVN: r166294

libgfortran/ChangeLog
libgfortran/io/list_read.c

index 100645678f28af57535952433d158f6215331f4d..78fef049284a8f3aa4eb91ea9dafc7c1116adddc 100644 (file)
@@ -1,3 +1,10 @@
+2010-11-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/46010
+       Backport from mainline:
+       * io/list_read.c (nml_parse_qualifier): Add additional conditions for
+       setting the end index for loop specification. Fix some whitespace.
+
 2010-10-16  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        Backport from mainline:
index a52278ede8ea8af3b13b02968eb556abe216c2d6..e560f1209b92ecc69b3e47511f63c926a519c650 100644 (file)
@@ -2077,8 +2077,10 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
 
                  /*  If -std=f95/2003 or an array section is specified,
                      do not allow excess data to be processed.  */
-                  if (is_array_section == 1
-                     || compile_options.allow_std < GFC_STD_GNU)
+                 if (is_array_section == 1
+                     || !(compile_options.allow_std & GFC_STD_GNU)
+                     || !dtp->u.p.ionml->touched
+                     || dtp->u.p.ionml->type == GFC_DTYPE_DERIVED)
                    ls[dim].end = ls[dim].start;
                  else
                    dtp->u.p.expanded_read = 1;
@@ -2093,12 +2095,12 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
        }
 
       if (is_array_section == 1 && dtp->u.p.expanded_read == 1)
-       {
+       {
          int i;
          dtp->u.p.expanded_read = 0;
          for (i = 0; i < dim; i++)
            ls[i].end = ls[i].start;
-       }
+       }
 
       /* Check the values of the triplet indices.  */
       if ((ls[dim].start > (ssize_t)ad[dim].ubound)