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

            Bug ID: 84913
           Summary: ICE vectorising chained conditional reduction
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
  Target Milestone: ---

This testcase:

function foo(a, b, c, n)
  integer :: a(n), b(n), c(n), n, i, foo
  foo = 0
  do i = 1, n
    if (a(i) .eq. b(i)) then
      foo = 1
    else if (a(i) .eq. c(i)) then
      foo = 2
    end if
  end do
end function foo

triggers an ICE with call stack:

crash_signal
tree_check(tree_node*, char const*, int, char const*, tree_code)
vectorizable_reduction(gimple*, gimple_stmt_iterator*, gimple**, _slp_tree*,
_slp_instance*)
vect_analyze_stmt(gimple*, bool*, _slp_tree*, _slp_instance*)
vect_analyze_loop_operations
vect_analyze_loop_2
vect_analyze_loop(loop*, _loop_vec_info*)
vectorize_loops()

when compiled with -O3 -march=armv8-a+sve (aarch64) or -O3
-march=skylake-avx512 (x86_64).

Reply via email to