https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86979

--- Comment #9 from Andrey Belevantsev <abel at gcc dot gnu.org> ---
Eric, thanks for pointing me out to the old PR.  From that and what I could
understand here from the sched logs, it's not clear to me how to correctly
clone REG_ARGS_SIZE insns, so the safest patch of forbidding that completely
works fine.  Alexander, if you have an idea of what can be checked in the
scheduler to relax that, please let me know, I'm happy to implement that.

The safe patch is just like this:

diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 85ff5bd3eb4..05d7eaa72c7 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -3024,6 +3024,10 @@ init_global_and_expr_for_insn (insn_t insn)
       else
         force_unique_p = false;

+    /* Do not copy REG_ARGS_SIZE insns as we fail to adjust them properly
(PR86979).  */
+    if (find_reg_note (insn, REG_ARGS_SIZE, NULL))
+      force_unique_p = true;
+
     if (targetm.sched.get_insn_spec_ds)
       {
        spec_done_ds = targetm.sched.get_insn_spec_ds (insn);

Reply via email to