public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/98974] New: ICE in vectorizable_condition after STMT_VINFO_VEC_STMTS
@ 2021-02-05 10:20 avieira at gcc dot gnu.org
  2021-02-05 10:22 ` [Bug middle-end/98974] " avieira at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: avieira at gcc dot gnu.org @ 2021-02-05 10:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98974
           Summary: ICE in vectorizable_condition after
                    STMT_VINFO_VEC_STMTS
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: avieira at gcc dot gnu.org
  Target Milestone: ---

Hi,

After
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b05d5563f4be13b4a0d0951375a82adf483973c0
we found vectorizable_condition to ICE when autovectorizing for SVE.

The reduced fortran testcase is an example of this:
$ cat foo.F90
 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
   j_loop: do j=jts,enddo
       do k=0,ky
          do i=0,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
   enddo j_loop
 end
end

And the following command will cause it to ICE:
$ gfortran  -Ofast -mcpu=neoverse-v1 foo.F90 -S

I have debugged this and I believe the issue is that before Richi's change
vectorizable_condition used to set vec_oprnds0 to vec_cond_lhs for each copy.
Now it is collected for all copies at the same time. However, when calling
vect_get_loop_mask we pass vec_num * ncopies as the nvectors parameter, where
vec_num has been set to the length of vec_oprnds0. I believe that because we
are now doing all ncopies at the same time we no longer need to multiply it by
ncopies.

I'll be posting a patch for this soon.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-02-08 16:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05 10:20 [Bug middle-end/98974] New: ICE in vectorizable_condition after STMT_VINFO_VEC_STMTS avieira at gcc dot gnu.org
2021-02-05 10:22 ` [Bug middle-end/98974] " avieira at gcc dot gnu.org
2021-02-05 10:35 ` [Bug middle-end/98974] [11 Regression] " ktkachov at gcc dot gnu.org
2021-02-05 12:04 ` rguenth at gcc dot gnu.org
2021-02-08 16:07 ` cvs-commit at gcc dot gnu.org
2021-02-08 16:08 ` avieira at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).