From: Sebastian Pop Date: Wed, 9 Dec 2009 15:18:22 +0000 (+0000) Subject: re PR tree-optimization/42285 (ICE in Graphite's scan_tree_for_params for 416.gamess) X-Git-Tag: releases/gcc-4.5.0~1725 X-Git-Url: https://gcc.gnu.org/git/?a=commitdiff_plain;h=d505015aa52a7113d13a185e2aa4c14e77c9a1fa;p=gcc.git re PR tree-optimization/42285 (ICE in Graphite's scan_tree_for_params for 416.gamess) Fix PR42285. 2009-12-08 Sebastian Pop PR middle-end/42285 * graphite-scop-detection.c (graphite_can_represent_init): Also handle more complex MULT_EXPRs containing parameters by recursion on the structure. * testsuite/gfortran.dg/graphite/pr42285.f90: New. From-SVN: r155108 --- diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index 3ae20755abf9..a9197a56d67c 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,3 +1,16 @@ +2009-12-08 Sebastian Pop + + PR middle-end/42285 + * graphite-scop-detection.c (graphite_can_represent_init): Also + handle more complex MULT_EXPRs containing parameters by recursion + on the structure. + + * testsuite/gfortran.dg/graphite/pr42285.f90: New. + +2009-12-01 Tobias Grosser + + * testsuite/g++.dg/graphite/pr42130.C: Fix type. + 2009-11-29 Alexander Monakov * testsuite/g++.dg/graphite/pr42130.C: Correct testcase. diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index 02c653b69a6e..a24420e9dad5 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -168,9 +168,11 @@ graphite_can_represent_init (tree e) case MULT_EXPR: if (chrec_contains_symbols (TREE_OPERAND (e, 0))) - return host_integerp (TREE_OPERAND (e, 1), 0); + return graphite_can_represent_init (TREE_OPERAND (e, 0)) + && host_integerp (TREE_OPERAND (e, 1), 0); else - return host_integerp (TREE_OPERAND (e, 0), 0); + return graphite_can_represent_init (TREE_OPERAND (e, 1)) + && host_integerp (TREE_OPERAND (e, 0), 0); case PLUS_EXPR: case POINTER_PLUS_EXPR: diff --git a/gcc/testsuite/gfortran.dg/graphite/pr42285.f90 b/gcc/testsuite/gfortran.dg/graphite/pr42285.f90 new file mode 100644 index 000000000000..d496d3724ba3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/graphite/pr42285.f90 @@ -0,0 +1,24 @@ +! { dg-options "-O2 -floop-interchange" } + +SUBROUTINE EFGRDM(NCF,NFRG,G,RTRMS,GM,IOPT,K1) + IMPLICIT DOUBLE PRECISION (A-H,O-Z) + DIMENSION G(*),RTRMS(*),GM(*) + + DUM = 0 + DO I=1,NFRG + DO J=1,3 + IF (IOPT.EQ.0) THEN + GM(K1)=G(K1) + END IF + END DO + DO J=1,3 + JDX=NCF*9+IOPT*9*NFRG + DO M=1,3 + DUM=DUM+RTRMS(JDX+M) + END DO + GM(K1)=DUM + END DO + END DO + RETURN +END SUBROUTINE EFGRDM +