This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[x86_64 bootstrap] Exit early from maybe_emit_renaming_copy when expr not separable
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Cc: abel at ispras dot ru, vmakarov at redhat dot com, Alexander Monakov <amonakov at ispras dot ru>
- Date: Wed, 30 Dec 2009 19:33:52 +0300
- Subject: [x86_64 bootstrap] Exit early from maybe_emit_renaming_copy when expr not separable
- References: <4B3B7703.1070409@ispras.ru>
We may have expressions that cannot be renamed but have recorded LHS and RHS
so that they can be substituted. Due to this, we had an incorrect assert in
maybe_emit_renamig_copy, which is fixed by using EXPR_SEPARABLE_P to check for
expressions that cannot be renamed.
2009-12-30 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.
---
gcc/sel-sched.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index ce55aec..870f746 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -5823,14 +5823,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;
--
1.6.4.3