2020-05-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/95403
* tree-vect-stmts.c (vect_init_vector_1): Guard against NULL
stmt_vinfo.
* gfortran.dg/vect/pr95403.f: New testcase.
--- /dev/null
+! { dg-do compile }
+ subroutine deuldlag(xi,et,ze,xlag,xeul,xj,xs)
+ real*8 shp(3,20),xs(3,3),xlag(3,20),xeul(3,20)
+ do i=1,3
+ do j=1,3
+ enddo
+ enddo
+ do i=1,3
+ do j=1,3
+ xs(i,j)=0.d0
+ do k=1,20
+ xs(i,j)=xs(i,j)+xeul(i,k)*shp(j,k)
+ enddo
+ enddo
+ enddo
+ end
basic_block new_bb;
edge pe;
- if (nested_in_vect_loop_p (loop, stmt_vinfo))
+ if (stmt_vinfo && nested_in_vect_loop_p (loop, stmt_vinfo))
loop = loop->inner;
pe = loop_preheader_edge (loop);