Skip to content

[Clang][AMDGPU] Clang crashes on __builtin_coro_noop when targeting AMDGPU #102095

@jhuber6

Description

@jhuber6

Any use of __builtin_coro_noop will cause the AMDGPU target to crash with an invalid constexpr crash. The NVPTX and other targets handle this just fine. https://godbolt.org/z/9E18bG3d6

void foo() {
    __builtin_coro_noop();
}
$ clang++ -std=v++23 --target=amdgcn-amd-amdhsa bug.cpp
clang++: /root/llvm-project/llvm/lib/IR/Constants.cpp:2191: static llvm::Constant* llvm::ConstantExpr::getCast(unsigned int, llvm::Constant*, llvm::Type*, bool): Assertion `CastInst::castIsValid(opc, C, Ty) && "Invalid constantexpr cast!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions