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

--- Comment #3 from amker at gcc dot gnu.org ---
Predcom uses below comparison function to make sure references in chain are
sorted in lexicographic order.  That is, inter-iteration deps are sorted in
iteration order; intra-iteration deps are sorted in dominant order.

/* Compares two drefs A and B by their offset and position.  Callback for
   qsort.  */

static int
order_drefs (const void *a, const void *b)
{
  const dref *const da = (const dref *) a;
  const dref *const db = (const dref *) b;
  int offcmp = wi::cmps ((*da)->offset, (*db)->offset);

  if (offcmp != 0)
    return offcmp;

  return (*da)->pos - (*db)->pos;
}

The issue is triggered by re-association of combination, in which
re-association position is different to the original reference point.  It's
wrong to generate/replace re-associated combined reference using order of the
original combined chain.  Working on a fix.

Reply via email to