This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Preserving clobbers in scheduling

Still looking at c++/4012, I've come to this code in

  /* 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)
      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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]