On 10/28/2010 12:24 PM, Georg Lay wrote:
Emitting a bunch of CLOBBERs in epilogue/sibcall_epilogue works also, at least
for the small example above. But using LOCAL_REGNO seems more natural to me and
that does not clutter RTL.
True. It's a pretty elegant solution, and I missed it in my mail (I'm
not really a backend guy at all, which explains why it's easy for me to
blame backends).
I already had to fix IRA and remove the following part of
ira-color.c::assign_hard_reg() because it makes assumptions that do not hold for
the machine:
if (! allocated_hardreg_p[hard_regno]
&& ira_hard_reg_not_in_set_p (hard_regno, mode, call_used_reg_set))
/* We need to save/restore the hard register in
epilogue/prologue. Therefore we increase the cost. */
{
/* ??? If only part is call clobbered. */
rclass = REGNO_REG_CLASS (hard_regno);
add_cost = (ira_memory_move_cost[mode][rclass][0]
+ ira_memory_move_cost[mode][rclass][1] - 1);
cost += add_cost;
full_cost += add_cost;
}
Maybe you can use LOCAL_REGNO here too, and submit a patch for that?
Paolo