Bug 41683 - [4.5 Regression] F2003 Repeat specification after P descriptor rejected
Summary: [4.5 Regression] F2003 Repeat specification after P descriptor rejected
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Jerry DeLisle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-12 12:47 UTC by Jerry DeLisle
Modified: 2009-10-13 19:17 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-10-12 13:39:43


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerry DeLisle 2009-10-12 12:47:37 UTC
The polyhedron test linpk.f90 now fails with:

[ibook-dhum] lin/test% linpk
     norm. resid      resid           machep         x(1)          x(n)
At line 38 of file linpk.f90 (unit = 6, file = 'stdout')
Fortran runtime error: Comma required after P descriptor
(1P5d16.8)
   ^

Although this format is not explicitly allowed by F95, it is for F2003/2008.

gfortran allowed this in F95 previously.  Should be tied to -std= or at least -pedantic.
Comment 1 Jerry DeLisle 2009-10-12 13:39:43 UTC
Possible patch untested:

Index: io/format.c
===================================================================
--- io/format.c	(revision 152657)
+++ io/format.c	(working copy)
@@ -706,7 +706,8 @@
 	  goto data_desc;
 	}
 
-      if (t != FMT_COMMA && t != FMT_RPAREN && t != FMT_SLASH)
+      if (t != FMT_COMMA && t != FMT_RPAREN && t != FMT_SLASH
+	  && t != FMT_POSINT)
 	{
 	  fmt->error = "Comma required after P descriptor";
 	  goto finished;
Comment 2 Jerry DeLisle 2009-10-13 01:43:51 UTC
Subject: Bug 41683

Author: jvdelisle
Date: Tue Oct 13 01:43:39 2009
New Revision: 152695

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152695
Log:
2009-10-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/41683
	* io/format.c (parse_format_list): Allow a repeat specifier immediately
	after a P specifier.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/format.c

Comment 3 Jerry DeLisle 2009-10-13 02:05:43 UTC
Subject: Bug 41683

Author: jvdelisle
Date: Tue Oct 13 02:03:54 2009
New Revision: 152696

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152696
Log:
2009-10-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/41683
	* gfortran.dg/fmt_error_9.f: Add check for repeat count after P.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/fmt_error_9.f

Comment 4 Jerry DeLisle 2009-10-13 19:17:10 UTC
Fixed.
Comment 5 hjl@gcc.gnu.org 2009-10-15 21:18:14 UTC
Subject: Bug 41683

Author: hjl
Date: Thu Oct 15 21:17:36 2009
New Revision: 152870

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152870
Log:
2009-10-15  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline:
	2009-10-13  Martin Jambor  <mjambor@suse.cz>

	* gcc.c-torture/compile/pr41661.c: New test.

	2009-10-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/41683
	* gfortran.dg/fmt_error_9.f: Add check for repeat count after P.

	2009-10-12  Dodji Seketeli  <dodji@redhat.com>

	PR c++/41570
	* g++.dg/debug/dwarf2/template-params-7.C: New test.

	2009-10-11  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/41555
	* gcc.dg/torture/pr41555.c: New testcase.

	2009-10-09  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/41634
	* gcc.c-torture/compile/pr41634.c: New testcase.

	2009-10-08  Michael Matz  <matz@suse.de>

	PR middle-end/41573
	* gcc.dg/pr41573.c: New test.

	2009-10-07  Joseph Myers  <joseph@codesourcery.com>

	PR c/41182
	* gcc.c-torture/compile/pr41182-1.c: New.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C
      - copied unchanged from r152869, trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr41182-1.c
      - copied unchanged from r152869, trunk/gcc/testsuite/gcc.c-torture/compile/pr41182-1.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr41634.c
      - copied unchanged from r152869, trunk/gcc/testsuite/gcc.c-torture/compile/pr41634.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr41661.c
      - copied unchanged from r152868, trunk/gcc/testsuite/gcc.c-torture/compile/pr41661.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr41573.c
      - copied unchanged from r152869, trunk/gcc/testsuite/gcc.dg/pr41573.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/torture/pr41555.c
      - copied unchanged from r152869, trunk/gcc/testsuite/gcc.dg/torture/pr41555.c
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/fmt_error_9.f
      - copied unchanged from r152869, trunk/gcc/testsuite/gfortran.dg/fmt_error_9.f
Modified:
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog