This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[x86_64 bootstrap] Exit early from maybe_emit_renaming_copy when expr not separable


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]