diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-28 06:23:34 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-28 06:23:34 +0000 |
commit | 15da9a293429e13209bebe021b3e942de5616048 (patch) | |
tree | 9838ef5790ac753d6dab4cc4bcc959abe4c9f6b1 /gcc/jump.c | |
parent | af679a57d56d50071e05117485e268ba25f50147 (diff) | |
download | gcc-15da9a293429e13209bebe021b3e942de5616048.tar.gz |
gcc/
* jump.c: Include rtl-iter.h.
(returnjump_p_1): Delete.
(returnjump_p): Use FOR_EACH_SUBRTX rather than for_each_rtx.
Remove handling of null rtxes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214643 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/gcc/jump.c b/gcc/jump.c index b8d3d52cea9..2a0bea79503 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see #include "predict.h" #include "tree-pass.h" #include "target.h" +#include "rtl-iter.h" /* Optimize jump y; x: ... y: jumpif... x? Don't know if it is worth bothering with. */ @@ -68,7 +69,6 @@ static void mark_jump_label_1 (rtx, rtx, bool, bool); static void mark_jump_label_asm (rtx, rtx); static void redirect_exp_1 (rtx *, rtx, rtx, rtx); static int invert_exp_1 (rtx, rtx); -static int returnjump_p_1 (rtx *, void *); /* Worker for rebuild_jump_labels and rebuild_jump_labels_chain. */ static void @@ -920,39 +920,35 @@ condjump_label (const_rtx insn) return NULL_RTX; } -/* Return true if INSN is a (possibly conditional) return insn. */ - -static int -returnjump_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) -{ - rtx x = *loc; - - if (x == NULL) - return false; - - switch (GET_CODE (x)) - { - case RETURN: - case SIMPLE_RETURN: - case EH_RETURN: - return true; - - case SET: - return SET_IS_RETURN_P (x); - - default: - return false; - } -} - /* Return TRUE if INSN is a return jump. */ int returnjump_p (rtx insn) { - if (!JUMP_P (insn)) - return 0; - return for_each_rtx (&PATTERN (insn), returnjump_p_1, NULL); + if (JUMP_P (insn)) + { + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, PATTERN (insn), NONCONST) + { + const_rtx x = *iter; + switch (GET_CODE (x)) + { + case RETURN: + case SIMPLE_RETURN: + case EH_RETURN: + return true; + + case SET: + if (SET_IS_RETURN_P (x)) + return true; + break; + + default: + break; + } + } + } + return false; } /* Return true if INSN is a (possibly conditional) return insn. */ |