https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62044

            Bug ID: 62044
           Summary: ICE in USE statement with RENAME for extended derived
                    type
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reubendb at gmail dot com

Hello,
I am getting an internal compiler error with the following code when using
RENAME list of USE statement with extended derived type. The following reduced
source code reproduce the issue:

$ cat GridImageSilo_Template.f90 
module GridImageSilo_Template
  implicit none
  private
  type, public, abstract :: GridImageSiloTemplate
  end type GridImageSiloTemplate
end module GridImageSilo_Template

$ cat UnstructuredGridImageSilo_Form.f90 
module UnstructuredGridImageSilo_Form
  use GridImageSilo_Template
  implicit none
  private
  type, public, extends ( GridImageSiloTemplate ) :: &
    UnstructuredGridImageSiloForm
  end type UnstructuredGridImageSiloForm
end module UnstructuredGridImageSilo_Form

$ cat UnstructuredGridImages.f90 
module UnstructuredGridImages
  use UnstructuredGridImageSilo_Form, &
        UnstructuredGridImageForm => UnstructuredGridImageSiloForm
end module UnstructuredGridImages

$ cat FileSystem.f90 
module FileSystem
  use UnstructuredGridImages
end module FileSystem

And if I compile them in order:
$ gfortran -c GridImageSilo_Template.f90
$ gfortran -c UnstructuredGridImageSilo_Form.f90 
$ gfortran -c UnstructuredGridImages.f90 
$ gfortran -c FileSystem.f90 
f951: internal compiler error: Segmentation fault
0xa3184f crash_signal
        ../../gcc_trunk/gcc/toplev.c:337
0x5a5cf8 load_derived_extensions
        ../../gcc_trunk/gcc/fortran/module.c:4578
0x5a5cf8 read_module
        ../../gcc_trunk/gcc/fortran/module.c:5229
0x5a5cf8 gfc_use_module
        ../../gcc_trunk/gcc/fortran/module.c:6868
0x5a7586 gfc_use_modules()
        ../../gcc_trunk/gcc/fortran/module.c:6992
0x5af9c7 use_modules
        ../../gcc_trunk/gcc/fortran/parse.c:114
0x5b1f24 decode_statement
        ../../gcc_trunk/gcc/fortran/parse.c:329
0x5b31f9 next_free
        ../../gcc_trunk/gcc/fortran/parse.c:926
0x5b31f9 next_statement
        ../../gcc_trunk/gcc/fortran/parse.c:1121
0x5b3bbb parse_spec
        ../../gcc_trunk/gcc/fortran/parse.c:3065
0x5b6bb3 parse_module
        ../../gcc_trunk/gcc/fortran/parse.c:4757
0x5b6bb3 gfc_parse_file()
        ../../gcc_trunk/gcc/fortran/parse.c:5063
0x5f57d5 gfc_be_parse_file
        ../../gcc_trunk/gcc/fortran/f95-lang.c:212
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Here's gfortran version that I have:
$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gcc/4.10/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc_trunk/configure --prefix=/usr/local/gcc/4.10
--enable-languages=c,fortran,c++ --disable-multilib
Thread model: posix
gcc version 4.10.0 20140709 (experimental) (GCC) 

Thanks for looking into this.

Reply via email to