Skip to content

Windows aarch64 (w/ inline asm .align): Failed to evaluate function length in SEH unwind info #122707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hmartinez82 opened this issue Jan 13, 2025 · 4 comments
Labels
backend:AArch64 duplicate Resolved as duplicate mc Machine (object) code platform:windows

Comments

@hmartinez82
Copy link

hmartinez82 commented Jan 13, 2025

When adding an .align pseudo op to inline assembly (built with clang -c -v):

int f(int i) {
    int result;
    __asm__ (
        ".align 5 \n"
        "add %w0, %w1, #41"
        : "=r" (result)
        : "r" (i)
        :
    );
    return result;
}

Clang crashes with:

clang version 19.1.6
Target: aarch64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/msys64/clangarm64/bin
 (in-process)
 "C:/msys64/clangarm64/bin/clang.exe" -cc1 -triple aarch64-w64-windows-gnu -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name align.c -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -mms-bitfields -funwind-tables=2 -fno-sized-deallocation -fno-use-init-array -target-cpu generic -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon -target-abi aapcs -debugger-tuning=gdb -fdebug-compilation-dir=C:/Temp -v -fcoverage-compilation-dir=C:/Temp -resource-dir C:/msys64/clangarm64/lib/clang/19 -internal-isystem C:/msys64/clangarm64/lib/clang/19/include -internal-isystem C:/msys64/clangarm64/aarch64-w64-mingw32/include -internal-isystem C:/msys64/clangarm64/aarch64-w64-mingw32/usr/include -internal-isystem C:/msys64/clangarm64/include -ferror-limit 19 -fmessage-length=128 -fno-use-cxa-atexit -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -exception-model=seh -fcolor-diagnostics -faddrsig -o align.o -x c align.c
clang -cc1 version 19.1.6 based upon LLVM 19.1.6 default target aarch64-w64-windows-gnu
ignoring nonexistent directory "C:/msys64/clangarm64/aarch64-w64-mingw32/include"
ignoring nonexistent directory "C:/msys64/clangarm64/aarch64-w64-mingw32/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 C:/msys64/clangarm64/lib/clang/19/include
 C:/msys64/clangarm64/include
End of search list.
fatal error: error in backend: Failed to evaluate function length in SEH unwind info
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: C:\\msys64\\clangarm64\\bin\\clang.exe -c -v align.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'align.c'.
4.      Running pass 'AArch64 Assembly Printer' on function '@f'
Exception Code: 0xE0000046
#0 0x00007ff94adb6248 (C:\Windows\System32\KERNELBASE.dll+0xb6248)
#1 0x8364fff8508ed7d8
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 19.1.6
Target: aarch64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/msys64/clangarm64/bin
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: C:/msys64/tmp/align-fd02f8.c
clang: note: diagnostic msg: C:/msys64/tmp/align-fd02f8.sh
clang: note: diagnostic msg:

********************
@hmartinez82 hmartinez82 marked this as a duplicate of #69454 Jan 13, 2025
@hmartinez82
Copy link
Author

align-f6071.zip

@mstorsjo
Copy link
Member

CC @efriedma-quic on this one.

@llvmbot
Copy link
Member

llvmbot commented Jan 13, 2025

@llvm/issue-subscribers-backend-aarch64

Author: Hernan Martinez (hmartinez82)

When adding an `.align` pseudo op to inline assembly (built with `clang -c -v`): ```c int f(int i) { int result; __asm__ ( ".align 5 \n" "add %w0, %w1, #41" : "=r" (result) : "r" (i) : ); return result; } ``` Clang crashes with: ``` clang version 19.1.6 Target: aarch64-w64-windows-gnu Thread model: posix InstalledDir: C:/msys64/clangarm64/bin (in-process) "C:/msys64/clangarm64/bin/clang.exe" -cc1 -triple aarch64-w64-windows-gnu -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name align.c -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -mms-bitfields -funwind-tables=2 -fno-sized-deallocation -fno-use-init-array -target-cpu generic -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon -target-abi aapcs -debugger-tuning=gdb -fdebug-compilation-dir=C:/Temp -v -fcoverage-compilation-dir=C:/Temp -resource-dir C:/msys64/clangarm64/lib/clang/19 -internal-isystem C:/msys64/clangarm64/lib/clang/19/include -internal-isystem C:/msys64/clangarm64/aarch64-w64-mingw32/include -internal-isystem C:/msys64/clangarm64/aarch64-w64-mingw32/usr/include -internal-isystem C:/msys64/clangarm64/include -ferror-limit 19 -fmessage-length=128 -fno-use-cxa-atexit -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -exception-model=seh -fcolor-diagnostics -faddrsig -o align.o -x c align.c clang -cc1 version 19.1.6 based upon LLVM 19.1.6 default target aarch64-w64-windows-gnu ignoring nonexistent directory "C:/msys64/clangarm64/aarch64-w64-mingw32/include" ignoring nonexistent directory "C:/msys64/clangarm64/aarch64-w64-mingw32/usr/include" #include "..." search starts here: #include <...> search starts here: C:/msys64/clangarm64/lib/clang/19/include C:/msys64/clangarm64/include End of search list. fatal error: error in backend: Failed to evaluate function length in SEH unwind info PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: 0. Program arguments: C:\\msys64\\clangarm64\\bin\\clang.exe -c -v align.c 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module 'align.c'. 4. Running pass 'AArch64 Assembly Printer' on function '@f' Exception Code: 0xE0000046 #0 0x00007ff94adb6248 (C:\Windows\System32\KERNELBASE.dll+0xb6248) #1 0x8364fff8508ed7d8 clang: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 19.1.6 Target: aarch64-w64-windows-gnu Thread model: posix InstalledDir: C:/msys64/clangarm64/bin clang: note: diagnostic msg: ********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: C:/msys64/tmp/align-fd02f8.c
clang: note: diagnostic msg: C:/msys64/tmp/align-fd02f8.sh
clang: note: diagnostic msg:


</details>

@efriedma-quic
Copy link
Collaborator

Duplicate of #47432

@efriedma-quic efriedma-quic marked this as a duplicate of #47432 Jan 13, 2025
@EugeneZelenko EugeneZelenko added the duplicate Resolved as duplicate label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AArch64 duplicate Resolved as duplicate mc Machine (object) code platform:windows
Projects
None yet
Development

No branches or pull requests

5 participants