c++: Simplify tsubst_friend_function
[platform/upstream/gcc.git] / gcc / haifa-sched.c
index 58bf704..80687fb 100644 (file)
@@ -1,5 +1,5 @@
 /* Instruction scheduling pass.
-   Copyright (C) 1992-2019 Free Software Foundation, Inc.
+   Copyright (C) 1992-2020 Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
    and currently maintained by, Jim Wilson (wilson@cygnus.com)
 
@@ -141,7 +141,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "cfgbuild.h"
 #include "sched-int.h"
 #include "common/common-target.h"
-#include "params.h"
 #include "dbgcnt.h"
 #include "cfgloop.h"
 #include "dumpfile.h"
@@ -4240,6 +4239,15 @@ remove_notes (rtx_insn *head, rtx_insn *tail)
          if (insn != tail)
            {
              remove_insn (insn);
+             /* If an insn was split just before the EPILOGUE_BEG note and
+                that split created new basic blocks, we could have a
+                BASIC_BLOCK note here.  Safely advance over it in that case
+                and assert that we land on a real insn.  */
+             if (NOTE_P (next)
+                 && NOTE_KIND (next) == NOTE_INSN_BASIC_BLOCK
+                 && next != next_tail)
+               next = NEXT_INSN (next);
+             gcc_assert (INSN_P (next));
              add_reg_note (next, REG_SAVE_NOTE,
                            GEN_INT (NOTE_INSN_EPILOGUE_BEG));
              break;
@@ -5433,6 +5441,7 @@ reemit_notes (rtx_insn *insn)
 
          last = emit_note_before (note_type, last);
          remove_note (insn, note);
+         df_insn_create_insn_record (last);
        }
     }
 }