-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix warning from an unsigned/signed comparison #9413
Conversation
src/jit/codegenxarch.cpp
Outdated
@@ -7578,7 +7578,7 @@ void CodeGen::genPutArgStkFieldList(GenTreePutArgStk* putArgStk) | |||
simdTmpReg = genRegNumFromMask(rsvdRegs & RBM_ALLFLOAT); | |||
assert(genIsValidFloatReg(simdTmpReg)); | |||
} | |||
assert(genCountBits(rsvdRegs) == ((intTmpReg == REG_NA) ? 0 : 1) + ((simdTmpReg == REG_NA) ? 0 : 1)); | |||
assert(genCountBits(rsvdRegs) == ((unsigned)(intTmpReg == REG_NA) ? 0 : 1) + ((simdTmpReg == REG_NA) ? 0 : 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming I understand what the warning is, it seems cleaner to simply cast the entire RHS to unsigned rather than relying on the subexpression's type trickling out through usual arithmetic conversions.
This fixes a desktop build break.
cbeb21d
to
6d99c9a
Compare
LGTM |
@dotnet-bot test OSX Checked Pri1 |
@dotnet-bot test Ubuntu x64 Checked Build and Test please |
@dotnet-bot test OSX x64 Checked Build and Test please |
@dotnet-bot test Windows_NT arm64 Debug please |
@dotnet-bot test Windows_NT Arm64 debug |
@dotnet-bot test OSX x64 Checked Build and Test please |
@dotnet-bot test Windows_NT arm64 Cross Checked Build and Test please |
@dotnet-bot test Windows_NT arm64 Cross Debug Build please |
@dotnet-bot help |
@dotnet-bot test Windows_NT arm64 Checked |
…d_warning Fix warning from an unsigned/signed comparison Commit migrated from dotnet/coreclr@28d0437
This fixes a desktop build break introduced with #8644.
@BruceForstall ptal
/cc @dotnet/jit-contrib