aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2021-09-17 08:20:51 -0700
committerSandra Loosemore <sandra@codesourcery.com>2021-09-17 08:20:51 -0700
commit00b1324f9285f49a6f9516f408f6be5bc6545219 (patch)
tree781ce4ee84126469035a921f890f347d3fb663b9 /libgfortran
parent2578a3870ef849dc77e98796600181b64ae4fd61 (diff)
downloadgcc-00b1324f9285f49a6f9516f408f6be5bc6545219.zip
gcc-00b1324f9285f49a6f9516f408f6be5bc6545219.tar.gz
gcc-00b1324f9285f49a6f9516f408f6be5bc6545219.tar.bz2
Fortran: Use _Float128 rather than __float128 for c_float128 kind.
The GNU Fortran manual documents that the c_float128 kind corresponds to __float128, but in fact the implementation uses float128_type_node, which is _Float128. Both refer to the 128-bit IEEE/ISO encoding, but some targets including aarch64 only define _Float128 and not __float128, and do not provide quadmath.h. This caused errors in some test cases referring to __float128. This patch changes the documentation (including code comments) and test cases to use _Float128 to match the implementation. 2021-09-16 Sandra Loosemore <sandra@codesourcery.com> gcc/fortran/ * intrinsic.texi (ISO_C_BINDING): Change C_FLOAT128 to correspond to _Float128 rather than __float128. * iso-c-binding.def (c_float128): Update comments. * trans-intrinsic.c (gfc_builtin_decl_for_float_kind): Likewise. (build_round_expr): Likewise. (gfc_build_intrinsic_lib_fndcecls): Likewise. * trans-types.h (gfc_real16_is_float128): Likewise. gcc/testsuite/ * gfortran.dg/PR100914.c: Do not include quadmath.h. Use _Float128 _Complex instead of __complex128. * gfortran.dg/PR100914.f90: Add -Wno-pedantic to suppress error about use of _Float128. * gfortran.dg/c-interop/typecodes-array-float128-c.c: Use _Float128 instead of __float128. * gfortran.dg/c-interop/typecodes-sanity-c.c: Likewise. * gfortran.dg/c-interop/typecodes-scalar-float128-c.c: Likewise. * lib/target-supports.exp (check_effective_target_fortran_real_c_float128): Update comments. libgfortran/ * ISO_Fortran_binding.h: Update comments. * runtime/ISO_Fortran_binding.c: Likewise.
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ISO_Fortran_binding.h4
-rw-r--r--libgfortran/runtime/ISO_Fortran_binding.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/libgfortran/ISO_Fortran_binding.h b/libgfortran/ISO_Fortran_binding.h
index 50b02d2..d431d09 100644
--- a/libgfortran/ISO_Fortran_binding.h
+++ b/libgfortran/ISO_Fortran_binding.h
@@ -281,7 +281,7 @@ extern int CFI_setpointer (CFI_cdesc_t *, CFI_cdesc_t *, const CFI_index_t []);
#define CFI_type_long_double (CFI_type_Real + (10 << CFI_type_kind_shift))
#define CFI_type_long_double_Complex (CFI_type_Complex + (10 << CFI_type_kind_shift))
-/* This is the IEEE 128-bit encoding, same as float128. */
+/* This is the IEEE 128-bit encoding, same as _Float128. */
#elif (__CFI_LDBL_MANT_DIG__ == 113 \
&& __CFI_LDBL_MIN_EXP__ == -16381 \
&& __CFI_LDBL_MAX_EXP__ == 16384)
@@ -303,7 +303,7 @@ extern int CFI_setpointer (CFI_cdesc_t *, CFI_cdesc_t *, const CFI_index_t []);
#error "Can't determine kind of long double"
#endif
-/* Similarly for __float128. This always refers to the IEEE encoding
+/* Similarly for _Float128. This always refers to the IEEE encoding
and not some other 128-bit representation, so if we already used
kind 16 for a non-IEEE representation, this one must be unsupported
in Fortran even if it's available in C. */
diff --git a/libgfortran/runtime/ISO_Fortran_binding.c b/libgfortran/runtime/ISO_Fortran_binding.c
index 0e1a419..e01cc65 100644
--- a/libgfortran/runtime/ISO_Fortran_binding.c
+++ b/libgfortran/runtime/ISO_Fortran_binding.c
@@ -222,7 +222,7 @@ gfc_desc_to_cfi_desc (CFI_cdesc_t **d_ptr, const gfc_array_void *s)
elem_len and not the kind, we get into trouble with long double kinds
that do not correspond directly to the elem_len, specifically the
kind 10 80-bit long double on x86 targets. On x86_64, this has size
- 16 and cannot be differentiated from true __float128. Prefer the
+ 16 and cannot be differentiated from true _Float128. Prefer the
standard long double type over the GNU extension in that case. */
if (d->type == CFI_type_Real && kind == sizeof (long double))
d->type = CFI_type_long_double;