Commit f07013eb by Alexander Monakov Committed by Alexander Monakov

sel-sched.c (maybe_emit_renaming_copy): Exit early when expression to rename is not separable.

2010-01-14  Alexander Monakov  <amonakov@ispras.ru>

	* sel-sched.c (maybe_emit_renaming_copy): Exit early when expression
	to rename is not separable.  Otherwise check that its LHS is not NULL.

From-SVN: r155898
parent a9ced68b
2010-01-14 Alexander Monakov <amonakov@ispras.ru> 2010-01-14 Alexander Monakov <amonakov@ispras.ru>
* sel-sched.c (maybe_emit_renaming_copy): Exit early when expression
to rename is not separable. Otherwise check that its LHS is not NULL.
2010-01-14 Alexander Monakov <amonakov@ispras.ru>
* sel-sched.c (choose_best_reg_1): Loop over all regs for mode. * sel-sched.c (choose_best_reg_1): Loop over all regs for mode.
2010-01-14 Alexander Monakov <amonakov@ispras.ru> 2010-01-14 Alexander Monakov <amonakov@ispras.ru>
......
...@@ -5823,14 +5823,19 @@ maybe_emit_renaming_copy (rtx insn, ...@@ -5823,14 +5823,19 @@ maybe_emit_renaming_copy (rtx insn,
moveop_static_params_p params) moveop_static_params_p params)
{ {
bool insn_emitted = false; bool insn_emitted = false;
rtx cur_reg = expr_dest_reg (params->c_expr); rtx cur_reg;
gcc_assert (!cur_reg || (params->dest && REG_P (params->dest))); /* Bail out early when expression can not be renamed at all. */
if (!EXPR_SEPARABLE_P (params->c_expr))
return false;
cur_reg = expr_dest_reg (params->c_expr);
gcc_assert (cur_reg && params->dest && REG_P (params->dest));
/* If original operation has expr and the register chosen for /* If original operation has expr and the register chosen for
that expr is not original operation's dest reg, substitute that expr is not original operation's dest reg, substitute
operation's right hand side with the register chosen. */ operation's right hand side with the register chosen. */
if (cur_reg != NULL_RTX && REGNO (params->dest) != REGNO (cur_reg)) if (REGNO (params->dest) != REGNO (cur_reg))
{ {
insn_t reg_move_insn, reg_move_insn_rtx; insn_t reg_move_insn, reg_move_insn_rtx;
......
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