Commit bc702273 by Richard Sandiford Committed by Richard Sandiford

jump.c: Include rtl-iter.h.

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.

From-SVN: r214643
parent 40954ce5
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com> 2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
* 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.
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
* ira.c: Include rtl-iter.h. * ira.c: Include rtl-iter.h.
(set_paradoxical_subreg): Turn from being a for_each_rtx callback (set_paradoxical_subreg): Turn from being a for_each_rtx callback
to being a function that examines each subrtx itself. Remove to being a function that examines each subrtx itself. Remove
......
...@@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see
#include "predict.h" #include "predict.h"
#include "tree-pass.h" #include "tree-pass.h"
#include "target.h" #include "target.h"
#include "rtl-iter.h"
/* Optimize jump y; x: ... y: jumpif... x? /* Optimize jump y; x: ... y: jumpif... x?
Don't know if it is worth bothering with. */ Don't know if it is worth bothering with. */
...@@ -68,7 +69,6 @@ static void mark_jump_label_1 (rtx, rtx, bool, bool); ...@@ -68,7 +69,6 @@ static void mark_jump_label_1 (rtx, rtx, bool, bool);
static void mark_jump_label_asm (rtx, rtx); static void mark_jump_label_asm (rtx, rtx);
static void redirect_exp_1 (rtx *, rtx, rtx, rtx); static void redirect_exp_1 (rtx *, rtx, rtx, rtx);
static int invert_exp_1 (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. */ /* Worker for rebuild_jump_labels and rebuild_jump_labels_chain. */
static void static void
...@@ -920,16 +920,17 @@ condjump_label (const_rtx insn) ...@@ -920,16 +920,17 @@ condjump_label (const_rtx insn)
return NULL_RTX; return NULL_RTX;
} }
/* Return true if INSN is a (possibly conditional) return insn. */ /* Return TRUE if INSN is a return jump. */
static int int
returnjump_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) returnjump_p (rtx insn)
{ {
rtx x = *loc; if (JUMP_P (insn))
{
if (x == NULL) subrtx_iterator::array_type array;
return false; FOR_EACH_SUBRTX (iter, array, PATTERN (insn), NONCONST)
{
const_rtx x = *iter;
switch (GET_CODE (x)) switch (GET_CODE (x))
{ {
case RETURN: case RETURN:
...@@ -938,21 +939,16 @@ returnjump_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) ...@@ -938,21 +939,16 @@ returnjump_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED)
return true; return true;
case SET: case SET:
return SET_IS_RETURN_P (x); if (SET_IS_RETURN_P (x))
return true;
break;
default: default:
return false; break;
} }
} }
}
/* Return TRUE if INSN is a return jump. */ return false;
int
returnjump_p (rtx insn)
{
if (!JUMP_P (insn))
return 0;
return for_each_rtx (&PATTERN (insn), returnjump_p_1, NULL);
} }
/* Return true if INSN is a (possibly conditional) return insn. */ /* Return true if INSN is a (possibly conditional) return insn. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment