public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix type mismatch in perfect_nestify (PR  tree-optimization/39516)
@ 2009-03-23 13:35 Jakub Jelinek
  2009-03-23 13:43 ` Diego Novillo
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2009-03-23 13:35 UTC (permalink / raw)
  To: gcc-patches

Hi!

GCC ICEs on the attached testcase, because perfect_nestify creates
the uboundvar.* variable with incorrect type (always int).

Fixed thusly, bootstrapped/regtested on x86_64-linux, ok for trunk?

2009-03-23  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/39516
	* lambda-code.c (perfect_nestify): Fix type of the uboundvar variable.

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

--- gcc/lambda-code.c.jj	2009-01-13 18:32:17.000000000 +0100
+++ gcc/lambda-code.c	2009-03-23 10:20:52.000000000 +0100
@@ -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);
--- gcc/testsuite/gfortran.dg/pr39516.f.jj	2009-03-23 10:24:53.000000000 +0100
+++ gcc/testsuite/gfortran.dg/pr39516.f	2009-03-23 09:47:58.000000000 +0100
@@ -0,0 +1,19 @@
+C PR tree-optimization/39516
+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

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix type mismatch in perfect_nestify (PR   tree-optimization/39516)
  2009-03-23 13:35 [PATCH] Fix type mismatch in perfect_nestify (PR tree-optimization/39516) Jakub Jelinek
@ 2009-03-23 13:43 ` Diego Novillo
  0 siblings, 0 replies; 2+ messages in thread
From: Diego Novillo @ 2009-03-23 13:43 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Mon, Mar 23, 2009 at 09:25, Jakub Jelinek <jakub@redhat.com> wrote:

> 2009-03-23  Jakub Jelinek  <jakub@redhat.com>
>
>        PR tree-optimization/39516
>        * lambda-code.c (perfect_nestify): Fix type of the uboundvar variable.
>
>        * gfortran.dg/pr39516.f: New test.

OK.


Diego.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-23 13:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-23 13:35 [PATCH] Fix type mismatch in perfect_nestify (PR tree-optimization/39516) Jakub Jelinek
2009-03-23 13:43 ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).