aboutsummaryrefslogtreecommitdiff
path: root/gcc/graphite.c
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2008-10-15 16:17:45 +0000
committerSebastian Pop <spop@gcc.gnu.org>2008-10-15 16:17:45 +0000
commit575da9be0d5aea2f99b4b86ad20e10d4391aae39 (patch)
treecb79e18f32e1dd5d9b1e0daae6ef2a74a18a0c69 /gcc/graphite.c
parent36174c82ee3314e97e8750909f5ff61b7dccbb1b (diff)
downloadgcc-575da9be0d5aea2f99b4b86ad20e10d4391aae39.zip
gcc-575da9be0d5aea2f99b4b86ad20e10d4391aae39.tar.gz
gcc-575da9be0d5aea2f99b4b86ad20e10d4391aae39.tar.bz2
re PR middle-end/37828 ([graphite] ICE in expand_scalar_variables_expr, at graphite.c:3421 with -floop-block)
2008-10-15 Sebastian Pop <sebastian.pop@amd.com> Harsha Jagasia <harsha.jagasia@amd.com> PR tree-optimization/37828 * testsuite/gcc.dg/graphite/pr37828.c: New. * graphite.c (graphite_trans_loop_block): Do not loop block single nested loops. Co-Authored-By: Harsha Jagasia <harsha.jagasia@amd.com> From-SVN: r141142
Diffstat (limited to 'gcc/graphite.c')
-rw-r--r--gcc/graphite.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/graphite.c b/gcc/graphite.c
index a615e2c..c31c305 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -4767,13 +4767,19 @@ graphite_trans_loop_block (VEC (graphite_bb_p, heap) *bbs, int loops)
/* TODO: - Calculate the stride size automatically. */
int stride_size = 64;
+ /* It makes no sense to block a single loop. */
+ for (i = 0; VEC_iterate (graphite_bb_p, bbs, i, gb); i++)
+ if (gbb_nb_loops (gb) < 2)
+ return false;
+
for (i = 0; VEC_iterate (graphite_bb_p, bbs, i, gb); i++)
transform_done |= graphite_trans_bb_block (gb, stride_size, loops);
return transform_done;
}
-/* Loop block all basic blocks of SCOP. */
+/* Loop block all basic blocks of SCOP. Return false when the
+ transform is not performed. */
static bool
graphite_trans_scop_block (scop_p scop)
@@ -4790,10 +4796,10 @@ graphite_trans_scop_block (scop_p scop)
lambda_vector last_schedule = lambda_vector_new (max_schedule);
if (VEC_length (graphite_bb_p, SCOP_BBS (scop)) == 0)
- return transform_done;
+ return false;
/* Get the data of the first bb. */
- gb = VEC_index (graphite_bb_p, SCOP_BBS (scop), 0);
+ gb = VEC_index (graphite_bb_p, SCOP_BBS (scop), 0);
last_nb_loops = gbb_nb_loops (gb);
lambda_vector_copy (GBB_STATIC_SCHEDULE (gb), last_schedule,
last_nb_loops + 1);