diff --git a/gcc/regrename.c b/gcc/regrename.c
index c38173a77..0ccc5e18c 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -284,6 +284,48 @@ create_new_chain (unsigned this_regno, unsigned this_nregs, rtx *loc,
   return head;
 }
 
+/* For the def-use chain HEAD of SMS block, find the registers with REG_UNUSED
+   conflict its VLIW constraint and set the corresponding bits in *PSET.  */
+
+static void
+merge_vliw_overlapping_regs (HARD_REG_SET *pset, struct du_head *head)
+{
+  rtx_insn *insn;
+  rtx_insn *cur_insn = head->first->insn;
+  basic_block bb = BLOCK_FOR_INSN (cur_insn);
+
+  /* Just run regrename for no-SMS related basic block.  */
+  if ((bb->flags & BB_DISABLE_SCHEDULE) == 0 || (bb->flags & BB_MODIFIED) != 0)
+    return;
+
+  /* SMS related basic block generate VLIW before reload, and avoid disrupting
+     the bundling if the new rename reg is valid for bundling.  */
+  for (insn = prev_active_insn (cur_insn); insn && BLOCK_FOR_INSN (insn) == bb;
+       insn = prev_active_insn (insn))
+    {
+      rtx note;
+
+      for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
+        {
+          if (REG_NOTE_KIND (note) == REG_UNUSED)
+          {
+            int regno = REGNO (XEXP (note, 0));
+            SET_HARD_REG_BIT (*pset, regno);
+            if (dump_file)
+              {
+                fprintf (dump_file, "Register %s may confilct with REG_UNUSED \
+                                     in insn %d\n",
+                         reg_names[regno], INSN_UID (insn));
+              }
+          }
+        }
+
+      /* Walk until the first insn of current vliw.  */
+      if (GET_MODE (insn) == TImode)
+        break;
+    }
+}
+
 /* For a def-use chain HEAD, find which registers overlap its lifetime and
    set the corresponding bits in *PSET.  */
 
@@ -372,6 +414,9 @@ find_rename_reg (du_head_p this_head, enum reg_class super_class,
   /* Mark registers that overlap this chain's lifetime as unavailable.  */
   merge_overlapping_regs (unavailable, this_head);
 
+  /* Mark registers that conflict vliw constraint as unavailable.  */
+  merge_vliw_overlapping_regs (unavailable, this_head);
+
   /* Compute preferred rename class of super union of all the classes
      in the chain.  */
   preferred_class
