diff options
Diffstat (limited to 'gcc/resource.c')
-rw-r--r-- | gcc/resource.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/resource.c b/gcc/resource.c index 83801112113..ae541fea951 100644 --- a/gcc/resource.c +++ b/gcc/resource.c @@ -171,7 +171,7 @@ next_insn_no_annul (rtx insn) { /* If INSN is an annulled branch, skip any insns from the target of the branch. */ - if (INSN_P (insn) + if (JUMP_P (insn) && INSN_ANNULLED_BRANCH_P (insn) && NEXT_INSN (PREV_INSN (insn)) != insn) { @@ -710,10 +710,18 @@ mark_set_resources (rtx x, struct resources *res, int in_dest, return; case SEQUENCE: - 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); + } + } return; case POST_INC: |