]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/39516 (internal compiler error: in copy_to_mode_reg, at explo...
authorJakub Jelinek <jakub@redhat.com>
Mon, 23 Mar 2009 14:00:34 +0000 (15:00 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 23 Mar 2009 14:00:34 +0000 (15:00 +0100)
PR tree-optimization/39516
* lambda-code.c (perfect_nestify): Fix type of the uboundvar variable.

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

From-SVN: r145008

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

index 2a8de0abc1a58f8d7a384aed467ff3484524820a..261b13538f1ce5a532af4d71826b1047c2e6482c 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 794d4e8b256a7ebb70d9fbcff76452551eacd31d..07b9469e35ed52648e66bb9c0405d00d74a7de1b 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 abad6bab0330e31cd3a985672bf3b1d3dd8b60b7..65f77602a8b94fa2679528c63ff2869b5ced75a7 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