diff options
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index 78b5c6644c2..f0ce94d0793 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -2163,9 +2163,17 @@ public: for (unsigned i = 1; i < NumDims; ++i) Extent = isl_set_lower_bound_si(Extent, isl_dim_set, i, 0); - for (unsigned i = 1; i < NumDims; ++i) { + for (unsigned i = 0; i < NumDims; ++i) { isl_pw_aff *PwAff = const_cast<isl_pw_aff *>(Array->getDimensionSizePw(i)); + + // isl_pw_aff can be NULL for zero dimension. Only in the case of a + // Fortran array will we have a legitimate dimension. + if (!PwAff) { + assert(i == 0 && "invalid dimension isl_pw_aff for nonzero dimension"); + continue; + } + isl_pw_aff *Val = isl_pw_aff_from_aff(isl_aff_var_on_domain( isl_local_space_from_space(Array->getSpace()), isl_dim_set, i)); PwAff = isl_pw_aff_add_dims(PwAff, isl_dim_in, |