peep2_attempt should transfer reg dead notes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

 

since I'm using define_peephole2 in combination with peep2_reg_dead_p I
noticed that patterns did not match where it should. The reason is that the
first insn is a result of a previously applied peephole2 pattern and the
REG_DEAD note is not transferred.

 

IMHO this should be fixed in recog.c - and that's what I did before the
REG_ARGS_SIZE note is handled:

 

  /* SBF: move REG_DEAD notes. */

  for (i = match_len; i >= 0; --i)

    {

      int j = peep2_buf_position (peep2_current + i);

      old_insn = peep2_insn_data[j].insn;

      while ((as_note = find_reg_note (old_insn, REG_DEAD, NULL)))

                {

                  rtx reg = XEXP (as_note, 0);

                  rtx_insn * p, * last = 0;

                  for (p = attempt; p; p = NEXT_INSN (p))

                      if (reg_mentioned_p(reg, p))

                               last = p;

 

                  if (last)

                    add_reg_note(last, REG_DEAD, reg);

 

                  remove_note(old_insn, as_note);

                }

    }

 

Also other notes like REG_INC should be transferred too.

 

Kind regards

 

Stefan

 

 

 

 




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux