summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr43984.f90
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.dg/pr43984.f90
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gfortran.dg/pr43984.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/pr43984.f9056
1 files changed, 56 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pr43984.f90 b/gcc/testsuite/gfortran.dg/pr43984.f90
new file mode 100644
index 000000000..40c81b84c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr43984.f90
@@ -0,0 +1,56 @@
+! { dg-do compile }
+! { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-pre" }
+module test
+
+ type shell1quartet_type
+
+ integer(kind=kind(1)) :: ab_l_sum
+ integer(kind=kind(1)), dimension(:), pointer :: ab_form_3dints_x_indices => NULL()
+ integer(kind=kind(1)), dimension(:), pointer :: ab_form_3dints_yz_rms_indices => NULL()
+
+ end type
+
+contains
+subroutine make_esss(self,esss)
+ type(shell1quartet_type) :: self
+ intent(in) :: self
+ real(kind=kind(1.0d0)), dimension(:), intent(out) :: esss
+ real(kind=kind(1.0d0)), dimension(:), pointer :: Izz
+ real(kind=kind(1.0d0)), dimension(:,:), pointer :: Ix,Iy,Iz,Iyz
+ integer(kind=kind(1)), dimension(:), pointer :: e_x,ii_ivec
+ integer(kind=kind(1)) :: dim, dim1, nroots, ii,z,y
+
+ dim = self%ab_l_sum+1
+ dim1 = self%ab_l_sum+2
+ nroots = (dim1) / 2
+ call create_(Ix,nroots,dim)
+ call create_(Iy,nroots,dim)
+ call create_(Iz,nroots,dim)
+ call create_(Iyz,nroots,dim*dim1/2)
+
+ e_x => self%ab_form_3dints_x_indices
+ ii_ivec => self%ab_form_3dints_yz_rms_indices
+
+ call foo(Ix)
+ call foo(Iy)
+ call foo(Iz)
+
+ esss = ZERO
+ ii = 0
+ do z=1,dim
+ Izz => Iz(:,z)
+ do y=1,dim1-z
+ ii = ii + 1
+ Iyz(:,ii) = Izz * Iy(:,y)
+ end do
+ end do
+ esss = esss + sum(Ix(:,e_x) * Iyz(:,ii_ivec),1)
+
+end subroutine
+
+end
+
+! There should be three loads from iyz.data, not four.
+
+! { dg-final { scan-tree-dump-times "= iyz.data" 3 "pre" } }
+! { dg-final { cleanup-tree-dump "pre" } }