http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60116

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
And the place where we first change insn 39 is when simplifying the comparison
that feeds it, in simplify_set:
  /* If we are setting CC0 or if the source is a COMPARE, look for the use of
     the comparison result and try to simplify it unless we already have used
     undobuf.other_insn.  */
...
6292          rtx pat = PATTERN (other_insn);
6293          undobuf.other_insn = other_insn;
6294          SUBST (*cc_use, tmp);

So, is it a bug that we've kept REG_DEAD flags there in this case, or just
distribute_notes shouldn't perform:
                  /* If the register is being set at TEM, see if that is all
                     TEM is doing.  If so, delete TEM.  Otherwise, make this
                     into a REG_UNUSED note instead. Don't delete sets to
                     global register vars.  */
                  if ((REGNO (XEXP (note, 0)) >= FIRST_PSEUDO_REGISTER
                       || !global_regs[REGNO (XEXP (note, 0))])
                      && reg_set_p (XEXP (note, 0), PATTERN (tem)))
...
                          SET_INSN_DELETED (tem);
Dunno how that could ever be safe if from_insn is the former i2 and i3 is a
different insn and tem has bigger luid than from_insn.  This code seems to be
in there even in 3.2.  Anyway, can somebody more familiar with this have a
look?

Reply via email to