Commit a2250fe9 by Richard Sandiford Committed by Richard Sandiford

cfgcleanup.c: Include rtl-iter.h.

gcc/
	* cfgcleanup.c: Include rtl-iter.h.
	(mentions_nonequal_regs): Turn from being a for_each_rtx callback
	to being a function that examines each subrtx itself.
	(thread_jump): Update accordingly.

From-SVN: r214626
parent f8305d18
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com> 2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
* cfgcleanup.c: Include rtl-iter.h.
(mentions_nonequal_regs): Turn from being a for_each_rtx callback
to being a function that examines each subrtx itself.
(thread_jump): Update accordingly.
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
* combine-stack-adj.c: Include rtl-iter.h. * combine-stack-adj.c: Include rtl-iter.h.
(record_stack_refs_data): Delete. (record_stack_refs_data): Delete.
(record_stack_refs): Turn from being a for_each_rtx callback (record_stack_refs): Turn from being a for_each_rtx callback
......
...@@ -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 "dce.h" #include "dce.h"
#include "dbgcnt.h" #include "dbgcnt.h"
#include "emit-rtl.h" #include "emit-rtl.h"
#include "rtl-iter.h"
#define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK) #define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK)
...@@ -81,7 +82,6 @@ static edge thread_jump (edge, basic_block); ...@@ -81,7 +82,6 @@ static edge thread_jump (edge, basic_block);
static bool mark_effect (rtx, bitmap); static bool mark_effect (rtx, bitmap);
static void notice_new_block (basic_block); static void notice_new_block (basic_block);
static void update_forwarder_flag (basic_block); static void update_forwarder_flag (basic_block);
static int mentions_nonequal_regs (rtx *, void *);
static void merge_memattrs (rtx, rtx); static void merge_memattrs (rtx, rtx);
/* Set flags for newly created block. */ /* Set flags for newly created block. */
...@@ -235,29 +235,31 @@ mark_effect (rtx exp, regset nonequal) ...@@ -235,29 +235,31 @@ mark_effect (rtx exp, regset nonequal)
} }
} }
/* Return nonzero if X is a register set in regset DATA. /* Return true if X contains a register in NONEQUAL. */
Called via for_each_rtx. */ static bool
static int mentions_nonequal_regs (const_rtx x, regset nonequal)
mentions_nonequal_regs (rtx *x, void *data)
{ {
regset nonequal = (regset) data; subrtx_iterator::array_type array;
if (REG_P (*x)) FOR_EACH_SUBRTX (iter, array, x, NONCONST)
{ {
int regno; const_rtx x = *iter;
if (REG_P (x))
regno = REGNO (*x); {
unsigned int regno = REGNO (x);
if (REGNO_REG_SET_P (nonequal, regno)) if (REGNO_REG_SET_P (nonequal, regno))
return 1; return true;
if (regno < FIRST_PSEUDO_REGISTER) if (regno < FIRST_PSEUDO_REGISTER)
{ {
int n = hard_regno_nregs[regno][GET_MODE (*x)]; int n = hard_regno_nregs[regno][GET_MODE (x)];
while (--n > 0) while (--n > 0)
if (REGNO_REG_SET_P (nonequal, regno + n)) if (REGNO_REG_SET_P (nonequal, regno + n))
return 1; return true;
} }
} }
return 0; }
return false;
} }
/* Attempt to prove that the basic block B will have no side effects and /* Attempt to prove that the basic block B will have no side effects and
always continues in the same edge if reached via E. Return the edge always continues in the same edge if reached via E. Return the edge
if exist, NULL otherwise. */ if exist, NULL otherwise. */
...@@ -381,7 +383,7 @@ thread_jump (edge e, basic_block b) ...@@ -381,7 +383,7 @@ thread_jump (edge e, basic_block b)
/* cond2 must not mention any register that is not equal to the /* cond2 must not mention any register that is not equal to the
former block. */ former block. */
if (for_each_rtx (&cond2, mentions_nonequal_regs, nonequal)) if (mentions_nonequal_regs (cond2, nonequal))
goto failed_exit; goto failed_exit;
EXECUTE_IF_SET_IN_REG_SET (nonequal, 0, i, rsi) EXECUTE_IF_SET_IN_REG_SET (nonequal, 0, i, rsi)
......
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