Commit e30edd6c by J"orn Rennecke Committed by Joern Rennecke

caller-save.c: (this_insn_sets): Move into: (save_call_clobbered_regs).

2005-11-24  J"orn Rennecke <joern.rennecke@st.com>

	* caller-save.c: (this_insn_sets): Move into:
	(save_call_clobbered_regs).
	(mark_set_regs): Get this_insn_sets from data.

	(save_call_clobbered_regs): Take sets of the return value by
	sibcalls into account.

From-SVN: r107469
parent 8a99f6f9
2005-11-24 J"orn Rennecke <joern.rennecke@st.com> 2005-11-24 J"orn Rennecke <joern.rennecke@st.com>
* caller-save.c: (this_insn_sets): Move into:
(save_call_clobbered_regs).
(mark_set_regs): Get this_insn_sets from data.
(save_call_clobbered_regs): Take sets of the return value by
sibcalls into account.
2005-11-24 J"orn Rennecke <joern.rennecke@st.com>
PR target/21623: PR target/21623:
* regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove
......
...@@ -83,10 +83,6 @@ static int n_regs_saved; ...@@ -83,10 +83,6 @@ static int n_regs_saved;
insn. */ insn. */
static HARD_REG_SET referenced_regs; static HARD_REG_SET referenced_regs;
/* Computed in mark_set_regs, holds all registers set by the current
instruction. */
static HARD_REG_SET this_insn_sets;
static void mark_set_regs (rtx, rtx, void *); static void mark_set_regs (rtx, rtx, void *);
static void mark_referenced_regs (rtx); static void mark_referenced_regs (rtx);
...@@ -370,6 +366,10 @@ save_call_clobbered_regs (void) ...@@ -370,6 +366,10 @@ save_call_clobbered_regs (void)
struct insn_chain *chain, *next; struct insn_chain *chain, *next;
enum machine_mode save_mode [FIRST_PSEUDO_REGISTER]; enum machine_mode save_mode [FIRST_PSEUDO_REGISTER];
/* Computed in mark_set_regs, holds all registers set by the current
instruction. */
HARD_REG_SET this_insn_sets;
CLEAR_HARD_REG_SET (hard_regs_saved); CLEAR_HARD_REG_SET (hard_regs_saved);
n_regs_saved = 0; n_regs_saved = 0;
...@@ -448,7 +448,12 @@ save_call_clobbered_regs (void) ...@@ -448,7 +448,12 @@ save_call_clobbered_regs (void)
multi-hard-reg pseudo; then the pseudo is considered live multi-hard-reg pseudo; then the pseudo is considered live
during the call, but the subreg that is set isn't. */ during the call, but the subreg that is set isn't. */
CLEAR_HARD_REG_SET (this_insn_sets); CLEAR_HARD_REG_SET (this_insn_sets);
note_stores (PATTERN (insn), mark_set_regs, NULL); note_stores (PATTERN (insn), mark_set_regs, &this_insn_sets);
/* Sibcalls are considered to set the return value,
compare flow.c:propagate_one_insn. */
if (SIBLING_CALL_P (insn) && current_function_return_rtx)
mark_set_regs (current_function_return_rtx, NULL_RTX,
&this_insn_sets);
/* Compute which hard regs must be saved before this call. */ /* Compute which hard regs must be saved before this call. */
AND_COMPL_HARD_REG_SET (hard_regs_to_save, call_fixed_reg_set); AND_COMPL_HARD_REG_SET (hard_regs_to_save, call_fixed_reg_set);
...@@ -484,16 +489,17 @@ save_call_clobbered_regs (void) ...@@ -484,16 +489,17 @@ save_call_clobbered_regs (void)
} }
} }
/* Here from note_stores when an insn stores a value in a register. /* Here from note_stores, or directly from save_call_clobbered_regs, when
an insn stores a value in a register.
Set the proper bit or bits in this_insn_sets. All pseudos that have Set the proper bit or bits in this_insn_sets. All pseudos that have
been assigned hard regs have had their register number changed already, been assigned hard regs have had their register number changed already,
so we can ignore pseudos. */ so we can ignore pseudos. */
static void static void
mark_set_regs (rtx reg, rtx setter ATTRIBUTE_UNUSED, mark_set_regs (rtx reg, rtx setter ATTRIBUTE_UNUSED, void *data)
void *data ATTRIBUTE_UNUSED)
{ {
int regno, endregno, i; int regno, endregno, i;
enum machine_mode mode = GET_MODE (reg); enum machine_mode mode = GET_MODE (reg);
HARD_REG_SET *this_insn_sets = data;
if (GET_CODE (reg) == SUBREG) if (GET_CODE (reg) == SUBREG)
{ {
...@@ -511,7 +517,7 @@ mark_set_regs (rtx reg, rtx setter ATTRIBUTE_UNUSED, ...@@ -511,7 +517,7 @@ mark_set_regs (rtx reg, rtx setter ATTRIBUTE_UNUSED,
endregno = regno + hard_regno_nregs[regno][mode]; endregno = regno + hard_regno_nregs[regno][mode];
for (i = regno; i < endregno; i++) for (i = regno; i < endregno; i++)
SET_HARD_REG_BIT (this_insn_sets, i); SET_HARD_REG_BIT (*this_insn_sets, i);
} }
/* Here from note_stores when an insn stores a value in a register. /* Here from note_stores when an insn stores a value in a register.
......
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