caller-save.c: Include rtl-iter.h.

gcc/
	* caller-save.c: Include rtl-iter.h.
	(add_used_regs_1): Delete.
	(add_used_regs): Use FOR_EACH_SUBRTX rather than for_each_rtx
	to iterate over subrtxes.  Assert that any remaining pseudos
	have been spilled.

From-SVN: r214621
This commit is contained in:
Richard Sandiford 2014-08-28 06:21:54 +00:00 committed by Richard Sandiford
parent b8ec23acb8
commit 1cb22a678b
2 changed files with 23 additions and 24 deletions

View File

@ -1,3 +1,11 @@
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
* caller-save.c: Include rtl-iter.h.
(add_used_regs_1): Delete.
(add_used_regs): Use FOR_EACH_SUBRTX rather than for_each_rtx
to iterate over subrtxes. Assert that any remaining pseudos
have been spilled.
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
* bt-load.c: Include rtl-iter.h.

View File

@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "addresses.h"
#include "ggc.h"
#include "dumpfile.h"
#include "rtl-iter.h"
#define MOVE_MAX_WORDS (MOVE_MAX / UNITS_PER_WORD)
@ -1336,36 +1337,26 @@ insert_save (struct insn_chain *chain, int before_p, int regno,
return numregs - 1;
}
/* A for_each_rtx callback used by add_used_regs. Add the hard-register
equivalent of each REG to regset DATA. */
static int
add_used_regs_1 (rtx *loc, void *data)
{
unsigned int regno;
regset live;
rtx x;
x = *loc;
live = (regset) data;
if (REG_P (x))
{
regno = REGNO (x);
if (HARD_REGISTER_NUM_P (regno))
bitmap_set_range (live, regno, hard_regno_nregs[regno][GET_MODE (x)]);
else
regno = reg_renumber[regno];
}
return 0;
}
/* A note_uses callback used by insert_one_insn. Add the hard-register
equivalent of each REG to regset DATA. */
static void
add_used_regs (rtx *loc, void *data)
{
for_each_rtx (loc, add_used_regs_1, data);
subrtx_iterator::array_type array;
FOR_EACH_SUBRTX (iter, array, *loc, NONCONST)
{
const_rtx x = *iter;
if (REG_P (x))
{
unsigned int regno = REGNO (x);
if (HARD_REGISTER_NUM_P (regno))
bitmap_set_range ((regset) data, regno,
hard_regno_nregs[regno][GET_MODE (x)]);
else
gcc_checking_assert (reg_renumber[regno] < 0);
}
}
}
/* Emit a new caller-save insn and set the code. */