When I compile and run the following program under gfortran 4.5 I get a segfault. It does not segfault under gfortran 4.3 or 4.4. The problem occurs on any platform. PROGRAM astap ARLXCA = 0.0 WRITE(6,40) ARLXCA WRITE(6,40) ARLXCA 40 FORMAT(T4,"ARLXCA = ",1PG13.6,T27,"ARLXCC = ",G13.6,T53, . "ATMPCA = ",G13.6,T79,"ATMPCC = ",G13.6,T105, . "BACKUP = ",G13.6,/, . T4,"CSGFAC = ",G13.6,T27,"CSGMAX = ",G13.6,T53, . "CSGMIN = ",G13.6,T79,"DRLXCA = ",G13.6,T105, . "DRLXCC = ",G13.6,/, . T4,"DTIMEH = ",G13.6,T27,"DTIMEI = ",G13.6,T53, . "DTIMEL = ",G13.6,T79,"DTIMEU = ",G13.6,T105, . "DTMPCA = ",G13.6,/, . T4,"DTMPCC = ",G13.6,T27,"EBALNA = ",G13.6,T53, . "EBALNC = ",G13.6,T79,"EBALSA = ",G13.6,T105, . "EBALSC = ",G13.6) END PROGRAM astap
This seems to be fixed by the patch in comment #33 of pr40330.
Yes indeed it is fixed with my patch of this morning. This is the reduced test case we can use for the test suite. Thanks for the report Michael!
(In reply to comment #1) > This seems to be fixed by the patch in comment #33 of pr40330. > Removing the 1st occurrence of T27 in the format is sufficient to remove the segfault.
Subject: Bug 40662 Author: jvdelisle Date: Thu Jul 9 01:20:23 2009 New Revision: 149398 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149398 Log: 2009-07-08 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/40330 PR libfortran/40662 * io/io.h (st_parameter_dt): Define format_not_saved bit used to signal whether the parsed format data was previously saved. Used to determine if the current format data should be freed or not. * io/transfer.c (st_read_done): Use the format_not_saved bit. (st_write_done): Likewise. * io/format.c (parse_format_list): Add boolean pointer to arg list. This pointer is used to return status to the caller regarding whether it is safe to cache the parsed format data. Currently, if a FMT_STRING token is encounetered, it is not safe to cache. Also, added a local boolean variable to hold this information as recursive calls to parse_format_list are made. Remove previous save_format logic. (parse_format): Do not use the format caching facility if the current unit is an internal unit or if it is not safe to save parsed format data. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/format.c trunk/libgfortran/io/io.h trunk/libgfortran/io/transfer.c
Subject: Bug 40662 Author: jvdelisle Date: Thu Jul 9 01:54:47 2009 New Revision: 149399 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149399 Log: 2009-07-08 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/40330 PR libfortran/40662 * gfortran.dg/fmt_cache_1.f: New test. Added: trunk/gcc/testsuite/gfortran.dg/fmt_cache_1.f Modified: trunk/gcc/testsuite/ChangeLog
Fixed on trunk.
Subject: Bug 40662 Author: hjl Date: Thu Jul 23 17:50:56 2009 New Revision: 150020 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=150020 Log: 2009-07-23 H.J. Lu <hongjiu.lu@intel.com> Backport from mainline: 2009-07-22 Richard Guenther <rguenther@suse.de> PR c++/40799 * g++.dg/lookup/using21.C: New testcase. 2009-07-19 Jan Hubicka <jh@suse.cz> PR tree-optimization/40676 * gcc.c-torture/compile/pr40676.c: New testcase. 2009-07-15 Richard Guenther <rguenther@suse.de> PR middle-end/40753 * gcc.c-torture/compile/pr40753.c: New testcase. 2009-07-14 Dodji Seketeli <dodji@redhat.com> PR debug/40705 * g++.dg/debug/dwarf2/typedef1.C: New test. PR c++/40357 * g++.dg/other/typedef3.C: New test. 2009-07-10 Richard Guenther <rguenther@suse.de> PR tree-optimization/40496 * g++.dg/opt/pr40496.C: New testcase. 2009-07-09 Jakub Jelinek <jakub@redhat.com> PR middle-end/40692 * gcc.c-torture/compile/pr40692.c: New test. 2009-07-08 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/40330 PR libfortran/40662 * gfortran.dg/fmt_cache_1.f: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/debug/dwarf2/typedef1.C - copied unchanged from r150018, trunk/gcc/testsuite/g++.dg/debug/dwarf2/typedef1.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/lookup/using21.C - copied unchanged from r150018, trunk/gcc/testsuite/g++.dg/lookup/using21.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/opt/pr40496.C - copied unchanged from r150018, trunk/gcc/testsuite/g++.dg/opt/pr40496.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/other/typedef3.C - copied unchanged from r150018, trunk/gcc/testsuite/g++.dg/other/typedef3.C branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr40676.c - copied unchanged from r150018, trunk/gcc/testsuite/gcc.c-torture/compile/pr40676.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr40692.c - copied unchanged from r150018, trunk/gcc/testsuite/gcc.c-torture/compile/pr40692.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr40753.c - copied unchanged from r150018, trunk/gcc/testsuite/gcc.c-torture/compile/pr40753.c branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/fmt_cache_1.f - copied unchanged from r150018, trunk/gcc/testsuite/gfortran.dg/fmt_cache_1.f Modified: branches/gcc-4_4-branch/gcc/testsuite/ChangeLog