summaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authortbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-21 12:33:01 +0000
committertbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-21 12:33:01 +0000
commitbc5cd04e5abf132003d84c8b0fb9420479b70d35 (patch)
tree7505bb0ce717bce964eebacad7985b4354429147 /gcc/rtlanal.c
parentc7799456d3b070d6235ec83a2f67595ea480b39a (diff)
downloadgcc-bc5cd04e5abf132003d84c8b0fb9420479b70d35.tar.gz
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 *. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241402 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 90b55b6adf0..4e600c0de6d 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