diff --git a/gcc/testsuite/gfortran.dg/pr98974.F90 b/gcc/testsuite/gfortran.dg/pr98974.F90 new file mode 100644 index 00000000000..296adad3cf4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr98974.F90 @@ -0,0 +1,21 @@ +! PR middle-end/98974 +! { dg-do compile } +! { dg-options "-Ofast" } +! { dg-additional-options "-mcpu=neoverse-v1" { target aarch64*-*-* } } + +module module_foobar + integer,parameter :: fp_kind = selected_real_kind(15) +contains + subroutine foobar( foo, ix ,jx ,kx,iy,ky) + real, dimension( ix, kx, jx ) :: foo + real(fp_kind), dimension( iy, ky, 3 ) :: bar, baz + do k=1,ky + do i=1,iy + if ( baz(i,k,1) > 0. ) then + bar(i,k,1) = 0 + endif + foo(i,nk,j) = baz0 * bar(i,k,1) + enddo + enddo + end +end diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 0bc1cb1c5b4..064e5d138ce 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -10235,7 +10235,6 @@ vectorizable_condition (vec_info *vinfo, if (masks) { - unsigned vec_num = vec_oprnds0.length (); tree loop_mask = vect_get_loop_mask (gsi, masks, vec_num * ncopies, vectype, i);