sel-sched.c (maybe_emit_renaming_copy): Exit early when expression to rename is not...
authorAlexander Monakov <amonakov@ispras.ru>
Thu, 14 Jan 2010 11:16:02 +0000 (14:16 +0300)
committerAlexander Monakov <amonakov@gcc.gnu.org>
Thu, 14 Jan 2010 11:16:02 +0000 (14:16 +0300)
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

gcc/ChangeLog
gcc/sel-sched.c

index abfd461..26fedcc 100644 (file)
@@ -1,5 +1,10 @@
 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.
 
 2010-01-14  Alexander Monakov  <amonakov@ispras.ru>
index bdc7f9c..a1a0ec0 100644 (file)
@@ -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;