https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68314
--- Comment #2 from Sebastian Pop <spop at gcc dot gnu.org> --- This patch exposes the problem without valgrind: diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c index 2054fad..b932dae 100644 --- a/gcc/graphite-sese-to-poly.c +++ b/gcc/graphite-sese-to-poly.c @@ -143,6 +143,9 @@ build_pbb_minimal_scattering_polyhedrons (isl_aff *static_sched, poly_bb_p pbb, /* False for loop dimension. */ sequence_and_loop_dims[i + j] = false; } + + gcc_assert (nb_sequence_dim > j); + /* Fake loops make things shifted by one. */ if (sequence_dims && sequence_dims[j] == i) sequence_and_loop_dims[i + j] = true;