With: gcc version 3.5-tree-ssa 20031130 (merged 20031123) test.f90 subroutine mysub dimension ibar(5) write (3,1001) ( ibar(m), m = 1, 5 ) 1001 format (/5x,' ',i4' '/ ) return end gfortran -c test.f90 -ffixed-form In file test.f90:5 1001 format (/5x,' ',i4' '/ ) 1 Error: Missing comma in format string at (1) In file test.f90:3 write (3,1001) ( ibar(m), m = 1, 5 ) 1 Error: FORMAT label 1001 at (1) not defined g77 gives a warning, but still compiles the code. Intel's compiler compiles the above code. Code like this appears in SPEC95
Confirmed.
This also appears in SPEC 2000 also in galgel (why we don't reject it on x86 I have no idea).
I have a fix which I am testing right now.
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-04/msg00874.html>.
Subject: Bug 13257 CVSROOT: /cvs/gcc Module name: gcc Changes by: pinskia@gcc.gnu.org 2005-04-09 18:44:07 Modified files: gcc/testsuite : ChangeLog libgfortran : ChangeLog libgfortran/io : format.c gcc/fortran : ChangeLog io.c Added files: gcc/testsuite/gfortran.dg: comma_format_extension_1.f comma_format_extension_2.f comma_format_extension_3.f comma_format_extension_4.f Log message: PR fortran/13257 fortran/ChangeLog: * io.c (check_format): Allow an optional comma between descriptors. libgfortran/ChangeLog: * format.c (parse_format_list): Allow an optional comma between descriptors. testsuite/ChangeLog: * comma_format_extension_[1234].f: New tests. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5311&r2=1.5312 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.184&r2=1.185 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/format.c.diff?cvsroot=gcc&r1=1.10&r2=1.11 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.384&r2=1.385 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/io.c.diff?cvsroot=gcc&r1=1.20&r2=1.21 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/comma_format_extension_1.f.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/comma_format_extension_2.f.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/comma_format_extension_3.f.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/comma_format_extension_4.f.diff?cvsroot=gcc&r1=NONE&r2=1.1
Fixed on the mainline waiting for 4.0 branch to reopen to apply there.
ping this, it looks like Andrew just missed 4.0.1 too for this bug :)
Subject: Bug 13257 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: pinskia@gcc.gnu.org 2005-07-16 20:46:23 Modified files: gcc/fortran : ChangeLog io.c gcc/testsuite : ChangeLog libgfortran : ChangeLog libgfortran/io : format.c Added files: gcc/testsuite/gfortran.dg: comma_format_extension_1.f comma_format_extension_2.f comma_format_extension_3.f comma_format_extension_4.f Log message: 2005-07-16 Andrew Pinski <pinskia@physics.uc.edu> PR fortran/13257 * io.c (check_format): Allow an optional comma between descriptors. 2005-07-16 Andrew Pinski <pinskia@physics.uc.edu> PR fortran/13257 * format.c (parse_format_list): Allow an optional comma between descriptors. 2005-07-16 Andrew Pinski <pinskia@physics.uc.edu> PR fortran/13257 * comma_format_extension_[1234].f: New tests. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.91&r2=1.335.2.92 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/io.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.19.10.6&r2=1.19.10.7 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.282&r2=1.5084.2.283 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/comma_format_extension_1.f.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.10.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/comma_format_extension_2.f.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.10.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/comma_format_extension_3.f.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.10.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/comma_format_extension_4.f.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.10.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.163.2.63&r2=1.163.2.64 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/format.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.9.12.2&r2=1.9.12.3
Fixed.