$ cat foo.f90 ! { dg-compile } ! { dg-options "-W -Wall" } type a_t sequence integer i end type a_t
block data bd sequence common c type c_t sequence integer i end type c_t end block data bd common /a_t/ c end $ gfortran-4.1 --version GNU Fortran 95 (GCC) 4.1.2 20060901 (prerelease) (Debian 4.1.1-13) $ gfortran-4.1 -S -o foo.s foo.f90 In file foo.f90:9 block data bd 1 Error: Unexpected BLOCK DATA statement at (1) In file foo.f90:10 sequence 1 Error: Unexpected SEQUENCE statement at (1) In file foo.f90:11 common c 1 Error: Unexpected COMMON statement at (1) In file foo.f90:12 type c_t 1 Error: Unexpected derived type declaration statement at (1) In file foo.f90:13 sequence 1 Error: Unexpected SEQUENCE statement at (1) In file foo.f90:14 integer i 1 Error: Unexpected data declaration statement at (1) In file foo.f90:15 end type c_t 1 Error: Expecting END PROGRAM statement at (1) In file foo.f90:16 end block data bd 1 Error: Expecting END PROGRAM statement at (1) foo.f90:0: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>. With trunk from 20061018 this gives: Program received signal SIGSEGV, Segmentation fault. 0x08078b1a in gfc_match_common () at ../../../src/gcc-4.2.orig/gcc/fortran/match.c:2299 2299 while (old_blank_common->common_next) (gdb) bt #0 0x08078b1a in gfc_match_common () at ../../../src/gcc-4.2.orig/gcc/fortran/match.c:2299 #1 0x08083489 in match_word ( str=0x6e656d65 <Address 0x6e656d65 out of bounds>, subr=0x8078af7 <gfc_match_common>, old_locus=0xafcfc614) at ../../../src/gcc-4.2.orig/gcc/fortran/parse.c:65 #2 0x0808402e in decode_statement () at ../../../src/gcc-4.2.orig/gcc/fortran/parse.c:193 #3 0x0808439b in next_statement () at ../../../src/gcc-4.2.orig/gcc/fortran/parse.c:493 #4 0x0808630a in parse_progunit (st=<value optimized out>) at ../../../src/gcc-4.2.orig/gcc/fortran/parse.c:2910 #5 0x0808675b in gfc_parse_file () at ../../../src/gcc-4.2.orig/gcc/fortran/parse.c:3206 #6 0x080a5b29 in gfc_be_parse_file (set_yydebug=0) at ../../../src/gcc-4.2.orig/gcc/fortran/f95-lang.c:303 #7 0x082f542d in toplev_main (argc=13, argv=0xafcfc7f4) at ../../../src/gcc-4.2.orig/gcc/toplev.c:1033 #8 0x080cfc26 in main (argc=1630478446, argv=0x202f745f) at ../../../src/gcc-4.2.orig/gcc/main.c:35 -- Summary: ICE in gfc_match_common Product: gcc Version: 4.1.2 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: minor Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: aldot at gcc dot gnu dot org GCC build triplet: i686-linux-gnu GCC host triplet: i686-linux-gnu GCC target triplet: i686-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29537