https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89098

            Bug ID: 89098
           Summary: ICE: verify_ssa failed (Error: definition in block 27
                    follows the use)
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: ice-checking, ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gfortran-9.0.0-alpha20190127 snapshot (r268327) and 7.3 ICE when compiling the
following testcase reduced from libgomp/testsuite/libgomp.fortran/strassen.f90
w/ -m32 -O2 (-O3, -Ofast) -fno-tree-dce --param max-slsr-cand-scan=1:

program strassen_matmul
  integer, parameter :: N = 1024
  double precision, save :: A(N,N), B(N,N), D(N,N)
  call strassen (A, B, D, N)
contains
  recursive subroutine strassen (A, B, C, N)
    integer, intent(in) :: N
    double precision, intent(in) :: A(N,N), B(N,N)
    double precision, intent(out) :: C(N,N)
    double precision :: T(N/2,N/2,7)
    integer :: K, L
    if (N < 64) then
      C = matmul (A, B)
    end if
    L = N / 2 + 1
    call strassen (A(:K,:K) + A(L:,L:), B(:K,:K) + B(L:,L:), T(:,:,1), K)
    C(:K,:K) = T(:,:,1) + T(:,:,4) - T(:,:,5) + T(:,:,7)
    C(L:,L:) = T(:,:,1) - T(:,:,2) + T(:,:,3) + T(:,:,6)
  end subroutine strassen
end

% powerpc-e300c3-linux-gnu-gfortran-9.0.0-alpha20190127 -m32 -O2 -fno-tree-dce
--param max-slsr-cand-scan=1 -c gquiighk.f90
gquiighk.f90:6:0:

    6 |   recursive subroutine strassen (A, B, C, N)
      | 
Error: definition in block 27 follows the use
for SSA_NAME: _490 in statement:
_487 = _281 + _490;
during GIMPLE pass: slsr
gquiighk.f90:6:0: internal compiler error: verify_ssa failed
0xfc0976 verify_ssa(bool, bool)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/tree-ssa.c:1188
0xcc2670 execute_function_todo
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/passes.c:1984
0xcc2f0a execute_todo
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/passes.c:2031

(While my target here is powerpc, the ICE is not target-specific. Also,
gfortran 8.2 did not fail for me for some reason.)

Reply via email to