Do not assume that __float128 exists

The code in build_round_expr implicitly assumes that __float128 exists,
which is *not* the common case among 64-bit architectures since the
"long double" type is generally already 128-bit for them.

gcc/fortran/
	PR fortran/96983
	* trans-intrinsic.c (build_round_expr): Do not implicitly assume
	that __float128 is the 128-bit floating-point type.
This commit is contained in:
Eric Botcazou 2021-03-10 12:05:53 +01:00
parent 1c3c12b0a6
commit 47403a0eef
1 changed files with 1 additions and 1 deletions

View File

@ -407,7 +407,7 @@ build_round_expr (tree arg, tree restype)
if (kind < 0)
gfc_internal_error ("Could not find real kind with at least %d bits",
resprec);
arg = fold_convert (gfc_float128_type_node, arg);
arg = fold_convert (gfc_get_real_type (kind), arg);
fn = gfc_builtin_decl_for_float_kind (BUILT_IN_ROUND, kind);
}
else