[PATCH] D98895: [X86][clang] Disable long double type for -mno-x87 option

Elizabeth Andrews via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 9 09:12:36 PST 2021

eandrews added a comment.

This patch causes a regression.

To reproduce - `clang -cc1 -fsycl-is-device -triple spir64 test.cpp`

  // expected-note at +2 {{'bar<__float128>' defined here}}
  template <typename T>
  T bar() { return T(); };
  void usage() {
    // expected-error at +2 {{'bar<__float128>' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
    // expected-error at +1 {{'__float128' is not supported on this target}}
    auto malAutoTemp5 = bar<__float128>();
  template <typename name, typename Func>
  __attribute__((sycl_kernel)) void kernel_single_task(const Func &kernelFunc) {
    kernelFunc(); // expected-note {{called by 'kernel_single_task<fake_kernel, (lambda at}}
  int main() {
    kernel_single_task<class fake_kernel>([=]() {
      usage(); // expected-note {{called by 'operator()'}}
    return 0;

This test now fails due to an additional diagnostic generated at template definition.

  test.cpp:x:3: error: 'bar<__float128>' requires 128 bit size '__float128' type support, but target 'spir64' does not support it
  T bar() { return T(); };

I looked at it briefly, and I believe the issue is call to `checkTypeSupport()` in `ActOnFinishFunctionBody()`. I tried deleting the call but it breaks tests (E.g. L26 in x86_64-no-x87.cpp). @asavonic Please take a look. I will be reverting the patch if this cannot be fixed soon.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list