middle-end/98974 - fixup after STMT_VINFO_VEC_STMTS rework
authorAndre Vieira <andre.simoesdiasvieira@arm.com>
Mon, 8 Feb 2021 16:04:18 +0000 (16:04 +0000)
committerAndre Vieira <andre.simoesdiasvieira@arm.com>
Mon, 8 Feb 2021 16:04:18 +0000 (16:04 +0000)
This fixes up the nvectors parameter passed to vect_get_loop_mask in
vectorizable_condition after the STMT_VINFO_VEC_STMTS rework.

gcc/ChangeLog:
2021-02-08  Andre Vieira  <andre.simoesdiasvieira@arm.com>

PR middle-end/98974
* tree-vect-stmts.c (vectorizable_condition): Remove shadow vec_num
parameter in vectorizable_condition.

gcc/testsuite/ChangeLog:
2021-02-08  Andre Vieira  <andre.simoesdiasvieira@arm.com>

PR middle-end/98974
* gfortran.dg/pr98974.F90: New test.

gcc/testsuite/gfortran.dg/pr98974.F90 [new file with mode: 0644]
gcc/tree-vect-stmts.c

diff --git a/gcc/testsuite/gfortran.dg/pr98974.F90 b/gcc/testsuite/gfortran.dg/pr98974.F90
new file mode 100644 (file)
index 0000000..296adad
--- /dev/null
@@ -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
index 0bc1cb1c5b4f6c1f0447241b4d31434bf7cca1a4..064e5d138ce9a151287662a0caefd9925b0a2920 100644 (file)
@@ -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);