===================================================================
@@ -4516,7 +4516,7 @@ vect_transform_stmt (gimple stmt, gimple
bool is_store = false;
gimple vec_stmt = NULL;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- gimple orig_stmt_in_pattern;
+ gimple orig_stmt_in_pattern, orig_scalar_stmt = stmt;
bool done;
switch (STMT_VINFO_TYPE (stmt_info))
@@ -4584,6 +4584,7 @@ vect_transform_stmt (gimple stmt, gimple
case call_vec_info_type:
gcc_assert (!slp_node);
done = vectorizable_call (stmt, gsi, &vec_stmt);
+ stmt = gsi_stmt (*gsi);
break;
case reduc_vec_info_type:
@@ -4662,7 +4663,8 @@ vect_transform_stmt (gimple stmt, gimple
documentation of vect_pattern_recog. */
if (STMT_VINFO_IN_PATTERN_P (stmt_vinfo))
{
- gcc_assert (STMT_VINFO_RELATED_STMT (stmt_vinfo) == stmt);
+ gcc_assert (STMT_VINFO_RELATED_STMT (stmt_vinfo)
+ == orig_scalar_stmt);
STMT_VINFO_VEC_STMT (stmt_vinfo) = vec_stmt;
}
}
===================================================================
@@ -0,0 +1,27 @@
+! { dg-do compile { target x86_64-*-* } }
+! { dg-options "-O3 -march=core2 -mavx -ffast-math -mveclibabi=svml" }
+
+ integer index(18),i,j,k,l,ipiv(18),info,ichange,neq,lda,ldb,
+ & nrhs,iplas
+ real*8 ep0(6),al10(18),al20(18),dg0(18),ep(6),al1(18),
+ & al2(18),dg(18),ddg(18),xm(6,18),h(18,18),ck(18),cn(18),
+ & c(18),d(18),phi(18),delta(18),r0(18),q(18),b(18),cphi(18),
+ & q1(18),q2(18),stri(6),htri(18),sg(18),r(42),xmc(6,18),aux(18),
+ & t(42),gl(18,18),gr(18,18),ee(6),c1111,c1122,c1212,dd,
+ & skl(3,3),xmtran(3,3),ddsdde(6,6),xx(6,18)
+ do
+ do i=1,18
+ htri(i)=dabs(sg(i))-r0(i)-ck(i)*(dg(i)/dtime)**(1.d0/cn(i))
+ do j=1,18
+ enddo
+ enddo
+ do
+ if(i.ne.j) then
+ gr(index(i),1)=htri(i)
+ endif
+ call dgesv(neq,nrhs,gl,lda,ipiv,gr,ldb,info)
+ enddo
+ enddo
+ end
+
+! { dg-final { cleanup-tree-dump "vect" } }
===================================================================
@@ -0,0 +1,27 @@
+! { dg-do compile { target powerpc*-*-* } }
+! { dg-options "-O3 -mcpu=power7 -ffast-math -mveclibabi=mass" }
+
+ integer index(18),i,j,k,l,ipiv(18),info,ichange,neq,lda,ldb,
+ & nrhs,iplas
+ real*8 ep0(6),al10(18),al20(18),dg0(18),ep(6),al1(18),
+ & al2(18),dg(18),ddg(18),xm(6,18),h(18,18),ck(18),cn(18),
+ & c(18),d(18),phi(18),delta(18),r0(18),q(18),b(18),cphi(18),
+ & q1(18),q2(18),stri(6),htri(18),sg(18),r(42),xmc(6,18),aux(18),
+ & t(42),gl(18,18),gr(18,18),ee(6),c1111,c1122,c1212,dd,
+ & skl(3,3),xmtran(3,3),ddsdde(6,6),xx(6,18)
+ do
+ do i=1,18
+ htri(i)=dabs(sg(i))-r0(i)-ck(i)*(dg(i)/dtime)**(1.d0/cn(i))
+ do j=1,18
+ enddo
+ enddo
+ do
+ if(i.ne.j) then
+ gr(index(i),1)=htri(i)
+ endif
+ call dgesv(neq,nrhs,gl,lda,ipiv,gr,ldb,info)
+ enddo
+ enddo
+ end
+
+! { dg-final { cleanup-tree-dump "vect" } }