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

            Bug ID: 92537
           Summary: [10 Regression] internal compiler error: in
                    vect_slp_analyze_node_operations, at
                    tree-vect-slp.c:2775
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anlauf at gcc dot gnu.org
  Target Milestone: ---

This is a recent regression occurring with Fortran code.  If it is a FE issue,
feel free to re-categorize.

The two modules below need to be compiled separately and with options

-O2 -march=skylake -ftree-vectorize

(or for any other modern x86_64 processor), to get:

during GIMPLE pass: slp
mod2.f90:5:0:

    5 |   subroutine foo (pr)
      | 
internal compiler error: in vect_slp_analyze_node_operations, at
tree-vect-slp.c:2775
0xfc2c6b vect_slp_analyze_node_operations
        ../../trunk/gcc/tree-vect-slp.c:2775
0xfc341a vect_slp_analyze_operations(vec_info*)
        ../../trunk/gcc/tree-vect-slp.c:2862
0xfc902f vect_slp_analyze_bb_1
        ../../trunk/gcc/tree-vect-slp.c:3199
0xfc902f vect_slp_bb_region
        ../../trunk/gcc/tree-vect-slp.c:3260
0xfc902f vect_slp_bb(basic_block_def*)
        ../../trunk/gcc/tree-vect-slp.c:3395
0xfcbd7a execute
        ../../trunk/gcc/tree-vectorizer.c:1320


% cat mod1.f90
module mod1
  implicit none
  integer, parameter :: wp = kind (1.d0)
  interface p_min
     module procedure p_min_wp
  end interface
contains
  function p_min_wp (x) result (p_min)
    real(wp), intent(in) :: x
    real(wp)             :: p_min
    p_min = x
  end function p_min_wp
end module mod1

% cat mod2.f90
MODULE mod2
  use mod1, only: p_min, wp
  implicit none
contains
  subroutine foo (pr)
    real(wp), pointer     :: pr(:)
    integer  ::  nzd
    real(wp) ::  pmin
    real(wp) ::  pmin_diag
    integer  ::  i
    nzd  = 15
    allocate (pr(nzd))
    pmin_diag = 4000._wp
    pmin = p_min(pmin_diag)
    pmin = min (pmin,pmin_diag)
    pr(1) = log(pmin)
    do i=1,nzd-1
       pr(i+1) = log(pmin) + i
    end do
  end subroutine foo
end module mod2


Compilation passes e.g. with -O1, -fno-tree-vectorize, changing 1.d0 to 1.0,
changing the loop bounds, or several other minor variations of the code.

Reply via email to