+2014-01-18 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * jump.c (delete_related_insns): Keep (use (insn))s.
+ * reorg.c (redundant_insn): Check for barriers too.
+
2014-01-17 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (ix86_split_lea_for_addr): Fix a comment
/* Keep going past other deleted labels to delete what follows. */
else if (code == CODE_LABEL && INSN_DELETED_P (next))
next = NEXT_INSN (next);
+ /* Keep the (use (insn))s created by dbr_schedule, which needs
+ them in order to track liveness relative to a previous
+ barrier. */
+ else if (INSN_P (next)
+ && GET_CODE (PATTERN (next)) == USE
+ && INSN_P (XEXP (PATTERN (next), 0)))
+ next = NEXT_INSN (next);
else if (code == BARRIER || INSN_P (next))
/* Note: if this deletes a jump, it can cause more
deletion of unreachable code, after a different label.
trial && insns_to_search > 0;
trial = PREV_INSN (trial))
{
- if (LABEL_P (trial))
+ /* (use (insn))s can come immediately after a barrier if the
+ label that used to precede them has been deleted as dead.
+ See delete_related_insns. */
+ if (LABEL_P (trial) || BARRIER_P (trial))
return 0;
if (!INSN_P (trial))