diff options
author | Tobias Grosser <grosser@fim.uni-passau.de> | 2012-02-15 12:20:10 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-02-15 12:20:10 +0000 |
commit | 28db21ee45c94316cb9e7b2b4e0f908053fc98ce (patch) | |
tree | da7f3a977fabcb389928cb8467779eedd99841c1 /gcc | |
parent | 0c578db6dd12d39618ad2500a80bae4ba38cf260 (diff) | |
download | gcc-28db21ee45c94316cb9e7b2b4e0f908053fc98ce.zip gcc-28db21ee45c94316cb9e7b2b4e0f908053fc98ce.tar.gz gcc-28db21ee45c94316cb9e7b2b4e0f908053fc98ce.tar.bz2 |
re PR tree-optimization/50561 (ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine)
2012-02-15 Tobias Grosser <grosser@fim.uni-passau.de>
PR tree-optimization/50561
* graphite-flattening.c (lst_project_loop): Do not
remove old scattering dimensions after flattening.
(lst_do_flatten): Likewise.
* gcc.dg/graphite/pr50561.c: New testcase.
From-SVN: r184265
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/graphite-flattening.c | 42 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/pr50561.c | 9 |
4 files changed, 56 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1d88845..1e3d36f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-02-15 Tobias Grosser <grosser@fim.uni-passau.de> + + PR tree-optimization/50561 + * graphite-flattening.c (lst_project_loop): Do not + remove old scattering dimensions after flattening. + (lst_do_flatten): Likewise. + 2012-02-15 Georg-Johann Lay <avr@gjlay.de> * doc/extend.texi (AVR Built-in Functions): Remove doc for diff --git a/gcc/graphite-flattening.c b/gcc/graphite-flattening.c index ccd0f5f..33f25e0 100644 --- a/gcc/graphite-flattening.c +++ b/gcc/graphite-flattening.c @@ -277,12 +277,26 @@ lst_project_loop (lst_p outer, lst_p inner, mpz_t stride) ppl_delete_Linear_Expression (expr); /* Remove inner loop and the static schedule of its body. */ - ds = XNEWVEC (ppl_dimension_type, 2); - ds[0] = inner_dim; - ds[1] = inner_dim + 1; - ppl_Polyhedron_remove_space_dimensions (poly, ds, 2); - PBB_NB_SCATTERING_TRANSFORM (pbb) -= 2; - free (ds); + /* FIXME: As long as we use PPL we are not able to remove the old + scattering dimensions. The reason is that these dimensions are not + entirely unused. They are not necessary as part of the scheduling + vector, as the earlier dimensions already unambiguously define the + execution time, however they may still be needed to carry modulo + constraints as introduced e.g. by strip mining. The correct solution + would be to project these dimensions out of the scattering polyhedra. + In case they are still required to carry modulo constraints they should be kept + internally as existentially quantified dimensions. PPL does only support + projection of rational polyhedra, however in this case we need an integer + projection. With isl this will be trivial to implement. For now we just + leave the dimensions. This is a little ugly, but should be correct. */ + if (0) { + ds = XNEWVEC (ppl_dimension_type, 2); + ds[0] = inner_dim; + ds[1] = inner_dim + 1; + ppl_Polyhedron_remove_space_dimensions (poly, ds, 2); + PBB_NB_SCATTERING_TRANSFORM (pbb) -= 2; + free (ds); + } } mpz_clear (x); @@ -412,7 +426,21 @@ lst_do_flatten (lst_p lst) if (LST_LOOP_P (l)) { res |= lst_flatten_loop (l, zero); - remove_unused_scattering_dimensions (l); + + /* FIXME: As long as we use PPL we are not able to remove the old + scattering dimensions. The reason is that these dimensions are not + entirely unused. They are not necessary as part of the scheduling + vector, as the earlier dimensions already unambiguously define the + execution time, however they may still be needed to carry modulo + constraints as introduced e.g. by strip mining. The correct solution + would be to project these dimensions out of the scattering polyhedra. + In case they are still required to carry modulo constraints they should be kept + internally as existentially quantified dimensions. PPL does only support + projection of rational polyhedra, however in this case we need an integer + projection. With isl this will be trivial to implement. For now we just + leave the dimensions. This is a little ugly, but should be correct. */ + if (0) + remove_unused_scattering_dimensions (l); } lst_update_scattering (lst); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b0e7c45..64bdac5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-02-15 Tobias Grosser <grosser@fim.uni-passau.de> + + PR tree-optimization/50561 + * gcc.dg/graphite/pr50561.c: New testcase. + 2012-02-15 Georg-Johann Lay <avr@gjlay.de> * gcc.target/avr/torture/builtin_insert_bits-1.c: New test. diff --git a/gcc/testsuite/gcc.dg/graphite/pr50561.c b/gcc/testsuite/gcc.dg/graphite/pr50561.c new file mode 100644 index 0000000..70c6bbc --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr50561.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -floop-flatten -floop-strip-mine" } */ + +void f (unsigned *s) +{ + int n; + for (n = 0; n < 256; n++) + s[n] = 0; +} |