diff options
author | Richard Henderson <rth@redhat.com> | 2011-08-21 11:49:49 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2011-08-21 11:49:49 -0700 |
commit | 8f06d483ec378303875dbc393e6b112c18604330 (patch) | |
tree | 4e15d94c44bd213a7d4ff4743130d7878d558fb3 /gcc/resource.c | |
parent | b2f7ebc1455ce53ec4d048b85e2fc7d1a94c9e5f (diff) | |
download | gcc-8f06d483ec378303875dbc393e6b112c18604330.zip gcc-8f06d483ec378303875dbc393e6b112c18604330.tar.gz gcc-8f06d483ec378303875dbc393e6b112c18604330.tar.bz2 |
rtl.h (INSN_ANNULLED_BRANCH_P): Only allow JUMP_INSN.
* rtl.h (INSN_ANNULLED_BRANCH_P): Only allow JUMP_INSN.
* dwarf2cfi.c (scan_trace): Test JUMP_P before INSN_ANNULLED_BRANCH_P.
* resource.c (next_insn_no_annul): Likewise.
(mark_set_resources): Likewise.
* reorg.c (delete_from_delay_slot): Likewise.
(dbr_schedule, redundant_insn, try_merge_delay_insns): Likewise.
(get_branch_condition): Test pc_rtx and LABEL_REF before dereferencing.
From-SVN: r177944
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 8380111..ae541fe 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: |