[llvm-bugs] [Bug 51344] New: Can't compile C std= for nvptx64

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 4 11:05:52 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51344

            Bug ID: 51344
           Summary: Can't compile C std= for nvptx64
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jonathanchesterfield at gmail.com
                CC: llvm-bugs at lists.llvm.org

int main() {}

clang -std=c99 -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda

opt/compiler-explorer/clang-trunk-20210804/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:40:63:
error: use of undeclared identifier 'asm'
__DEVICE__ void __attribute__((overloadable)) __brkpt(void) { asm
volatile("brkpt;"); }

https://godbolt.org/z/9TMc9oPMW

That would be because 'asm' is a gnu extension and I passed std=c99.

Clang accepts __asm or __asm__ when the header is included in openmp. As far as
I can tell, cuda accepts all three.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210804/3b030f2b/attachment.html>


More information about the llvm-bugs mailing list