Issue 240354
Summary [clang][X86] clang-cl crashes (0xC0000005) on numeric label reference in AT&T syntax .s file
Labels clang
Assignees
Reporter CytexLab
    clang-cl.exe (version 23.1.5) crashes with Exception Code: 0xC0000005 when assembling an AT&T-syntax .s file that contains a jump to a numeric label without the f/b suffix.

```asm
.text
.globl __mem_simd_memcpy_ltr_avx

__mem_simd_memcpy_ltr_avx:
1:
  pushq %rbx
 cmpq $0, %rcx
  je 2          # <-- trigger: missing f/b suffix
2:
  popq %rbx
  ret
```
Command


`"C:\Program Files\LLVM\bin\clang-cl.exe" /nologo --target=x86_64-pc-windows-msvc /W0 -c -- test.s -o test.obj`

Actual result
Compiler crash with Exception Code: 0xC0000005, and output:
`clang-cl: error: clang integrated assembler command failed due to signal`

Expected result
A normal assembler error (e.g. "unknown token" or a hint to use 2f) instead of a crash.

Environment

- clang version: 23.1.5
- Target: x86_64-pc-windows-msvc
- InstalledDir: C:\Program Files\LLVM\bin
- OS: Windows

Additional notes
    The issue also reproduced on Clang 18.1.8, so it is not a regression from a recent version.
    Adding the f suffix (je 2f) or replacing numeric labels with named labels (e.g. .L2) avoids the crash.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to