[llvm-bugs] [Bug 47559] New: __FLOAT128__ macro incorrectly defined for CUDA target

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 17 01:52:29 PDT 2020


            Bug ID: 47559
           Summary: __FLOAT128__ macro incorrectly defined for CUDA target
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: CUDA
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bugs-llvm at fabian-knorr.info
                CC: llvm-bugs at lists.llvm.org

The CUDA target does not support __float128, but Clang defines __FLOAT128__
regardless. This breaks feature detection in libstdc++, causing this trivial
invocation to fail:

> /usr/bin/clang++ -x cuda --cuda-gpu-arch=sm_75 -c -std=gnu++17 /dev/null

> In file included from <built-in>:1:
> In file included from /usr/lib/clang/10.0.1/include/__clang_cuda_runtime_wrapper.h:36:
> In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/cmath:47:
> /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/std_abs.h:103:7: error: __float128 is not supported on this target
>   abs(__float128 __x)

It appears that there is a check missing in
clang/lib/Basic/Targets/OSTargets.h, which should not set HasFloat128 when
compiling for CUDA.

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/20200917/d4dd6a20/attachment-0001.html>

More information about the llvm-bugs mailing list