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

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-02-26
                 CC|                            |abel at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Confirmed. Our comparator breaks here:

  /* Prefer SCHED_GROUP_P insns to any others.  */
  if (SCHED_GROUP_P (tmp_insn) != SCHED_GROUP_P (tmp2_insn))
    {
      if (VINSN_UNIQUE_P (tmp_vinsn) && VINSN_UNIQUE_P (tmp2_vinsn))
        return SCHED_GROUP_P (tmp2_insn) ? 1 : -1;

      /* Now uniqueness means SCHED_GROUP_P is set, because schedule groups
         cannot be cloned.  */
      if (VINSN_UNIQUE_P (tmp2_vinsn))
        return 1;
      return -1;
    }

when we have two non-unique insns such that one is in a sched group. That is
not supposed to happen actually, since SCHED_GROUP_P should imply
VINSN_UNIQUE_P. This invariant is broken when sched_macro_fuse_insns sets
SCHED_GROUP_P without looking at deps->readonly.

So while we could get rid of the issue by rewriting the problematic sel-sched
code in terms of SCHED_GROUP_P only, lack of deps->readonly check for
macro-fusion seems like a bigger issue and should be fixed too.

Reply via email to