]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR libfortran/49791 (Formatted namelist reads fails with: Cannot match...
authorTobias Burnus <burnus@net-b.de>
Wed, 27 Jul 2011 21:35:08 +0000 (23:35 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Wed, 27 Jul 2011 21:35:08 +0000 (23:35 +0200)
2011-07-27  Tobias Burnus  <burnus@net-b.de>

        Backport from mainline
        2011-07-23  Tobias Burnus  <burnus@net-b.de>

        PR fortran/49791
        * io/list_read.c (nml_parse_qualifier): Remove check to
        enabled extended read for another case.

2011-07-27  Tobias Burnus  <burnus@net-b.de>

        Backported from mainline
        2011-07-23  Tobias Burnus  <burnus@net-b.de>

        PR fortran/49791
        * gfortran.dg/namelist_72.f: New.

From-SVN: r176850

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/namelist_72.f [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/io/list_read.c

index 201d6aa156af40979604f45170909b1cb58e2b6a..f1573f95307ee513ed7dcdae1cca89da13f9c9e7 100644 (file)
@@ -1,3 +1,11 @@
+2011-07-27  Tobias Burnus  <burnus@net-b.de>
+
+       Backported from mainline
+       2011-07-23  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/49791
+       * gfortran.dg/namelist_72.f: New.
+
 2011-07-27  Uros Bizjak  <ubizjak@gmail.com>
 
        * gcc.target/i386/avx-os-support.h: New.
diff --git a/gcc/testsuite/gfortran.dg/namelist_72.f b/gcc/testsuite/gfortran.dg/namelist_72.f
new file mode 100644 (file)
index 0000000..22c0880
--- /dev/null
@@ -0,0 +1,33 @@
+! { dg-do run }
+!
+! PR fortran/49791
+!
+! Contributed by Elliott Sales de Andrade
+!
+      program namelist_test
+
+      dimension xpos(5000), ypos(5000)
+      namelist /geometry/ xpos, ypos
+
+      xpos = -huge(xpos)
+      ypos = -huge(ypos)
+
+      open(unit=4,file='geometry.in')
+      write(4,'(a)') '$geometry'
+      write(4,'(a)') ' xpos(1)= 0.00, 0.10, 0.20, 0.30, 0.40,'
+      write(4,'(a)') ' ypos(1)= 0.50, 0.60, 0.70, 0.80, 0.90,'
+      write(4,'(a)') '$end'
+
+      close(4)
+
+      open (unit=4,file='geometry.in',status='old',form='formatted')
+      read (4,geometry)
+      close(4, status='delete')
+
+      !print *, 'xpos', xpos(1:10), 'ypos', ypos(1:10)
+
+      if (any (xpos(1:5) /= [0.00, 0.10, 0.20, 0.30, 0.40]))call abort()
+      if (any (ypos(1:5) /= [0.50, 0.60, 0.70, 0.80, 0.90]))call abort()
+      if (any (xpos(6:) /= -huge(xpos))) call abort ()
+      if (any (ypos(6:) /= -huge(ypos))) call abort ()
+      end
index 46c671252b85bca10a08c9f167360e0a69903f44..dfd286fe639d46375544a12ba302582768dde607 100644 (file)
@@ -1,3 +1,12 @@
+2011-07-27  Tobias Burnus  <burnus@net-b.de>
+
+       Backport from mainline
+       2011-07-23  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/49791
+       * io/list_read.c (nml_parse_qualifier): Remove check to
+       enabled extended read for another case.
+
 2011-04-28  Release Manager
 
        * GCC 4.5.3 released.
index 36e955b3458feaf9f4a529a89e98c9669f872582..14a0620b3370dece5d1aa8ab3fd82329c33ca16e 100644 (file)
@@ -2078,7 +2078,6 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
                      do not allow excess data to be processed.  */
                  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