Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an apparent x86 miscompilation on MSVC 19.38 (#16742)
There's an apparent miscompilation of `dynamic_bitset` on x86 with MSVC 19.38, where the following code: ```cpp dynamic_bitset<uint64_t> bits(80 * 24, 0); bits.set(0, 3 * 80, true); ``` is expected to set the first 3.75 blocks to 1 which should produce the following blocks: ``` 0xffffffffffffffff 0xffffffffffffffff 0xffffffffffffffff 0x0000ffffffffffff ``` but it actually produces: ``` 0xffffffffffffffff 0x00000000ffffffff 0xffffffffffffffff 0x0000ffffffffffff ``` The weird thing here is that this only happens if `til::bitmap` uses a `dynamic_bitset<uint64_t>`. As soon as it uses `<uint32_t>` any other instantiation of `<uint64_t>` is magically fixed. Conclusion: Use `size_t` until we know what's going on. Last known good CL version: 14.37.32822 Current broken CL version: 14.38.33130 ## Validation Steps Performed The following test completes successfully again: ```cpp til::bitmap map{ { 80, 24 } }; map.translate({ 0, 3 }, true); VERIFY_ARE_EQUAL(3u, map.runs().size()); ``` (cherry picked from commit d3ec47a) Service-Card-Id: 91885584 Service-Version: 1.20
- Loading branch information