Preserving clobbers in scheduling
Jeff Sturm
jsturm@one-point.com
Wed Aug 29 22:03:00 GMT 2001
Still looking at c++/4012, I've come to this code in
dw2_build_landing_pads:
/* If the eh_return data registers are call-saved, then we
won't have considered them clobbered from the call that
threw. Kill them now. */
for (j = 0; ; ++j)
{
unsigned r = EH_RETURN_DATA_REGNO (j);
if (r == INVALID_REGNUM)
break;
if (! call_used_regs[r])
emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, r)));
}
Since SPARC uses %i0-i3 for EH return data, the above applies in this
case. And the clobber works as expected, if not for the scheduling pass,
where it is moved beyond the insns that are dependent on it. The
dependency is not obvious at this point, because global register
allocation hasn't happened yet so no pseudo registers are mapped yet
to the hard register named in the clobber insn.
Am I correct in thinking that it is not safe to move a clobber of a hard
register in the scheduling pass? I could really use some guidance here,
since I do not normally work with the backend.
Jeff
More information about the Gcc
mailing list