diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-11-23 18:05:04 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-11-23 18:05:04 -0500 |
commit | 65753f559890e97f7d0296a6558300dc9ee98e23 (patch) | |
tree | 30b302e73b191d5c0b56dbe21856c1842af4c017 /gcc/reorg.c | |
parent | 647902e0abaafd1c5016a6dcfc6a9aa0e93ec11b (diff) | |
download | gcc-65753f559890e97f7d0296a6558300dc9ee98e23.tar.gz |
(rare_destination): Ensure we always correctly handle a null
JUMP_LABEL.
From-SVN: r6150
Diffstat (limited to 'gcc/reorg.c')
-rw-r--r-- | gcc/reorg.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c index 515964ce0c6..d62fd2d4cbd 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -1239,7 +1239,7 @@ get_jump_flags (insn, label) return flags; } -/* Return 1 if DEST is a destination that will be branched to rarely (the +/* Return 1 if INSN is a destination that will be branched to rarely (the return point of a function); return 2 if DEST will be branched to very rarely (a call to a function that doesn't return). Otherwise, return 0. */ @@ -1249,12 +1249,15 @@ rare_destination (insn) rtx insn; { int jump_count = 0; + rtx next; - for (; insn; insn = NEXT_INSN (insn)) + for (; insn; insn = next) { if (GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == SEQUENCE) insn = XVECEXP (PATTERN (insn), 0, 0); + next = NEXT_INSN (insn); + switch (GET_CODE (insn)) { case CODE_LABEL: @@ -1270,7 +1273,7 @@ rare_destination (insn) return 1; else if (simplejump_p (insn) && jump_count++ < 10) - insn = JUMP_LABEL (insn); + next = JUMP_LABEL (insn); else return 0; } |