Skip to content

Conversation

@mstorsjo
Copy link
Member

@mstorsjo mstorsjo commented Nov 27, 2025

Clarify the comment from 924defa. There is no longer any ambiguity about this case; newer versions of Windows correctly match the documentation, making it clear that the older versions were incorrect. Mention specific versions that have and don't have the inconsistency.

Even if we wouldn't care about the older versions of Windows, we can't enable this case of unwind info packing, unless the implementation also is changed to match for asymmetrical prologs/epilogs.

@llvmbot llvmbot added the llvm:mc Machine (object) code label Nov 27, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 27, 2025

@llvm/pr-subscribers-llvm-mc

Author: Martin Storsjö (mstorsjo)

Changes

Clarify that the issue that is being worked around by 924defa (discussed in #54879) is fixed in the latest versions, and reference versions that still have the bug present.

As long as we can't be sure the generated code won't run on older versions, the workaround still stands though (and it is unlikely that we'd ever really hit this case in practice - so there's not much gain to be had by removing the workaround).


Full diff: https://github.com/llvm/llvm-project/pull/169784.diff

1 Files Affected:

  • (modified) llvm/lib/MC/MCWin64EH.cpp (+2)
diff --git a/llvm/lib/MC/MCWin64EH.cpp b/llvm/lib/MC/MCWin64EH.cpp
index 6d146f6cedd6e..ca457c0db8b8e 100644
--- a/llvm/lib/MC/MCWin64EH.cpp
+++ b/llvm/lib/MC/MCWin64EH.cpp
@@ -1260,6 +1260,8 @@ static bool tryARM64PackedUnwind(WinEH::FrameInfo *info, uint32_t FuncLength,
   // RtlVirtualUnwind behaves as if it does expect the epilogue to contain
   // the same nops. See https://github.com/llvm/llvm-project/issues/54879.
   // To play it safe, don't produce packed unwind info with homed parameters.
+  // This seems to be fixed in 10.0.26100.6899, but was still broken at least
+  // in 10.0.22000.2176.
   if (H)
     return false;
   int IntSZ = 8 * RegI;

@mstorsjo mstorsjo force-pushed the arm64-unwind-workaround-version branch from 50aa5ae to 725194a Compare November 28, 2025 11:09
@mstorsjo mstorsjo changed the title [MC] [Win64EH] Clarify the Windows versions with bugs that are avoided [MC] [Win64EH] Clarify the comment about a skipped case of packed unwind info Nov 28, 2025
Copy link
Collaborator

@efriedma-quic efriedma-quic left a comment

Choose a reason for hiding this comment

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

LGTM

…ind info

Clarify the comment from 924defa.
There is no longer any ambiguity about this case; newer versions
of Windows correctly match the documentation, making it clear that
the older versions were incorrect. Mention specific versions that have
and don't have the inconsistency.

Even if we wouldn't care about the older versions of Windows, we can't
enable this case of unwind info packing, unless the implementation
also is changed to match for asymmetrical prologs/epilogs.
@mstorsjo mstorsjo force-pushed the arm64-unwind-workaround-version branch from 725194a to f0f1b5b Compare December 2, 2025 10:10
@mstorsjo mstorsjo merged commit 535f604 into llvm:main Dec 2, 2025
7 of 10 checks passed
@mstorsjo mstorsjo deleted the arm64-unwind-workaround-version branch December 2, 2025 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:mc Machine (object) code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants