Commit 53f2f6c1 by Tom de Vries Committed by Tom de Vries

Use function_used_regs variable in collect_fn_hard_reg_usage

2014-06-20  Tom de Vries  <tom@codesourcery.com>

	* final.c (collect_fn_hard_reg_usage): Add and use variable
	function_used_regs.

From-SVN: r211839
parent 569b1784
2014-06-20 Tom de Vries <tom@codesourcery.com>
* final.c (collect_fn_hard_reg_usage): Add and use variable
function_used_regs.
2014-06-20 Jan Hubicka <hubicka@ucw.cz> 2014-06-20 Jan Hubicka <hubicka@ucw.cz>
* cgraph.h (struct symtab_node): Add field in_init_priority_hash * cgraph.h (struct symtab_node): Add field in_init_priority_hash
......
...@@ -4760,13 +4760,13 @@ collect_fn_hard_reg_usage (void) ...@@ -4760,13 +4760,13 @@ collect_fn_hard_reg_usage (void)
int i; int i;
#endif #endif
struct cgraph_rtl_info *node; struct cgraph_rtl_info *node;
HARD_REG_SET function_used_regs;
/* ??? To be removed when all the ports have been fixed. */ /* ??? To be removed when all the ports have been fixed. */
if (!targetm.call_fusage_contains_non_callee_clobbers) if (!targetm.call_fusage_contains_non_callee_clobbers)
return; return;
node = cgraph_rtl_info (current_function_decl); CLEAR_HARD_REG_SET (function_used_regs);
gcc_assert (node != NULL);
for (insn = get_insns (); insn != NULL_RTX; insn = next_insn (insn)) for (insn = get_insns (); insn != NULL_RTX; insn = next_insn (insn))
{ {
...@@ -4779,25 +4779,26 @@ collect_fn_hard_reg_usage (void) ...@@ -4779,25 +4779,26 @@ collect_fn_hard_reg_usage (void)
if (CALL_P (insn) if (CALL_P (insn)
&& !get_call_reg_set_usage (insn, &insn_used_regs, call_used_reg_set)) && !get_call_reg_set_usage (insn, &insn_used_regs, call_used_reg_set))
{ return;
CLEAR_HARD_REG_SET (node->function_used_regs);
return;
}
IOR_HARD_REG_SET (node->function_used_regs, insn_used_regs); IOR_HARD_REG_SET (function_used_regs, insn_used_regs);
} }
/* Be conservative - mark fixed and global registers as used. */ /* Be conservative - mark fixed and global registers as used. */
IOR_HARD_REG_SET (node->function_used_regs, fixed_reg_set); IOR_HARD_REG_SET (function_used_regs, fixed_reg_set);
#ifdef STACK_REGS #ifdef STACK_REGS
/* Handle STACK_REGS conservatively, since the df-framework does not /* Handle STACK_REGS conservatively, since the df-framework does not
provide accurate information for them. */ provide accurate information for them. */
for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++) for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++)
SET_HARD_REG_BIT (node->function_used_regs, i); SET_HARD_REG_BIT (function_used_regs, i);
#endif #endif
node = cgraph_rtl_info (current_function_decl);
gcc_assert (node != NULL);
COPY_HARD_REG_SET (node->function_used_regs, function_used_regs);
node->function_used_regs_valid = 1; node->function_used_regs_valid = 1;
} }
......
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