Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fix warning from an unsigned/signed comparison #9413

Merged
merged 1 commit into from
Feb 9, 2017

Conversation

jashook
Copy link

@jashook jashook commented Feb 8, 2017

This fixes a desktop build break introduced with #8644.

@BruceForstall ptal
/cc @dotnet/jit-contrib

@@ -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));

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.
@jashook jashook force-pushed the fix_internal_build_warning branch from cbeb21d to 6d99c9a Compare February 8, 2017 17:59
@briansull
Copy link

LGTM

@jashook
Copy link
Author

jashook commented Feb 9, 2017

@dotnet-bot test OSX Checked Pri1

@jashook
Copy link
Author

jashook commented Feb 9, 2017

@dotnet-bot test Ubuntu x64 Checked Build and Test please

@jashook
Copy link
Author

jashook commented Feb 9, 2017

@dotnet-bot test OSX x64 Checked Build and Test please

@jashook
Copy link
Author

jashook commented Feb 9, 2017

@dotnet-bot test Windows_NT arm64 Debug please

@jashook
Copy link
Author

jashook commented Feb 9, 2017

@dotnet-bot test Windows_NT Arm64 debug

@jashook
Copy link
Author

jashook commented Feb 9, 2017

@dotnet-bot test OSX x64 Checked Build and Test please
@dotnet-bot test Ubuntu x64 Checked Build and Test please

@RussKeldorph
Copy link

@dotnet-bot test Windows_NT arm64 Cross Checked Build and Test please

@RussKeldorph
Copy link

@dotnet-bot test Windows_NT arm64 Cross Debug Build please

@RussKeldorph
Copy link

@dotnet-bot help

@RussKeldorph
Copy link

@dotnet-bot test Windows_NT arm64 Checked

@jashook jashook merged commit 28d0437 into dotnet:master Feb 9, 2017
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…d_warning

Fix warning from an unsigned/signed comparison

Commit migrated from dotnet/coreclr@28d0437
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants