View | Details | Return to bug 65779 | Differences between
and this patch

Collapse All | Expand All

(-)gcc/shrink-wrap.c (+25 lines)
Lines 182-187 live_edge_for_reg (basic_block bb, int regno, int Link Here
182
  return live_edge;
182
  return live_edge;
183
}
183
}
184
184
185
bool
186
debug_uses_reg (rtx pat, unsigned int regno)
187
{
188
  subrtx_iterator::array_type array;
189
  FOR_EACH_SUBRTX (iter, array, pat, NONCONST)
190
    {
191
      const_rtx x = *iter;
192
      if (REG_P (x) && REGNO (x) == regno)
193
	return true;
194
    }
195
  return false;
196
}
197
185
/* Try to move INSN from BB to a successor.  Return true on success.
198
/* Try to move INSN from BB to a successor.  Return true on success.
186
   USES and DEFS are the set of registers that are used and defined
199
   USES and DEFS are the set of registers that are used and defined
187
   after INSN in BB.  SPLIT_P indicates whether a live edge from BB
200
   after INSN in BB.  SPLIT_P indicates whether a live edge from BB
Lines 200-205 move_insn_for_shrink_wrap (basic_block bb, rtx_ins Link Here
200
  unsigned int end_sregno = FIRST_PSEUDO_REGISTER;
213
  unsigned int end_sregno = FIRST_PSEUDO_REGISTER;
201
  basic_block next_block;
214
  basic_block next_block;
202
  edge live_edge;
215
  edge live_edge;
216
  rtx_insn *dinsn;
203
217
204
  /* Look for a simple register assignment.  We don't use single_set here
218
  /* Look for a simple register assignment.  We don't use single_set here
205
     because we can't deal with any CLOBBERs, USEs, or REG_UNUSED secondary
219
     because we can't deal with any CLOBBERs, USEs, or REG_UNUSED secondary
Lines 427-432 move_insn_for_shrink_wrap (basic_block bb, rtx_ins Link Here
427
    }
441
    }
428
442
429
  emit_insn_after (PATTERN (insn), bb_note (bb));
443
  emit_insn_after (PATTERN (insn), bb_note (bb));
444
  for (dinsn = insn;
445
       dinsn && dinsn != NEXT_INSN (BB_END (bb));
446
       dinsn = NEXT_INSN (dinsn))
447
    {
448
      if (DEBUG_INSN_P (dinsn)
449
	  && (debug_uses_reg (INSN_VAR_LOCATION_LOC (dinsn), dregno)))
450
	{
451
	  INSN_VAR_LOCATION_LOC (dinsn) = gen_rtx_UNKNOWN_VAR_LOC ();
452
	  break;
453
	}
454
    }
430
  delete_insn (insn);
455
  delete_insn (insn);
431
  return true;
456
  return true;
432
}
457
}

Return to bug 65779