Issue 133143
Summary Clang 19.1.7 crash during lambda compilation with naked attribute
Labels clang
Assignees
Reporter alpluspluss
    Version: 19.1.7
Host OS: macOS Sonoma 14.4
Flags: -ffreestanding -mcmodel=kernel
Target: x86_64-none-elf

Code:
```cpp
/* syscall entry point */
static auto syscall_entry = []() __attribute__((naked))
{
    asm volatile(
        "swapgs\n"
        "movq %rsp, %gs:16\n"
 "movq %gs:8, %rsp\n"
        "ret"
    );
};
```

I happened to run into a crash when compiling kernel code using a lambda with `__attribute__((naked))`.
This code doesn't crash during compilation with `x86_64-elf-g++`. I may be able to contribute a fix for this issue if needed.

Link to the attached file as I am not able to attach it normally: https://pastebin.com/GzeB8ga7

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to