diff --git a/SMPInstr.cpp b/SMPInstr.cpp index 4cf4a8c5ca7f84e8ca5ea717299ff789c8c5b39d..fec0ace08a95372042425d0599e4c0eaf6e8373f 100644 --- a/SMPInstr.cpp +++ b/SMPInstr.cpp @@ -35,6 +35,7 @@ #define SMP_VERBOSE_DEBUG_INFER_TYPES 0 #define SMP_VERBOSE_DUMP 0 +#define SMP_CALL_TRASHES_REGS 1 // Add DEFs of caller-saved regs to CALL instructions #define SMP_BASEREG_POINTER_TYPE 0 // Initialize Base Register USEs to type POINTER? // Make the CF_CHG1 .. CF_CHG6 and CF_USE1..CF_USE6 macros more usable @@ -942,6 +943,14 @@ void SMPInstr::MDFixupDefUseLists(void) { } } } +#if SMP_CALL_TRASHES_REGS + else if ((this->type == CALL) || (this->type == INDIR_CALL)) { + // We want to add the caller-saved registers to the DEFs list + this->MDAddRegDef(R_ax, false); + this->MDAddRegDef(R_cx, false); + this->MDAddRegDef(R_dx, false); + } +#endif else if (this->MDIsEnterInstr() || this->MDIsLeaveInstr()) { // Entire function prologue or epilogue microcoded. this->MDAddRegDef(R_sp, false);