https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92360
Bug ID: 92360 Summary: internal compiler error: in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4273 Product: gcc Version: 9.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: save1my1mail at gmail dot com Target Milestone: --- Hello, The compilation of source x.f90 (see below) fails when the compiler is run in the following way: $ gfortran -c -O3 -fexternal-blas x.f90 f951: internal compiler error: in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4273 Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.archlinux.org/> for instructions. Additional notes: (i) This has been tested on Arch Linux (gfortran 9.1.0 and 9.2.0) and Debian Bullseye some time ago (current version is gfortran 9.2.1, but I would not bet this was the one I tested about a month or two ago). (ii) Replacing -O3 with -O{2,1,s,fast} does the same. When -O3 is replaced with -O0, the program compiles. Omitting either -O3 or -fexternal-blas makes the program compile. (iii) The above invocation works with gfortran 8.x (Debian Buster & Bullseye). (iv) The exact reason for the error is a bit hard to determine as the compiler message gives no context where the error is triggered. The minimal program below may thus be only one of such "triggers". The relevant information follows below. In case you need me to send you some more input, I will be happy to do so. Good luck! Andrej --- BEGIN SOURCE x.f90 --- module mw contains subroutine aux_inv(n,A) implicit none integer, parameter :: wp = kind(1.0d0) integer, intent(in) :: n complex(wp), intent(inout) :: A(n,n) complex(wp) U(n,n), V(n,n) U = 3 V = 4 A = matmul(V,conjg(transpose(U))) end subroutine aux_inv end module mw --- END SOURCE --- --- BEGIN SYSTEM INFO --- system: fully updated Arch Linux (x86_64) uname -a: Linux XXXXXXX 5.3.7-arch1-2-ARCH #1 SMP PREEMPT @1572002934 x86_64 GNU/Linux --- END SYSTEM INFO --- --- BEGIN COMMAND LINE THAT TRIGGERS THE BUG --- gfortran -c -O3 -fexternal-blas x.f90 (See Additonal notes above.) --- END COMMAND LINE THAT TRIGGERS THE BUG --- --- BEGIN gfortran -v -save-temps ... OUTPUT --- $ gfortran -v -save-temps -c -O3 -fexternal-blas x.f90 Using built-in specs. COLLECT_GCC=gfortran 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-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.0 (GCC) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-O3' '-fexternal-blas' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/f951 x.f90 -quiet -dumpbase x.f90 -mtune=generic -march=x86-64 -auxbase x -O3 -version -fexternal-blas -fintrinsic-modules-path /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/finclude -fpre-include=/usr/include/finclude/math-vector-fortran.h -o x.s GNU Fortran (GCC) version 9.2.0 (x86_64-pc-linux-gnu) compiled by GNU C version 9.2.0, GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.21-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU Fortran2008 (GCC) version 9.2.0 (x86_64-pc-linux-gnu) compiled by GNU C version 9.2.0, GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.21-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 f951: internal compiler error: in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4273 Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.archlinux.org/> for instructions. --- END gfortran -v -save-temps ... OUTPUT --- The GCC configure script is called in the following way (as per PKGBUILD from git.archlinux.org): --- BEGIN PKGBUILD snip --- "$srcdir/gcc/configure" --prefix=/usr \ --libdir=/usr/lib \ --libexecdir=/usr/lib \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --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 --- END PKGBUILD snip ---