OSDN Git Service

2007-04-29 Paul Thomas <pault@gcc.gnu.org>
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 29 Apr 2007 05:10:22 +0000 (05:10 +0000)
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 29 Apr 2007 05:10:22 +0000 (05:10 +0000)
PR fortran/31711
* trans-array.c (gfc_conv_resolve_dependencies): Create a temp
whenever a dependency is found.

2007-04-29  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/31711
* gfortran.dg/dependency_21.f90: New test.

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

gcc/fortran/ChangeLog
gcc/fortran/trans-array.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/dependency_21.f90 [new file with mode: 0644]

index ef1d6cb..6bba251 100644 (file)
@@ -1,3 +1,9 @@
+2007-04-29  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/31711
+       * trans-array.c (gfc_conv_resolve_dependencies): Create a temp
+       whenever a dependency is found.
+
 2007-04-28  Tobias Schlüter  <tobi@gcc.gnu.org>
 
        * options.c (gfc_handle_option): Ensure requested free form line
index b6a2ac0..92fd67c 100644 (file)
@@ -3001,6 +3001,8 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest,
          rref = ss->expr->ref;
 
          nDepend = gfc_dep_resolver (lref, rref);
+         if (nDepend == 1)
+           break;
 #if 0
          /* TODO : loop shifting.  */
          if (nDepend == 1)
index e309739..c064f17 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-29  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/31711
+       * gfortran.dg/dependency_21.f90: New test.
+
 2007-04-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        * gfortran.dg/secnds.f: Use real*8.
diff --git a/gcc/testsuite/gfortran.dg/dependency_21.f90 b/gcc/testsuite/gfortran.dg/dependency_21.f90
new file mode 100644 (file)
index 0000000..ca25458
--- /dev/null
@@ -0,0 +1,21 @@
+! { dg-do run }
+! Test the fix for PR31711 in which the dependency in the assignment
+! at line 18 was detected and then ignored.
+!
+! Contributed by Tobias Ivarsson <thobes@gmail.com>
+!
+program laplsolv
+  IMPLICIT NONE
+  integer, parameter                  :: n = 2
+  double precision,dimension(0:n+1, 0:n+1) :: T
+  integer                             :: i
+
+  T=0.0
+  T(0:n+1 , 0)     = 1.0
+  T(0:n+1 , n+1)   = 1.0
+  T(n+1   , 0:n+1) = 2.0
+
+  T(1:n,1)=(T(0:n-1,1)+T(1:n,1+1)+1d0)
+
+  if (any (T(1:n,1) .ne. 1d0 )) call abort ()
+end program laplsolv