OSDN Git Service

PR tree-optimization/39516
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Mar 2009 14:00:34 +0000 (14:00 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Mar 2009 14:00:34 +0000 (14:00 +0000)
* lambda-code.c (perfect_nestify): Fix type of the uboundvar variable.

* gfortran.dg/pr39516.f: New test.

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

gcc/ChangeLog
gcc/lambda-code.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr39516.f [new file with mode: 0644]

index 2a8de0a..261b135 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/39516
+       * lambda-code.c (perfect_nestify): Fix type of the uboundvar variable.
+
 2009-03-23 Bingfeng Mei  <bmei@broadcom.com>
 
        * config.gcc (need_64bit_hwint): Make clear that need_64bit_hwint 
index 794d4e8..07b9469 100644 (file)
@@ -2472,7 +2472,8 @@ perfect_nestify (struct loop *loop,
      it to one just in case.  */
 
   exit_condition = get_loop_exit_condition (newloop);
-  uboundvar = create_tmp_var (integer_type_node, "uboundvar");
+  uboundvar = create_tmp_var (TREE_TYPE (VEC_index (tree, ubounds, 0)),
+                             "uboundvar");
   add_referenced_var (uboundvar);
   stmt = gimple_build_assign (uboundvar, VEC_index (tree, ubounds, 0));
   uboundvar = make_ssa_name (uboundvar, stmt);
index abad6ba..65f7760 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/39516
+       * gfortran.dg/pr39516.f: New test.
+
 2009-03-22  Hans-Peter Nilsson  <hp@axis.com>
 
        * lib/target-libpath.exp (set_ld_library_path_env_vars):
diff --git a/gcc/testsuite/gfortran.dg/pr39516.f b/gcc/testsuite/gfortran.dg/pr39516.f
new file mode 100644 (file)
index 0000000..3d6104a
--- /dev/null
@@ -0,0 +1,20 @@
+C PR tree-optimization/39516
+C { dg-do compile }
+C { dg-options "-O2 -ftree-loop-linear" }
+      SUBROUTINE SUB(A, B, M)
+      IMPLICIT NONE
+      DOUBLE PRECISION A(20,20), B(20)
+      INTEGER*8 I, J, K, M
+      DO I=1,M
+        DO J=1,M
+          A(I,J)=A(I,J)+1
+        END DO
+      END DO
+      DO K=1,20
+        DO I=1,M
+          DO J=1,M
+            B(I)=B(I)+A(I,J)
+          END DO
+        END DO
+      END DO
+      END SUBROUTINE