https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100892
Bug ID: 100892 Summary: ICE on procedure pointer to function returning array of size n Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: daniel.price at monash dot edu Target Milestone: --- Created attachment 50920 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50920&action=edit test code Attached code shows test case giving ICE on associated(ptr, func) if the function returns an array of size(n), where n is an input to the function: ``` module testmodule implicit none procedure(func1), pointer :: my_ptr => null() contains subroutine test_sub if (associated(my_ptr, func1)) print*,'associated' end subroutine test_sub function func1(n) integer, intent(in) :: n real, dimension(n) :: func1 end function end module testmodule ``` compiling this gives: % gfortran -c test-ice.f90 -o test-ice.o f951: internal compiler error: Segmentation fault: 11 Please submit a full bug report, with preprocessed source if appropriate. Checked with gfortran v11.1.0 via Homebrew on Mac OS: % gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/11.1.0_1/libexec/gcc/x86_64-apple-darwin20/11.1.0/lto-wrapper Target: x86_64-apple-darwin20 Configured with: ../configure --prefix=/usr/local/Cellar/gcc/11.1.0_1 --libdir=/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran,d --program-suffix=-11 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-zstd=/usr/local/opt/zstd --with-pkgversion='Homebrew GCC 11.1.0_1' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --enable-libphobos --build=x86_64-apple-darwin20 --with-system-zlib --disable-multilib --without-build-config --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.1.0 (Homebrew GCC 11.1.0_1) Cheers, Daniel