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

            Bug ID: 94380
           Summary: Nested associate+select type blocks cause compiler
                    segfault
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lockywolf at gmail dot com
  Target Milestone: ---

>>cat bugreport2.f90
module test
  type testtype
     class(*), allocatable :: t
  end type testtype
contains
  subroutine testproc( x )
    class(testtype) :: x
    associate ( temp => x%t)
      select type (temp)
         type is (integer)
      end select
    end associate
  end subroutine testproc
end module test

>> gfortran -v -save-temps
-Wall -Wextra bugreport2.f90
Driving: gfortran -v -save-temps -Wall -Wextra bugreport2.f90 -l
gfortran -l m -shared-libgcc
Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/9.3.0/specs
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/9.3.0/lto-wrapper
Target: x86_64-slackware-linux
Configured with: ../gcc-9.3.0/configure --prefix=/usr
--libdir=/usr/lib64 --mandir=/usr/man --infodir=/usr/info
--enable-shared --enable-bootstrap
--enable-languages=ada,brig,c,c++,d,fortran,go,lto,objc,obj-c++
--enable-threads=posix --enable-checking=release --enable-objc-gc
--with-system-zlib --enable-libstdcxx-dual-abi
--with-default-libstdcxx-abi=new --disable-libstdcxx-pch
--disable-libunwind-exceptions --enable-__cxa_atexit --disable-libssp
--enable-gnu-unique-object --enable-plugin --enable-lto
--disable-install-libiberty --enable-gnu-indirect-function
--with-linker-hash-style=gnu --with-gnu-ld --with-isl --verbose
--with-arch-directory=amd64 --disable-gtktest --disable-werror
--enable-clocale=gnu --enable-multilib --target=x86_64-slackware-linux
--build=x86_64-slackware-linux --host=x86_64-slackware-linux
Thread model: posix
gcc version 9.3.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-Wextra'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-slackware-linux/9.3.0/f951 bugreport2.f90
-quiet -dumpbase bugreport2.f90 -mtune=generic -march=x86-64 -auxbase
bugreport2 -Wall -Wextra -version -fintrinsic-modules-path
/usr/lib64/gcc/x86_64-slackware-linux/9.3.0/finclude
-fpre-include=/usr/include/finclude/math-vector-fortran.h -o
bugreport2.s
GNU Fortran (GCC) version 9.3.0 (x86_64-slackware-linux)
    compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version
4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran2008 (GCC) version 9.3.0 (x86_64-slackware-linux)
    compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version
4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
f951: internal compiler error: Segmentation fault

No preprocessed source is generated.

SELECT TYPE can be used in
the "associate form", which does not crash. But nevertheless,
message-less segfault seems to be a bug.

Reply via email to