This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/29539] New: ICE in variable_decl

According to lahey's web checker, this is legal code:

$ cat foo.f90 
! { dg-compile }
! { dg-options "-W -Wall" }

block data
  common /c/ d(5)
  data d /5*1./
  type c_t
    integer i
  end type c_t
  type (c_t) :: cc ! bugger

It ICEs with 4.1.2 20060901 (prerelease).

bt with 4.2:

(gdb) run
Starting program: /opt/gcc-4.2/lib/gcc/i686-linux-gnu/4.2.0/f951 foo.f90 -quiet
-dumpbase foo.f90 -mtune=generic -auxbase-strip foo.s -W -Wall -version -o
foo.s -I /opt/gcc-4.2/bin/../lib/gcc/i686-linux-gnu/4.2.0/finclude
GNU F95 version 4.2.0 20061019 (experimental) (i686-linux-gnu)
        compiled by GNU C version 4.2.0 20061019 (experimental).
GGC heuristics: --param ggc-min-expand=94 --param ggc-min-heapsize=121333

Program received signal SIGSEGV, Segmentation fault.
0x0805a5e0 in variable_decl (elem=<value optimized out>)
    at ../../../src/gcc-4.2/gcc/fortran/decl.c:1201
1201      if (current_ts.type == BT_DERIVED
(gdb) bt
#0  0x0805a5e0 in variable_decl (elem=<value optimized out>)
    at ../../../src/gcc-4.2/gcc/fortran/decl.c:1201
#1  0x0805ae4f in gfc_match_data_decl ()
    at ../../../src/gcc-4.2/gcc/fortran/decl.c:2356
#2  0x08083519 in match_word (str=0x0, subr=0x805adc9 <gfc_match_data_decl>, 
    old_locus=0xafa27a74) at ../../../src/gcc-4.2/gcc/fortran/parse.c:65
#3  0x08083aa0 in decode_statement ()
    at ../../../src/gcc-4.2/gcc/fortran/parse.c:134
#4  0x0808442b in next_statement ()
    at ../../../src/gcc-4.2/gcc/fortran/parse.c:493
#5  0x08085e3f in parse_spec (st=ST_DERIVED_DECL)
    at ../../../src/gcc-4.2/gcc/fortran/parse.c:1878
#6  0x08086911 in gfc_parse_file ()
    at ../../../src/gcc-4.2/gcc/fortran/parse.c:3025
#7  0x080a5db9 in gfc_be_parse_file (set_yydebug=0)
    at ../../../src/gcc-4.2/gcc/fortran/f95-lang.c:303
#8  0x082f5d6d in toplev_main (argc=15, argv=0xafa27d14)
    at ../../../src/gcc-4.2/gcc/toplev.c:1033
#9  0x080cffe6 in main (argc=Cannot access memory at address 0x0
) at ../../../src/gcc-4.2/gcc/main.c:35

           Summary: ICE in variable_decl
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]