The attached change appears to fix PR middle-end/61141. On PA, we can get deleted insn notes in call sequences. The attached change checks to make sure we have a valid insn before calling reset_insn_used_flags and verify_insn_sharing.

Tested on hppa-unknown-linux-gnu, hppa2.0w-hp-hpux11.11 and hppa64-hp- hpux11.11.

OK for trunk?

Dave
--
John David Anglin       dave.ang...@bell.net


2014-05-18  John David Anglin  <dang...@gcc.gnu.org>

        PR middle-end/61141
        * emit-rtl.c (reset_all_used_flags): In a sequence, check that
        XVECEXP (pat, 0, i) is an INSN before calling reset_insn_used_flags.
        (verify_rtl_sharing): Likewise.

Index: emit-rtl.c
===================================================================
--- emit-rtl.c  (revision 210323)
+++ emit-rtl.c  (working copy)
@@ -2698,7 +2698,11 @@
          {
            gcc_assert (REG_NOTES (p) == NULL);
            for (int i = 0; i < XVECLEN (pat, 0); i++)
-             reset_insn_used_flags (XVECEXP (pat, 0, i));
+             {
+               rtx insn = XVECEXP (pat, 0, i);
+               if (INSN_P (insn))
+                 reset_insn_used_flags (insn);
+             }
          }
       }
 }
@@ -2735,7 +2739,11 @@
          verify_insn_sharing (p);
        else
          for (int i = 0; i < XVECLEN (pat, 0); i++)
-           verify_insn_sharing (XVECEXP (pat, 0, i));
+             {
+               rtx insn = XVECEXP (pat, 0, i);
+               if (INSN_P (insn))
+                 verify_insn_sharing (insn);
+             }
       }
 
   reset_all_used_flags ();

Reply via email to