Skip to content

[CUDA] Generates a call to libc abort in device code, which fails to link #143911

Open
@zwliew

Description

@zwliew

Reproducer:
https://godbolt.org/z/9qrdGE55d

When trying to call __builtin_abort() in __device__ or __global__ code, clang doesn't throw a compilation error, instead generating the call.uni abort instruction. ptxas then fails at link-time because abort does not exist.

By comparison, nvcc throws the error calling a __host__ function("__builtin_abort") from a __global__ function("f") is not allowed.

Perhaps clang should throw an error earlier too?

Metadata

Metadata

Assignees

No one assigned

    Labels

    libcquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions