https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96920
Bug ID: 96920 Summary: ICE segmentation fault in tree-vectorizer at -O3 Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: hj8758558 at gmail dot com Target Milestone: --- Created attachment 49179 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49179&action=edit Example Fortran source file to trigger ICE in tree-vectorizer. When I compile the attached code example with gfortran 10.x series at -O3, I get the following compiler seg fault. The code compiles okay with gfortran 9.1. The only previous bug report that I found that might be related is: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95539 $ gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/users/joshua.hykes/opt/gcc/linux-64/gcc-10.2.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /users/joshua.hykes/opt/gcc/linux-64/gcc-10.2.0-build/../gcc-10.2.0-src/configure --prefix=/users/joshua.hykes/opt/gcc/linux-64/gcc-10.2.0-build/../gcc-10.2.0/ --enable-languages=c,c++,fortran,go Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.2.0 (GCC) $ cat ice.f90 subroutine ice(npoint, nterm, x, g) implicit none integer norder parameter (norder=10) integer j integer k integer ii integer nterm integer npoint real b(norder) real c(norder) real d(norder) real x(npoint) real g(npoint) real gg real prev real prev2 ! j = 1 100 continue j = j+1 if (nterm == j) then do ii=1,npoint k = nterm gg= d(k) prev= 0.0 do k=k-1,1,-1 prev2= prev prev= gg gg = d(k)+(x(ii)-b(k))*prev-c(k+1)*prev2 enddo g(ii) = gg enddo endif go to 100 end $ gfortran -O3 -c ice.f90 during GIMPLE pass: vect ice.f90:1:0: 1 | subroutine ice(npoint, nterm, x, g) | internal compiler error: Segmentation fault 0xbeddaf crash_signal /users/joshua.hykes/opt/gcc/linux-64/gcc-10.2.0-build/../gcc-10.2.0-src/gcc/toplev.c:328 0x2b14706162ef ??? /usr/src/debug/glibc-2.17-c758a686/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0 0xd01227 find_uses_to_rename_use /users/joshua.hykes/opt/gcc/linux-64/gcc-10.2.0-build/../gcc-10.2.0-src/gcc/tree-ssa-loop-manip.c:393 0xd01227 find_uses_to_rename_bb /users/joshua.hykes/opt/gcc/linux-64/gcc-10.2.0-build/../gcc-10.2.0-src/gcc/tree-ssa-loop-manip.c:468 0xd02e57 find_uses_to_rename /users/joshua.hykes/opt/gcc/linux-64/gcc-10.2.0-build/../gcc-10.2.0-src/gcc/tree-ssa-loop-manip.c:500 0xd02e57 rewrite_into_loop_closed_ssa_1(bitmap_head*, unsigned int, int, loop*) /users/joshua.hykes/opt/gcc/linux-64/gcc-10.2.0-build/../gcc-10.2.0-src/gcc/tree-ssa-loop-manip.c:666 0xe17043 vectorize_loops() /users/joshua.hykes/opt/gcc/linux-64/gcc-10.2.0-build/../gcc-10.2.0-src/gcc/tree-vectorizer.c:1197 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.