On 01/19/2016 12:33 AM, Jakub Jelinek wrote:
+  if (MAY_HAVE_DEBUG_INSNS)
+    {
+      for (dinsn = BB_END (bb); dinsn != insn; dinsn = PREV_INSN (dinsn))
+       if (DEBUG_INSN_P (dinsn))
+         {
+           df_ref use;
+           FOR_EACH_INSN_USE (use, dinsn)
+             if (refers_to_regno_p (dregno, end_dregno,
+                                    DF_REF_REG (use), (rtx *) NULL))
+               dead_debug_add (debug, use, DF_REF_REGNO (use));
+         }
+    }
+
   /* At this point we are committed to moving INSN, but let's try to
      move it as far as we can.  */
   do
@@ -363,6 +380,18 @@ move_insn_for_shrink_wrap (basic_block b
          if (!live_edge || EDGE_COUNT (live_edge->dest->preds) > 1)
            break;
          next_block = live_edge->dest;
+         if (MAY_HAVE_DEBUG_INSNS)
+           {
+             FOR_BB_INSNS_REVERSE (bb, dinsn)
+               if (DEBUG_INSN_P (dinsn))
+                 {
+                   df_ref use;
+                   FOR_EACH_INSN_USE (use, dinsn)
+                     if (refers_to_regno_p (dregno, end_dregno,
+                                            DF_REF_REG (use), (rtx *) NULL))
+                       dead_debug_add (debug, use, DF_REF_REGNO (use));
+                 }
+           }
        }
     }

Is there a way to merge these two blocks (e.g. by moving this to the start of the loop and testing for insn or BB_HEAD)?


Bernd

Reply via email to