On Thu, Mar 24, 2005 at 11:44:52AM -0500, Ian Lance Taylor wrote: > OK, here is a different approach toward eliminating cc0, based on a > combination of my earlier proposal and what Alex described. I'm > looking for comments from anybody.
One potential problem: once the NOTICE_UPDATE_CC pass is done, we can no longer run *any* pass that reorders code, because we're left with [(set (reg 1) (plus (reg 1) (reg 2))) (clobber (reg cc_reg))] [(set (pc) (if_then_else (lt (reg cc_reg) 0) (label 1) (label 2)))] Note that there's no longer any insn that *sets* cc_reg. I think that's a bit dangerous. One solution to this is to convert the new setter to [(set (reg 1) (plus (reg 1) (reg 2))) (set (reg cc_reg) (unspec [(const_int 0)] cc_set))] I don't think it matters what we set cc_reg to, just that *some* set is visible in the instruction stream. This requires that we generate two patterns for clobbercc insns, but that shouldn't be a problem. Otherwise I like the proposal. In particular, I like being able to reuse the existing NOTICE_UPDATE_CC code. r~