aboutsummaryrefslogtreecommitdiff
path: root/gcc/resource.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@redhat.com>2002-05-10 05:50:11 -0700
committerDavid S. Miller <davem@gcc.gnu.org>2002-05-10 05:50:11 -0700
commitcf40ea15f61a4535859ca50195eb58a63e3de1ba (patch)
treeb339206e3fbe7651c9692cd72f387b4671880f3f /gcc/resource.c
parent1a499b9250dfd05a03485d281e873b437d67bc9e (diff)
downloadgcc-cf40ea15f61a4535859ca50195eb58a63e3de1ba.zip
gcc-cf40ea15f61a4535859ca50195eb58a63e3de1ba.tar.gz
gcc-cf40ea15f61a4535859ca50195eb58a63e3de1ba.tar.bz2
rtl.h (struct rtx_def): Document unchanging and in_struct flags more accurately.
2002-05-09 David S. Miller <davem@redhat.com> * rtl.h (struct rtx_def): Document unchanging and in_struct flags more accurately. (INSN_ANNULLED_BRANCH_P): Only valid for JUMP_INSN and CALL_INSN, fix comment. (INSN_FROM_TARGET_P): Valid also for CALL_INSN. * doc/rtl.texi: Document these macros more accurately. * recog.c (whole file): Only mess with INSN_ANNULLED_BRANCH_P for JUMP_INSNs and CALL_INSNs. * resource.c (whole file): Only mess with INSN_ANNULLED_BRANCH_P or INSN_FROM_TARGET_P if the code is appropriate. From-SVN: r53360
Diffstat (limited to 'gcc/resource.c')
-rw-r--r--gcc/resource.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/gcc/resource.c b/gcc/resource.c
index e890f87..c6b7570 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -175,10 +175,21 @@ next_insn_no_annul (insn)
{
/* If INSN is an annulled branch, skip any insns from the target
of the branch. */
- if (INSN_ANNULLED_BRANCH_P (insn)
+ if (GET_CODE (insn) == JUMP_INSN
+ && INSN_ANNULLED_BRANCH_P (insn)
&& NEXT_INSN (PREV_INSN (insn)) != insn)
- while (INSN_FROM_TARGET_P (NEXT_INSN (insn)))
- insn = NEXT_INSN (insn);
+ {
+ rtx next = NEXT_INSN (insn);
+ enum rtx_code code = GET_CODE (next);
+
+ while ((code == INSN || code == JUMP_INSN || code == CALL_INSN)
+ && INSN_FROM_TARGET_P (next))
+ {
+ insn = next;
+ next = NEXT_INSN (insn);
+ code = GET_CODE (next);
+ }
+ }
insn = NEXT_INSN (insn);
if (insn && GET_CODE (insn) == INSN
@@ -1007,16 +1018,18 @@ mark_target_live_regs (insns, target, res)
{
rtx link;
rtx real_insn = insn;
+ enum rtx_code code = GET_CODE (insn);
/* If this insn is from the target of a branch, it isn't going to
be used in the sequel. If it is used in both cases, this
test will not be true. */
- if (INSN_FROM_TARGET_P (insn))
+ if ((code == INSN || code == JUMP_INSN || code == CALL_INSN)
+ && INSN_FROM_TARGET_P (insn))
continue;
/* If this insn is a USE made by update_block, we care about the
underlying insn. */
- if (GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == USE
+ if (code == INSN && GET_CODE (PATTERN (insn)) == USE
&& INSN_P (XEXP (PATTERN (insn), 0)))
real_insn = XEXP (PATTERN (insn), 0);