- for (i = 0; i < XVECLEN (x, 0); i++)
- if (! (INSN_ANNULLED_BRANCH_P (XVECEXP (x, 0, 0))
- && INSN_FROM_TARGET_P (XVECEXP (x, 0, i))))
- mark_set_resources (XVECEXP (x, 0, i), res, 0, mark_type);
+ {
+ rtx control = XVECEXP (x, 0, 0);
+ bool annul_p = JUMP_P (control) && INSN_ANNULLED_BRANCH_P (control);
+
+ mark_set_resources (control, res, 0, mark_type);
+ for (i = XVECLEN (x, 0) - 1; i >= 0; --i)
+ {
+ rtx elt = XVECEXP (x, 0, i);
+ if (!annul_p && INSN_FROM_TARGET_P (elt))
+ mark_set_resources (elt, res, 0, mark_type);
+ }
+ }