This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re:Fix PR middle end/18718, REG_SAVE_NOTE related segfault


Alan Modra wrote:
>	PR middle end/18718
>	* sched-rgn.c (schedule_region): Don't assume REG_SAVE_NOTEs are
>	in pairs.

<See http://gcc.gnu.org/ml/gcc-patches/2004-11/msg02654.html>

This fixes fallout from my earlier patch to sched_analyze to not save
NOTE_INSN_EH_REGION notes (which cannot exist until after sched2), see
http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01357.html.

The result of my patch is that REG_SAVE_NOTE do not appear in pairs
anymore there.  They used to appear in pairs, always.  After my patch this is no longer the case, but apparently I overlooked the places in
sched-reg.c (addressed by Alan's patch) and sched-ebb.c (which I just
noticed) where we still expect REG_SAVE_NOTEs to appear in pairs.

Alan's patch looks obviously OK to me, but I can't approve it.  As I
mentioned, the same problem also exists in sched-ebb.c:526-532:

      for (note = REG_NOTES (head); note; note = XEXP (note, 1))
        if (REG_NOTE_KIND (note) == REG_SAVE_NOTE)
          {
            remove_note (head, note);
            note = XEXP (note, 1);
            remove_note (head, note);
          }

This should now be:

      for (note = REG_NOTES (head); note; note = XEXP (note, 1))
        if (REG_NOTE_KIND (note) == REG_SAVE_NOTE)
          remove_note (head, note);

I grepped in the tree and found no other places where this same bug
could still secretly be lurking.

Gr.
Steven



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]