[flang-commits] [flang] d9c8550 - [flang] Fixed build issues after f20ea05. (#84377)

via flang-commits flang-commits at lists.llvm.org
Thu Mar 7 19:52:32 PST 2024


Author: Slava Zakharin
Date: 2024-03-07T19:52:28-08:00
New Revision: d9c855014123a313006adfc873be6f10e997be61

URL: https://github.com/llvm/llvm-project/commit/d9c855014123a313006adfc873be6f10e997be61
DIFF: https://github.com/llvm/llvm-project/commit/d9c855014123a313006adfc873be6f10e997be61.diff

LOG: [flang] Fixed build issues after f20ea05. (#84377)

Older versions of clang do not have __builtin_complex, but they
may define `__GNUC__`.

Added: 
    

Modified: 
    flang/runtime/complex-reduction.c

Removed: 
    


################################################################################
diff  --git a/flang/runtime/complex-reduction.c b/flang/runtime/complex-reduction.c
index 72c31ce08b875a..c91d1253991176 100644
--- a/flang/runtime/complex-reduction.c
+++ b/flang/runtime/complex-reduction.c
@@ -82,7 +82,8 @@ static long_double_Complex_t CMPLXL(long double r, long double i) {
  * supports __builtin_complex. For Clang, require >=12.0.
  * Otherwise, rely on the memory layout compatibility.
  */
-#if (defined(__clang_major__) && (__clang_major__ >= 12)) || defined(__GNUC__)
+#if (defined(__clang_major__) && (__clang_major__ >= 12)) || \
+    (defined(__GNUC__) && !defined(__clang__))
 #define CMPLXF128 __builtin_complex
 #else
 static CFloat128ComplexType CMPLXF128(CFloat128Type r, CFloat128Type i) {


        


More information about the flang-commits mailing list