[Bug middle-end/40281] [4.4/4.5 Regression] -fprefetch-loop-arrays: ICE: in initialize_matrix_A, at tree-data-ref.c:1887
--- Comment #4 from burnus at gcc dot gnu dot org 2009-11-05 21:04 --- Test case in comment 2 fails for me on x86-64-linux with 4.4.1 [gcc-4_4-branch revision 150839] and with 4.4.3 20091105 [gcc-4_4-branch revision 153928]. Marking thus as 4.4 regression. Maybe related: PR 41957 -- burnus at gcc dot gnu dot org changed: What|Removed |Added Summary|[4.5 Regression] -fprefetch-|[4.4/4.5 Regression] - |loop-arrays: ICE: in|fprefetch-loop-arrays: ICE: |initialize_matrix_A, at |in initialize_matrix_A, at |tree-data-ref.c:1887|tree-data-ref.c:1887 Target Milestone|4.5.0 |4.4.3 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40281
[Bug middle-end/40281] [4.4/4.5 Regression] -fprefetch-loop-arrays: ICE: in initialize_matrix_A, at tree-data-ref.c:1887
--- Comment #5 from rguenth at gcc dot gnu dot org 2009-11-09 13:48 --- Hm. (gdb) call debug_generic_expr (chrec) {{1, +, {2, +, 1}_2}_1, +, 1}_2 how can this happen? Why does evolution_function_is_affine_multivariate_p not reject this chrec? -- rguenth at gcc dot gnu dot org changed: What|Removed |Added Last reconfirmed|2009-09-28 20:52:51 |2009-11-09 13:48:47 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40281
[Bug middle-end/40281] [4.4/4.5 Regression] -fprefetch-loop-arrays: ICE: in initialize_matrix_A, at tree-data-ref.c:1887
--- Comment #6 from rguenth at gcc dot gnu dot org 2009-11-09 13:59 --- *** Bug 41957 has been marked as a duplicate of this bug. *** -- rguenth at gcc dot gnu dot org changed: What|Removed |Added CC||tkoenig at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40281
[Bug middle-end/40281] [4.4/4.5 Regression] -fprefetch-loop-arrays: ICE: in initialize_matrix_A, at tree-data-ref.c:1887
--- Comment #7 from reichelt at gcc dot gnu dot org 2009-11-13 12:32 --- Even shorter testcase (crashes with "-O -fprefetch-loop-arrays"): === void foo(int); void bar(int n) { int a[2], i, j = 0; for (i = 0; i < 2; i += j+1) for (j = 0; j < (n ? 1 : 2); ++j) foo(a[i] + a[j]); } === -- reichelt at gcc dot gnu dot org changed: What|Removed |Added CC||reichelt at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40281
[Bug middle-end/40281] [4.4/4.5 Regression] -fprefetch-loop-arrays: ICE: in initialize_matrix_A, at tree-data-ref.c:1887
--- Comment #8 from spop at gcc dot gnu dot org 2009-11-19 22:14 --- Subject: Re: [4.4/4.5 Regression] -fprefetch-loop-arrays: ICE: in initialize_matrix_A, at tree-data-ref.c:1887 Hi, Here is a fix for this one, on top of the graphite branch. I will commit this fix to the graphite branch to run the automatic testers, and then it will be included in the merge from graphite to trunk. Sebastian diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index fcd3382..7321b6e 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -2215,9 +2215,21 @@ instantiate_scev_poly (basic_block instantiate_below, if (CHREC_LEFT (chrec) != op0 || CHREC_RIGHT (chrec) != op1) { + unsigned var = CHREC_VARIABLE (chrec); + + /* When the instantiated stride or base has an evolution in an +innermost loop, return chrec_dont_know, as this is not a +valid SCEV representation. In the reduced testcase for +PR40281 we would have {0, +, {1, +, 1}_2}_1 that has no +meaning. */ + if ((tree_is_chrec (op0) && CHREC_VARIABLE (op0) > var) + || (tree_is_chrec (op1) && CHREC_VARIABLE (op1) > var)) + return chrec_dont_know; + op1 = chrec_convert_rhs (chrec_type (op0), op1, NULL); - chrec = build_polynomial_chrec (CHREC_VARIABLE (chrec), op0, op1); + chrec = build_polynomial_chrec (var, op0, op1); } + return chrec; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40281
[Bug middle-end/40281] [4.4/4.5 Regression] -fprefetch-loop-arrays: ICE: in initialize_matrix_A, at tree-data-ref.c:1887
--- Comment #9 from spop at gcc dot gnu dot org 2009-11-19 22:33 --- Subject: Bug 40281 Author: spop Date: Thu Nov 19 22:32:50 2009 New Revision: 154348 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154348 Log: Fix PR40281. 2009-11-18 Sebastian Pop PR middle-end/40281 * testsuite/gcc.dg/graphite/pr40281.c: New. * tree-scalar-evolution.c (instantiate_scev_poly): Base and stride evolutions should not variate in inner loops. Added: branches/graphite/gcc/testsuite/gcc.dg/graphite/pr40281.c Modified: branches/graphite/gcc/ChangeLog.graphite branches/graphite/gcc/tree-scalar-evolution.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40281
[Bug middle-end/40281] [4.4/4.5 Regression] -fprefetch-loop-arrays: ICE: in initialize_matrix_A, at tree-data-ref.c:1887
--- Comment #10 from spop at gcc dot gnu dot org 2009-11-25 05:36 --- Subject: Bug 40281 Author: spop Date: Wed Nov 25 05:35:58 2009 New Revision: 154641 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154641 Log: 2009-11-18 Sebastian Pop PR middle-end/40281 * testsuite/gcc.dg/graphite/pr40281.c: New. * tree-scalar-evolution.c (instantiate_scev_poly): Base and stride evolutions should not variate in inner loops. Modified: trunk/gcc/ChangeLog.graphite trunk/gcc/tree-scalar-evolution.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40281
[Bug middle-end/40281] [4.4/4.5 Regression] -fprefetch-loop-arrays: ICE: in initialize_matrix_A, at tree-data-ref.c:1887
--- Comment #11 from spop at gcc dot gnu dot org 2009-11-25 05:40 --- Fixed. -- spop at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40281