You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fatal error: error in backend: Failed to evaluate function length in SEH unwind info
Stack dump:
0. Program arguments: clang.exe --target=aarch64-pc-windows -c test.cpp
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'test.cpp'.
4. Running pass 'AArch64 Assembly Printer' on function '@"?test@@YAXXZ"'
LLVM may generate alignment directives without using inline assembly at all when loops are involved due to either an explicit command line option or cpu-specific defaults.
The following will, at the time of writing, crash on trunk with the same error as above:
// clang test.c --target=aarch64-pc-windows-gnu -falign-loops=2 -O1
// clang test.c --target=aarch64-pc-windows-gnu -mtune=cortex-a72 -O2
void opaque();
void test(int x) {
for (int i = 0; i < x; ++i) opaque();
}
Workaround is to explicitly remove loop alignment hints through the command line via -falign-loops=1 or -mllvm -align-loops=1.
Extended Description
For more info see FIXME in ARM64EmitUnwindInfo (llvm/lib/MC/MCWin64EH.cpp)
https://github.com/llvm/llvm-project/blob/f69e090/llvm/lib/MC/MCWin64EH.cpp#L918-L943
Reproducible example:
Compiling with:
Gives no error, however, compiling with
Crashes:
fatal error: error in backend: Failed to evaluate function length in SEH unwind info
Stack dump:
Related bug report: #40926
The text was updated successfully, but these errors were encountered: