diff options
author | Josef Zlomek <zlomekj@suse.cz> | 2003-07-21 19:18:00 +0200 |
---|---|---|
committer | Josef Zlomek <zlomek@gcc.gnu.org> | 2003-07-21 17:18:00 +0000 |
commit | ee735eefd8a7c7dd2b22d85e737c802291489a39 (patch) | |
tree | bcd516494e3a3a432b0f74413525c76618b44685 /gcc/rtlanal.c | |
parent | f345c6b5225e3d4d64686f8b045c4a7bbf016cf0 (diff) | |
download | gcc-ee735eefd8a7c7dd2b22d85e737c802291489a39.zip gcc-ee735eefd8a7c7dd2b22d85e737c802291489a39.tar.gz gcc-ee735eefd8a7c7dd2b22d85e737c802291489a39.tar.bz2 |
cfgcleanup.c (merge_blocks_move_successor_nojumps): Use tablejump_p.
* cfgcleanup.c (merge_blocks_move_successor_nojumps): Use tablejump_p.
* rtlanal.c (tablejump_p): Use next_active_insn for finding the jump
table.
From-SVN: r69637
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index a7d4102..55c1020 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -2795,26 +2795,25 @@ rtx_referenced_p (rtx x, rtx body) return for_each_rtx (&body, rtx_referenced_p_1, x); } -/* If INSN is a jump to jumptable insn rturn true and store the label (which - INSN jumps to) to *LABEL and the tablejump insn to *TABLE. - LABEL and TABLE may be NULL. */ +/* If INSN is a tablejump return true and store the label (before jump table) to + *LABELP and the jump table to *TABLEP. LABELP and TABLEP may be NULL. */ bool -tablejump_p (rtx insn, rtx *label, rtx *table) +tablejump_p (rtx insn, rtx *labelp, rtx *tablep) { - rtx l, t; + rtx label, table; - if (onlyjump_p (insn) - && (l = JUMP_LABEL (insn)) != NULL_RTX - && (t = NEXT_INSN (l)) != NULL_RTX - && GET_CODE (t) == JUMP_INSN - && (GET_CODE (PATTERN (t)) == ADDR_VEC - || GET_CODE (PATTERN (t)) == ADDR_DIFF_VEC)) + if (GET_CODE (insn) == JUMP_INSN + && (label = JUMP_LABEL (insn)) != NULL_RTX + && (table = next_active_insn (label)) != NULL_RTX + && GET_CODE (table) == JUMP_INSN + && (GET_CODE (PATTERN (table)) == ADDR_VEC + || GET_CODE (PATTERN (table)) == ADDR_DIFF_VEC)) { - if (label) - *label = l; - if (table) - *table = t; + if (labelp) + *labelp = label; + if (tablep) + *tablep = table; return true; } return false; |