https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93701
Bug ID: 93701 Summary: ICE on associate of wrongly accessed array Product: gcc Version: 9.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: simon_brass at gmx dot de Target Milestone: --- Created attachment 47822 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47822&action=edit Reproducer file for the ICE using associate and array statements. I've got the following ICE report appearing in the attached file. * Error message f951: internal compiler error: find_array_spec(): Missing spec * Source Code / Reproducer The source code *is* erroneous, therefore, should not compile, however, it should fail with an error message. The error appears within: > associate (state => obj%state(TEST_STATES)) > state%a = a > state(TEST_STATE)%a = a > end associate where state can be either of intrinsic or derived type. The compiler should complain on the third line and TEST_STATES, the latter should be TEST_STATE. Exchanging the second and third line, or correcting the name of TEST_STATES to TEST_STATE (removed the S at the end), leads then to a correct error message by the compiler. * Build command gfortran -c ice-gfortran.f90 -o ice-gfortran.o Also, tried: gfortran -Wall -Wextra -c ../test/ice-gfortran.f90 -o ice-gfortran.o gfortran -Wall -Wextra -fno-strict-aliasing -fwrapv -c ../test/ice-gfortran.f90 -o ice-gfortran.o * Output of gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-pkgversion='Arch Linux 9.2.1+20200130-2' --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-shared --enable-threads=posix --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-cet=auto gdc_include_dir=/usr/include/dlang/gdc Thread model: posix gcc version 9.2.1 20200130 (Arch Linux 9.2.1+20200130-2)