2009-03-28 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 28 Mar 2009 10:05:24 +0000 (10:05 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 28 Mar 2009 10:05:24 +0000 (10:05 +0000)
PR tree-optimization/38968
* tree-vect-analyze.c (vect_compute_data_ref_alignment):
Use FLOOR_MOD_EXPR to compute misalignment.

* gfortran.dg/vect/fast-math-pr38968.f90: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145171 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90 [new file with mode: 0644]
gcc/tree-vect-analyze.c

index 738e7db..48715d3 100644 (file)
@@ -1,5 +1,11 @@
 2009-03-28  Richard Guenther  <rguenther@suse.de>
 
+       PR tree-optimization/38968
+       * tree-vect-analyze.c (vect_compute_data_ref_alignment):
+       Use FLOOR_MOD_EXPR to compute misalignment.
+
+2009-03-28  Richard Guenther  <rguenther@suse.de>
+
        PR tree-optimization/37795
        * tree.h (combine_comparisons): Declare.
        * fold-const.c (combine_comparisons): Export.
index 41e5d70..e0f7df7 100644 (file)
@@ -1,5 +1,10 @@
 2009-03-28  Richard Guenther  <rguenther@suse.de>
 
+       PR tree-optimization/38968
+       * gfortran.dg/vect/fast-math-pr38968.f90: New testcase.
+
+2009-03-28  Richard Guenther  <rguenther@suse.de>
+
        PR tree-optimization/37795
        * gcc.dg/tree-ssa/ssa-ifcombine-7.c: New testcase.
 
diff --git a/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90 b/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90
new file mode 100644 (file)
index 0000000..e161315
--- /dev/null
@@ -0,0 +1,21 @@
+program mymatmul
+  implicit none
+  integer, parameter :: kp = 4
+  integer, parameter :: n = 2000
+  real(kp), dimension(n,n) :: rr, ri
+  complex(kp), dimension(n,n) :: a,b,c
+  real :: t1, t2
+  integer :: i, j, k
+
+  do j = 1, n
+     do k = 1, n
+        do i = 1, n
+           c(i,j) = c(i,j) + a(i,k) * b(k,j)
+        end do
+     end do
+  end do
+
+end program mymatmul
+
+! { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } }
+! { dg-final { cleanup-tree-dump "vect" } }
index 0b94714..eb5166b 100644 (file)
@@ -1504,7 +1504,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
                  && DECL_ALIGN (base) >= TYPE_ALIGN (vectype)));
 
   /* Modulo alignment.  */
-  misalign = size_binop (TRUNC_MOD_EXPR, misalign, alignment);
+  misalign = size_binop (FLOOR_MOD_EXPR, misalign, alignment);
 
   if (!host_integerp (misalign, 1))
     {