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

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 17 00:27:18 PST 2021


pengfei added a comment.

> Disabled double or float return for x86 targets

Sorry, I think we still need to match GCC's behavior. I.e., we shouldn't diagnosticate any FP type (float, double, long double) on 32-bits. https://godbolt.org/z/KrbhfWc9o
We have users who require of that. Noticed this problem during D112143 <https://reviews.llvm.org/D112143>.
Could you have a look again?



================
Comment at: clang/test/Sema/x86-no-x87.cpp:1
+// RUN: %clang_cc1 -fsyntax-only -verify %s -triple i686-linux-gnu -target-feature -x87 -DRET_ERROR
+// RUN: %clang_cc1 -fsyntax-only -verify %s -triple i686-linux-gnu -DNOERROR
----------------
This seems not used?


================
Comment at: clang/test/Sema/x86-no-x87.cpp:22-24
+// expected-error at +4{{'def' requires  'long_double' (aka 'long double') type support, but target 'i686-unknown-linux-gnu' does not support it}}
+// expected-note at +3{{'def' defined here}}
+// expected-note at +2{{'x' defined here}}
----------------
I'd think we can't emit error diagnostics on 32-bits now. We have users who rely on such behavior.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98895/new/

https://reviews.llvm.org/D98895



More information about the cfe-commits mailing list