+2019-08-16 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR tree-optimization/91109
+ * lra-int.h (lra_need_for_scratch_reg_p): Declare.
+ * lra.c (lra): Use lra_need_for_scratch_reg_p.
+ * lra-spills.c (lra_need_for_scratch_reg_p): New function.
+
2019-08-16 Uroš Bizjak <ubizjak@gmail.com>
* config/i386/mmx.md (mmxdoublemode): New mode attribute.
/* lra-spills.c: */
+extern bool lra_need_for_scratch_reg_p (void);
extern bool lra_need_for_spills_p (void);
extern void lra_spill (void);
extern void lra_final_code_change (void);
}
}
+/* Return true if we need scratch reg assignments. */
+bool
+lra_need_for_scratch_reg_p (void)
+{
+ int i; max_regno = max_reg_num ();
+
+ for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
+ if (lra_reg_info[i].nrefs != 0 && lra_get_regno_hard_regno (i) < 0
+ && lra_former_scratch_p (i))
+ return true;
+ return false;
+}
+
/* Return true if we need to change some pseudos into memory. */
bool
lra_need_for_spills_p (void)
lra_create_live_ranges (lra_reg_spill_p, true);
live_p = true;
if (! lra_need_for_spills_p ())
- break;
+ {
+ if (lra_need_for_scratch_reg_p ())
+ continue;
+ break;
+ }
}
lra_spill ();
/* Assignment of stack slots changes elimination offsets for