Skip to content

Conversation

@akoeplinger
Copy link
Member

After the recent VS upgrade from 17.12.5 to 17.13.2 we started seeing access violations in the mono-aot-cross.exe when targetting wasm.

We tracked it down to sgen_clz being miscompiled, we can workaround the compiler bug by switching from ternary condition to if/else.

Thanks to @lateralusX for the great help :)

After the recent VS upgrade from 17.12.5 to 17.13.2 we started seeing access violations in the mono-aot-cross.exe when targetting wasm.

We tracked it down to sgen_clz being miscompiled, we can workaround the compiler bug by switching from ternary condition to if/else.
Copilot AI review requested due to automatic review settings April 17, 2025 15:55
@ghost ghost added the area-VM-meta-mono label Apr 17, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

{
gulong leading_zero_bits;
return _BitScanReverse (&leading_zero_bits, (gulong)x) ? 31 - leading_zero_bits : 32;
if (_BitScanReverse (&leading_zero_bits, (gulong)x))
Copy link

Copilot AI Apr 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an inline comment above this if/else block to explain that the change is a workaround for the MSVC miscompilation issue encountered in VS 17.13.2.

Copilot uses AI. Check for mistakes.
@akoeplinger
Copy link
Member Author

/ba-g CI is blocked due to other issues but this is a no-op change so merging to unblock the runtime -> sdk flow

@akoeplinger
Copy link
Member Author

/backport to release/9.0-staging

@akoeplinger
Copy link
Member Author

/backport to release/8.0-staging

@github-actions
Copy link
Contributor

Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/14593713790

@github-actions
Copy link
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/14593716274

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants