3) Write a new optimization pass enabled on targets which define NOTICE_UPDATE_CC. I think this pass would be run just before machine dependent reorg, although perhaps there is a better place for it. Walk through the instructions, calling NOTICE_UPDATE_CC on each one. When we find an instruction which sets CC_REG, check the source of the set with the current CC status, just as final_scan_insn does now. If the current CC status is the same, delete the instruction which sets CC_REG.
My gut feeling is that we shouldn't need to do this: the present optimization passes should do this when we have an explicit register.