diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index a73207e5465..23fd621e518 100644 --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -274,6 +274,10 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [ AC_CACHE_CHECK([whether we have a usable _Float128 type], libgfor_cv_have_float128, [ GCC_TRY_COMPILE_OR_LINK([ + #ifdef __loongarch__ + #error On LoongArch we should use long double instead; __float128 is only for porting existing code easier. + #endif + _Float128 foo (_Float128 x) { _Complex _Float128 z1, z2; diff --git a/libgfortran/configure b/libgfortran/configure index 11a1bc5f070..9898a94a372 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -30283,6 +30283,10 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #ifdef __loongarch__ + #error On LoongArch we should use long double instead; __float128 is only for porting existing code easier. + #endif + _Float128 foo (_Float128 x) { _Complex _Float128 z1, z2; @@ -30336,6 +30340,10 @@ fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #ifdef __loongarch__ + #error On LoongArch we should use long double instead; __float128 is only for porting existing code easier. + #endif + _Float128 foo (_Float128 x) { _Complex _Float128 z1, z2; diff --git a/libquadmath/configure b/libquadmath/configure index 49d70809218..f82dd3d0d6d 100755 --- a/libquadmath/configure +++ b/libquadmath/configure @@ -12843,6 +12843,10 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #ifdef __loongarch__ + #error On LoongArch we should use long double instead; __float128 is only for porting existing code easier. + #endif + #if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__) typedef _Complex float __attribute__((mode(TC))) __complex128; #else @@ -12894,6 +12898,10 @@ fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #ifdef __loongarch__ + #error On LoongArch we should use long double instead; __float128 is only for porting existing code easier. + #endif + #if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__) typedef _Complex float __attribute__((mode(TC))) __complex128; #else diff --git a/libquadmath/configure.ac b/libquadmath/configure.ac index 349be2607c6..c64a8489219 100644 --- a/libquadmath/configure.ac +++ b/libquadmath/configure.ac @@ -233,6 +233,10 @@ AM_CONDITIONAL(LIBQUAD_USE_SYMVER_SUN, [test "x$quadmath_use_symver" = xsun]) AC_CACHE_CHECK([whether __float128 is supported], [libquad_cv_have_float128], [GCC_TRY_COMPILE_OR_LINK([ + #ifdef __loongarch__ + #error On LoongArch we should use long double instead; __float128 is only for porting existing code easier. + #endif + #if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__) typedef _Complex float __attribute__((mode(TC))) __complex128; #else