diff options
author | Trevor Saunders <tbsaunde+gcc@tbsaunde.org> | 2016-10-21 12:33:01 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2016-10-21 12:33:01 +0000 |
commit | dfe08bc4ef2810b98e0ce8ffca4155ad304e0429 (patch) | |
tree | 7505bb0ce717bce964eebacad7985b4354429147 /gcc/rtlanal.c | |
parent | 04a121a757f20a4807d47e1d0c7418145b147d69 (diff) | |
download | gcc-dfe08bc4ef2810b98e0ce8ffca4155ad304e0429.zip gcc-dfe08bc4ef2810b98e0ce8ffca4155ad304e0429.tar.gz gcc-dfe08bc4ef2810b98e0ce8ffca4155ad304e0429.tar.bz2 |
make tablejump_p return the label as a rtx_insn *
gcc/ChangeLog:
2016-10-21 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* cfgcleanup.c (merge_blocks_move_successor_nojumps): Adjust.
(outgoing_edges_match): Likewise.
(try_crossjump_to_edge): Likewise.
* cfgrtl.c (try_redirect_by_replacing_jump): Likewise.
(rtl_tidy_fallthru_edge): Likewise.
* rtl.h (tablejump_p): Adjust prototype.
* rtlanal.c (tablejump_p): Return the label as a rtx_insn *.
From-SVN: r241402
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 90b55b6..4e600c0 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -3103,26 +3103,26 @@ rtx_referenced_p (const_rtx x, const_rtx body) *LABELP and the jump table to *TABLEP. LABELP and TABLEP may be NULL. */ bool -tablejump_p (const rtx_insn *insn, rtx *labelp, rtx_jump_table_data **tablep) +tablejump_p (const rtx_insn *insn, rtx_insn **labelp, + rtx_jump_table_data **tablep) { - rtx label; - rtx_insn *table; - if (!JUMP_P (insn)) return false; - label = JUMP_LABEL (insn); - if (label != NULL_RTX && !ANY_RETURN_P (label) - && (table = NEXT_INSN (as_a <rtx_insn *> (label))) != NULL_RTX - && JUMP_TABLE_DATA_P (table)) - { - if (labelp) - *labelp = label; - if (tablep) - *tablep = as_a <rtx_jump_table_data *> (table); - return true; - } - return false; + rtx target = JUMP_LABEL (insn); + if (target == NULL_RTX || ANY_RETURN_P (target)) + return false; + + rtx_insn *label = as_a<rtx_insn *> (target); + rtx_insn *table = next_insn (label); + if (table == NULL_RTX || !JUMP_TABLE_DATA_P (table)) + return false; + + if (labelp) + *labelp = label; + if (tablep) + *tablep = as_a <rtx_jump_table_data *> (table); + return true; } /* A subroutine of computed_jump_p, return 1 if X contains a REG or MEM or |