===================================================================
@@ -2118,7 +2118,8 @@ lra (FILE *f)
COPY_HARD_REG_SET (lra_no_alloc_regs, ira_no_alloc_regs);
lra_live_range_iter = lra_coalesce_iter = 0;
- lra_constraint_iter = lra_inheritance_iter = lra_undo_inheritance_iter = 0;
+ lra_constraint_iter = lra_constraint_iter_after_spill = 0;
+ lra_inheritance_iter = lra_undo_inheritance_iter = 0;
setup_reg_spill_flag ();
@@ -2214,6 +2215,7 @@ lra (FILE *f)
lra_constraint_new_regno_start = max_reg_num ();
lra_constraint_new_insn_uid_start = get_max_uid ();
bitmap_clear (&lra_matched_pseudos);
+ lra_constraint_iter_after_spill = 0;
}
restore_scratches ();
lra_eliminate (true);
===================================================================
@@ -3460,8 +3460,8 @@ debug_loc_equivalence_change_p (rtx *loc
return result;
}
-/* Maximum number of constraint pass iteration number. It is for
- preventing all LRA cycling. */
+/* Maximum number of constraint pass iteration number after the last
+ spill pass. It is for preventing all LRA cycling. */
#define MAX_CONSTRAINT_ITERATION_NUMBER 15
/* Maximum number of generated reload insns per an insn. It is for
@@ -3471,6 +3471,10 @@ debug_loc_equivalence_change_p (rtx *loc
/* The current iteration number of this LRA pass. */
int lra_constraint_iter;
+/* The current iteration number of this LRA pass after the last spill
+ pass. */
+int lra_constraint_iter_after_spill;
+
/* True if we substituted equiv which needs checking register
allocation correctness because the equivalent value contains
allocatiable hard registers or when we restore multi-register
@@ -3492,7 +3496,8 @@ lra_constraints (bool first_p)
if (lra_dump_file != NULL)
fprintf (lra_dump_file, "\n********** Local #%d: **********\n\n",
lra_constraint_iter);
- if (lra_constraint_iter > MAX_CONSTRAINT_ITERATION_NUMBER)
+ lra_constraint_iter_after_spill++;
+ if (lra_constraint_iter_after_spill > MAX_CONSTRAINT_ITERATION_NUMBER)
internal_error
("Maximum number of LRA constraint passes is achieved (%d)\n",
MAX_CONSTRAINT_ITERATION_NUMBER);
===================================================================
@@ -296,6 +296,7 @@ extern rtx lra_secondary_memory[NUM_MACH
extern int lra_constraint_offset (int, enum machine_mode);
extern int lra_constraint_iter;
+extern int lra_constraint_iter_after_spill;
extern bool lra_risky_transformations_p;
extern int lra_inheritance_iter;
extern int lra_undo_inheritance_iter;