https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92945
Bug ID: 92945 Summary: -O2 -floop-nest-optimize crashes gccin isl_basic_map_underlying_set () Product: gcc Version: 9.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at inbox dot ru Target Milestone: --- Created attachment 47498 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47498&action=edit scipy-graphite-ice.f Initially reported as https://bugs.gentoo.org/702968 by wolfwood. There fortran code (from scipy-1.1.0) and C++ code (from dav1d-0.5.2) crash with -floop-nest-optimize. I crash both gcc-9.2.0 and current gcc trunk. Here is the reduced fortran example: $ cat scipy-graphite-ice.f SUBROUTINE CERZO(NT,ZO) IMPLICIT DOUBLE PRECISION (E,P,W) IMPLICIT COMPLEX *16 (C,Z) DIMENSION ZO(NT) DO 35 NR=1,NT PX=0.5*PU-0.5*DLOG(PV)/PU PY=0.5*PU+0.5*DLOG(PV)/PU 15 IT=IT+1 CALL CERF(Z,ZF,ZD) DO 30 I=1,NR-1 ZW=(1.0D0,0.0D0) DO 25 J=1,NR-1 IF (J.EQ.I) GO TO 25 ZW=ZW*(Z-ZO(J)) 25 CONTINUE 30 ZQ=ZQ+ZW ZGD=(ZD-ZQ*ZFD)/ZP Z=Z-ZFD/ZGD IF (IT.LE.50.AND.DABS((W-W0)/W).GT.1.0D-11) GO TO 15 35 ZO(NR)=Z IF (B.NE.INT(B)) THEN ENDIF END $ LANG=C ./gfortran -B . -O2 -floop-nest-optimize -c scipy-graphite-ice.f scipy-graphite-ice.f:16:72: 16 | 30 ZQ=ZQ+ZW | 1 Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 30 at (1) scipy-graphite-ice.f:20:72: 20 | 35 ZO(NR)=Z | 1 Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 35 at (1) during GIMPLE pass: graphite scipy-graphite-ice.f:1:0: 1 | SUBROUTINE CERZO(NT,ZO) | internal compiler error: Segmentation fault 0x7fda773f51cf ??? /usr/src/debug/sys-libs/glibc-2.30-r3/glibc-2.30/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0 0x7fda773def1a __libc_start_main ../csu/libc-start.c:308 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $ LANG=C ./gfortran -B . -v Reading specs from ./specs COLLECT_GCC=./gfortran COLLECT_LTO_WRAPPER=./lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --enable-languages=c,c++ --disable-bootstrap --with-multilib-list=m64 --prefix=/home/slyfox/dev/git/gcc-fortran-and-isl/../gcc-native-quick-installed --disable-nls --without-isl --disable-libsanitizer --disable-libvtv --disable-libgomp --disable-libstdcxx-pch --disable-libunwind-exceptions CFLAGS='-O1 ' CXXFLAGS='-O1 ' --with-sysroot=/usr/x86_64-HEAD-linux-gnu --enable-languages=c,c++,fortran --with-isl Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.0.0 20191215 (experimental) (GCC)