diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-21 18:49:49 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-21 18:49:49 +0000 |
commit | 7e66a69e4c53db6e8c36e50b922cd104b35d7b2f (patch) | |
tree | 4e15d94c44bd213a7d4ff4743130d7878d558fb3 /gcc/resource.c | |
parent | 895d206312dea4e0ab292d5f08dd6d9c9b617bd6 (diff) | |
download | gcc-7e66a69e4c53db6e8c36e50b922cd104b35d7b2f.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177944 138bc75d-0d04-0410-961f-82ee72b054a4
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: |