+2015-01-12 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/64530
+ * tree-loop-distribution.c (pg_add_dependence_edges): Shuffle
+ back dr1.
+
2015-01-12 Richard Biener <rguenther@suse.de>
PR middle-end/64357
+2015-01-12 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/64530
+ * gfortran.dg/pr64530.f90: New testcase.
+
2015-01-12 Richard Biener <rguenther@suse.de>
PR middle-end/64357
--- /dev/null
+! { dg-do run }
+
+program bug
+ ! Bug triggered with at least three elements
+ integer, parameter :: asize = 3
+
+ double precision,save :: ave(asize)
+ double precision,save :: old(asize)
+ double precision,save :: tmp(asize)
+
+ ave(:) = 10.d0
+ old(:) = 3.d0
+ tmp(:) = 0.d0
+
+ call buggy(2.d0,asize,ave,old,tmp)
+ if (any (tmp(:) .ne. 3.5)) call abort
+end
+
+subroutine buggy(scale_factor, asize, ave, old, tmp)
+
+ implicit none
+ ! Args
+ double precision scale_factor
+ integer asize
+ double precision ave(asize)
+ double precision old(asize)
+ double precision tmp(asize)
+
+ ! Local
+ integer i
+
+ do i = 1, asize
+ tmp(i) = ave(i) - old(i)
+ old(i) = ave(i)
+ tmp(i) = tmp(i) / scale_factor
+ end do
+
+end subroutine buggy
for (int ii = 0; drs1.iterate (ii, &dr1); ++ii)
for (int jj = 0; drs2.iterate (jj, &dr2); ++jj)
{
+ data_reference_p saved_dr1 = dr1;
int this_dir = 1;
ddr_p ddr;
/* Re-shuffle data-refs to be in dominator order. */
dir = this_dir;
else if (dir != this_dir)
return 2;
+ /* Shuffle "back" dr1. */
+ dr1 = saved_dr1;
}
return dir;
}