summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/ldist-pr45199.f
diff options
context:
space:
mode:
authorSebastian Pop <spop@gcc.gnu.org>2010-12-02 16:53:16 +0000
committerSebastian Pop <spop@gcc.gnu.org>2010-12-02 16:53:16 +0000
commit5e37ea0ef1bb8d9a27e6502a82b7b14f30d6d6b6 (patch)
tree88b1433f2415d2ff73482de80bdbdb30c4c04d7f /gcc/testsuite/gfortran.dg/ldist-pr45199.f
parentb2087e8dad076c2482622329023cde67c631edbb (diff)
downloadgcc-5e37ea0ef1bb8d9a27e6502a82b7b14f30d6d6b6.tar.gz
Fix PR45199: do not aggregate memory accesses to the same array for -ftree-loop-distribute-patterns
2010-11-30 Sebastian Pop <sebastian.pop@amd.com> PR tree-optimization/45199 * tree-data-ref.c (mem_write_stride_of_same_size_as_unit_type_p): New. (stores_zero_from_loop): Call mem_write_stride_of_same_size_as_unit_type_p. * tree-data-ref.h (stride_of_unit_type_p): New. * tree-loop-distribution.c (generate_memset_zero): Simplified. Call stride_of_unit_type_p. (build_rdg_partition_for_component): Do not call rdg_flag_similar_memory_accesses when flag_tree_loop_distribute_patterns is set. * gcc.dg/tree-ssa/ldist-15.c: New. * gcc.dg/tree-ssa/ldist-16.c: New. * gfortran.dg/ldist-pr45199.f: New. From-SVN: r167380
Diffstat (limited to 'gcc/testsuite/gfortran.dg/ldist-pr45199.f')
-rw-r--r--gcc/testsuite/gfortran.dg/ldist-pr45199.f27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/ldist-pr45199.f b/gcc/testsuite/gfortran.dg/ldist-pr45199.f
new file mode 100644
index 00000000000..6f65501a4f6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/ldist-pr45199.f
@@ -0,0 +1,27 @@
+! { dg-do compile }
+! { dg-options "-O3 -fdump-tree-ldist-details" }
+
+ parameter(numlev=3,numoblev=1000)
+ integer i_otyp(numoblev,numlev), i_styp(numoblev,numlev)
+ logical l_numob(numoblev,numlev)
+ do ixe=1,numoblev
+ do iye=1,numlev
+ i_otyp(ixe,iye)=0
+ i_styp(ixe,iye)=0
+ l_numob(ixe,iye)=.false.
+ enddo
+ enddo
+ do i=1,m
+ do j=1,n
+ if (l_numob(i,j)) then
+ write(20,'(7I4,F12.2,4F16.10)') i_otyp(i,j),i_styp(i,j)
+ endif
+ enddo
+ enddo
+ end
+
+! GCC should apply memset zero loop distribution and it should not ICE.
+
+! { dg-final { scan-tree-dump "distributed: split to 9 loops" "ldist" } }
+! { dg-final { scan-tree-dump-times "__builtin_memset" 18 "ldist" } }
+! { dg-final { cleanup-tree-dump "ldist" } }