diff --git a/src/base/SMPInstr.cpp b/src/base/SMPInstr.cpp index 1cc348352fc89fb82d3e680c607f9dd32eacfad0..0bd82941c1d1bea911cca7e2573581f153b13363 100644 --- a/src/base/SMPInstr.cpp +++ b/src/base/SMPInstr.cpp @@ -5581,10 +5581,19 @@ void SMPInstr::MDFixupDefUseLists(void) { this->MDAddRegUse(STARS_x86_R_bx, false); if (!UseFP) this->MDAddRegUse(MD_FRAME_POINTER_REG, false); - if (global_STARS_program->GetSTARS_ISA_Bitwidth() == 32) { // already caller-saved in x86-64 + size_t BitWidth = global_STARS_program->GetSTARS_ISA_Bitwidth(); + if (BitWidth == 32) { // already caller-saved in x86-64 this->MDAddRegUse(STARS_x86_R_si, false); this->MDAddRegUse(STARS_x86_R_di, false); } + else if (BitWidth == 64) { + // Add callee-saved regs R12 through R15. We can optimize these away with later analysis, + // after we have GlobalNames and LocalNames defined. + this->MDAddRegUse(STARS_x86_R_r12, false); + this->MDAddRegUse(STARS_x86_R_r13, false); + this->MDAddRegUse(STARS_x86_R_r14, false); + this->MDAddRegUse(STARS_x86_R_r15, false); + } } // Next, add the flags register to the DEFs and USEs for those instructions that