https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71348

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |spop at gcc dot gnu.org
   Target Milestone|---                         |7.0

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Latent graphite problem.

/* Extract an affine expression from the chain of recurrence E.  */

static isl_pw_aff *
extract_affine_chrec (scop_p s, tree e, __isl_take isl_space *space)
{
  isl_pw_aff *lhs = extract_affine (s, CHREC_LEFT (e), isl_space_copy (space));
  isl_pw_aff *rhs = extract_affine (s, CHREC_RIGHT (e), isl_space_copy
(space));
  isl_local_space *ls = isl_local_space_from_space (space);
  unsigned pos = sese_loop_depth (s->scop_info->region, get_chrec_loop (e)) -
1;
  isl_aff *loop = isl_aff_set_coefficient_si
    (isl_aff_zero_on_domain (ls), isl_dim_in, pos, 1);
  isl_pw_aff *l = isl_pw_aff_from_aff (loop);

  /* Before multiplying, make sure that the result is affine.  */
  gcc_assert (isl_pw_aff_is_cst (rhs)
              || isl_pw_aff_is_cst (l));

  return isl_pw_aff_add (lhs, isl_pw_aff_mul (rhs, l));
}

sese_loop_depth returns 0 as get_chrec_loop (e) is not inside the region.  This
makes pos equal to UINT_MAX and things go downhill.  Checking for the situation
here and returning NULL is not enough to fix the problem (that's as far as I
got before deciding to expose the latent issue).

Leaving to graphite knowing people.

Reply via email to