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

Backport from mainline:
 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: r163511
This commit is contained in:
Andrey Belevantsev 2010-08-24 13:05:46 +04:00 committed by Andrey Belevantsev
parent e9b7434933
commit 93e66df2e3
2 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2010-08-24 Andrey Belevantsev <abel@ispras.ru>
Backport from mainline:
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-08-24 Andrey Belevantsev <abel@ispras.ru>
Backport from mainline:

View File

@ -5583,14 +5583,19 @@ maybe_emit_renaming_copy (rtx insn,
moveop_static_params_p params)
{
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
that expr is not original operation's dest reg, substitute
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;