Commit d0608e59 by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/55193 (ICE in in simplify_const_unary_operation, at simplify-rtx.c:1659)

	PR rtl-optimization/55193
	* lra-constraints.c (loc_equivalence_callback): New function.
	(lra_constraints): Call simplify_replace_fn_rtx instead of
	loc_equivalence_change_p on DEBUG_INSNs.

From-SVN: r194405
parent 0ab19cbc
2012-12-11 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/55193
* lra-constraints.c (loc_equivalence_callback): New function.
(lra_constraints): Call simplify_replace_fn_rtx instead of
loc_equivalence_change_p on DEBUG_INSNs.
2012-12-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2012-12-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/55642 PR target/55642
...@@ -3186,6 +3186,21 @@ loc_equivalence_change_p (rtx *loc) ...@@ -3186,6 +3186,21 @@ loc_equivalence_change_p (rtx *loc)
return result; return result;
} }
/* Similar to loc_equivalence_change_p, but for use as
simplify_replace_fn_rtx callback. */
static rtx
loc_equivalence_callback (rtx loc, const_rtx, void *)
{
if (!REG_P (loc))
return NULL_RTX;
rtx subst = get_equiv_substitution (loc);
if (subst != loc)
return subst;
return NULL_RTX;
}
/* Maximum allowed number of constraint pass iterations after the last /* Maximum allowed number of constraint pass iterations after the last
spill pass. It is for preventing LRA cycling in a bug case. */ spill pass. It is for preventing LRA cycling in a bug case. */
#define MAX_CONSTRAINT_ITERATION_NUMBER 30 #define MAX_CONSTRAINT_ITERATION_NUMBER 30
...@@ -3422,11 +3437,17 @@ lra_constraints (bool first_p) ...@@ -3422,11 +3437,17 @@ lra_constraints (bool first_p)
/* We need to check equivalence in debug insn and change /* We need to check equivalence in debug insn and change
pseudo to the equivalent value if necessary. */ pseudo to the equivalent value if necessary. */
curr_id = lra_get_insn_recog_data (curr_insn); curr_id = lra_get_insn_recog_data (curr_insn);
if (bitmap_bit_p (&equiv_insn_bitmap, INSN_UID (curr_insn)) if (bitmap_bit_p (&equiv_insn_bitmap, INSN_UID (curr_insn)))
&& loc_equivalence_change_p (curr_id->operand_loc[0]))
{ {
lra_update_insn_regno_info (curr_insn); rtx old = *curr_id->operand_loc[0];
changed_p = true; *curr_id->operand_loc[0]
= simplify_replace_fn_rtx (old, NULL_RTX,
loc_equivalence_callback, NULL);
if (old != *curr_id->operand_loc[0])
{
lra_update_insn_regno_info (curr_insn);
changed_p = true;
}
} }
} }
else if (INSN_P (curr_insn)) else if (INSN_P (curr_insn))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment