2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-03-24 13:11:44 +08:00

re PR tree-optimization/69980 (Supposedly wrong SLP code emitted)

2016-02-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/69980
	* tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Update
	permutation of those we need to keep.

	* gfortran.dg/vect/pr69980.f90: New testcase.

From-SVN: r233809
This commit is contained in:
Richard Biener 2016-02-29 13:24:24 +00:00 committed by Richard Biener
parent 84ea0f5850
commit cbd400b43e
4 changed files with 54 additions and 0 deletions

@ -1,3 +1,9 @@
2016-02-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/69980
* tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Update
permutation of those we need to keep.
2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
PR target/69706

@ -1,3 +1,8 @@
2016-02-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/69980
* gfortran.dg/vect/pr69980.f90: New testcase.
2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
* gcc.target/sparc/20160229-1.c: New test.

@ -0,0 +1,40 @@
! { dg-do run }
! { dg-additional-options "-Ofast -fno-inline" }
subroutine check (a, b)
real *8, intent(in) :: a(4), b(4)
IF (abs(a(1)-b(1)) > 1) THEN
CALL ABORT
END IF
end subroutine check
program main
real *8 :: mu(4,26), mumax(4), mumax2(4)
integer :: i, k
do k=1,26
do i=1,4
mu(i, k) = 4*(i-1) + k
end do
end do
mumax = 0;
do k=1,26
do i=1,3
mumax(i) = max(mumax(i), mu(i,k)+mu(i,k))
end do
end do
mumax2 = 0;
do i=1,3
do k=1,26
mumax2(i) = max(mumax2(i), mu(i,k)+mu(i,k))
end do
end do
CALL check (mumax, mumax2)
return
end program

@ -1343,6 +1343,9 @@ vect_attempt_slp_rearrange_stmts (slp_instance slp_instn)
|| (group_size == GROUP_SIZE (vinfo_for_stmt (first_stmt))
&& GROUP_GAP (vinfo_for_stmt (first_stmt)) == 0))
SLP_TREE_LOAD_PERMUTATION (node).release ();
else
for (j = 0; j < SLP_TREE_LOAD_PERMUTATION (node).length (); ++j)
SLP_TREE_LOAD_PERMUTATION (node)[j] = j;
}
return true;