diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp index 60f306307b90c..f15820a7dc574 100644 --- a/src/coreclr/jit/compiler.cpp +++ b/src/coreclr/jit/compiler.cpp @@ -2193,7 +2193,7 @@ const char* Compiler::compRegVarName(regNumber reg, bool displayVar, bool isFloa // consecutive calls before printing static int index = 0; // for circular index into the name array - index = (index + 1) % 2; // circular reuse of index + index ^= 1; // circular reuse of index sprintf_s(nameVarReg[index], NAME_VAR_REG_BUFFER_LEN, "%s'%s'", getRegName(reg), VarNameToStr(varName)); return nameVarReg[index]; diff --git a/src/coreclr/jit/emitxarch.cpp b/src/coreclr/jit/emitxarch.cpp index 35cb3a986ee58..6fe7f00dddc35 100644 --- a/src/coreclr/jit/emitxarch.cpp +++ b/src/coreclr/jit/emitxarch.cpp @@ -10102,7 +10102,7 @@ const char* emitter::emitRegName(regNumber reg, emitAttr attr, bool varName) con suffix = 'd'; goto APPEND_SUFFIX; } - rbc = (rbc + 1) % 2; + rbc ^= 1; rb[rbc][0] = 'e'; rb[rbc][1] = rn[1]; rb[rbc][2] = rn[2]; @@ -10133,7 +10133,7 @@ const char* emitter::emitRegName(regNumber reg, emitAttr attr, bool varName) con { suffix = 'b'; APPEND_SUFFIX: - rbc = (rbc + 1) % 2; + rbc ^= 1; rb[rbc][0] = rn[0]; rb[rbc][1] = rn[1]; if (rn[2]) @@ -10151,7 +10151,7 @@ const char* emitter::emitRegName(regNumber reg, emitAttr attr, bool varName) con } else { - rbc = (rbc + 1) % 2; + rbc ^= 1; rb[rbc][0] = rn[1]; if (reg < 4) { @@ -10168,7 +10168,7 @@ const char* emitter::emitRegName(regNumber reg, emitAttr attr, bool varName) con #endif // TARGET_AMD64 #if defined(TARGET_X86) - rbc = (rbc + 1) % 2; + rbc ^= 1; rb[rbc][0] = rn[1]; rb[rbc][1] = 'l'; strcpy_s(&rb[rbc][2], sizeof(rb[0]) - 2, rn + 3); diff --git a/src/coreclr/vm/gc_unwind_x86.inl b/src/coreclr/vm/gc_unwind_x86.inl index 017f8f8f803a9..33604336d28c5 100644 --- a/src/coreclr/vm/gc_unwind_x86.inl +++ b/src/coreclr/vm/gc_unwind_x86.inl @@ -1670,10 +1670,7 @@ unsigned scanArgRegTableI(PTR_CBYTE table, { thisPtrReg = REGI_NA; } - if (iptrRegs & regMask) - { - iptrRegs &= ~regMask; - } + iptrRegs &= ~regMask; } iptr = isThis = false; continue;