Hi,
I've rebuilt again everything from scratch with the changes to
emit_copy_of_insn_after as Jan suggested  (see patch below) and the
ICE caused by quadratic accumulation of the counter of scratch
registers is gone!

Thanks,
Vladimir

Index: emit-rtl.c
===================================================================
--- emit-rtl.c  (revision 120004)
+++ emit-rtl.c  (working copy)
@@ -5296,16 +5306,16 @@
    if (REG_NOTE_KIND (link) != REG_LABEL)
      {
       if (GET_CODE (link) == EXPR_LIST)
-         REG_NOTES (new)
-           = copy_insn_1 (gen_rtx_EXPR_LIST (REG_NOTE_KIND (link),
-                                             XEXP (link, 0),
-                                             REG_NOTES (new)));
+
+             REG_NOTES (new)
+                   = gen_rtx_EXPR_LIST (REG_NOTE_KIND (link),
+                     copy_insn_1 (XEXP (link, 0)),  REG_NOTES (new));
       else
-         REG_NOTES (new)
-           = copy_insn_1 (gen_rtx_INSN_LIST (REG_NOTE_KIND (link),
-                                             XEXP (link, 0),
-                                             REG_NOTES (new)));
-      }
+              REG_NOTES (new)
+                   = gen_rtx_INSN_LIST (REG_NOTE_KIND (link),
+                     copy_insn_1 (XEXP (link, 0)),  REG_NOTES (new));
+
+     }

  /* Fix the libcall sequences.  */
  if ((note1 = find_reg_note (new, REG_RETVAL, NULL_RTX)) != NULL)

if (GET_CODE (link) == EXPR_LIST)

#if 1
        REG_NOTES (new) =
                      gen_rtx_EXPR_LIST (REG_NOTE_KIND (link),
                      copy_insn_1 (XEXP (link, 0)),  REG_NOTES (new));
#endif

#if 0

  REG_NOTES (new)
           = copy_insn_1 (gen_rtx_EXPR_LIST (REG_NOTE_KIND (link),
                                             XEXP (link, 0),
REG_NOTES (new)));

#endif
       else
#if 0
         REG_NOTES (new)
           = copy_insn_1 (gen_rtx_INSN_LIST (REG_NOTE_KIND (link),
                                             XEXP (link, 0),
                                             REG_NOTES (new)));
#endif
#if 1
             REG_NOTES (new) =
                 gen_rtx_INSN_LIST (REG_NOTE_KIND (link),
                 copy_insn_1 (XEXP (link, 0)),  REG_NOTES (new));
#endif

    }


On 12/19/06, Jan Hubicka <[EMAIL PROTECTED]> wrote:
> Hi, Jan,
> Thanks for fast response!
>
> I've tested the change you proposed and we still failed in the assert
> checking that the number of SCRATCHes being too large (>30) while
> copying the REG_NOTES of the instruction (see below) using just 9
> SCRATCH registers.

Hi,
apparently there seems to be another reason copy_insn_1 can do quadratic
amount of work except for this one, I don't seem to be able to see any
however.  Just for sure, did you updated both cases of wrong recursion,
the EXPR_LIST I sent and the INSN_LIST hunk just bellow?
Otherwise probably adding a breakpoint on copy_insn_1 and seeing how it
manage to do so many recursions will surely help :)

Honza

Reply via email to