]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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 abfd461671cb73a14ce392b0ecd24c74d625b38c..26fedcca63922227c0595bfcc74b705d80155432 100644 (file)
@@ -1,3 +1,8 @@
+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.
index bdc7f9c42bcf60805051bfc347f8ec7d078df556..a1a0ec06e0d15397cb99d65e89786d12f0c311fa 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;