Index: llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp =================================================================== --- llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp +++ llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp @@ -1733,8 +1733,9 @@ .addReg(DstHiReg); // Move the sign bit to the C flag. - buildMI(MBB, MBBI, AVR::ADDRdRr).addReg(DstHiReg) - .addReg(DstHiReg, RegState::Define | getDeadRegState(DstIsDead)) + buildMI(MBB, MBBI, AVR::ADDRdRr) + .addReg(DstHiReg, RegState::Define, getDeadRegState(DstIsDead)) + .addReg(DstHiReg, getKillRegState(DstIsKill) | getDeadRegState(DstIsDead)) .addReg(DstHiReg, getKillRegState(DstIsKill)); // Set upper byte to 0 or -1.