public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-7595] Do not assume that __float128 exists
@ 2021-03-10 11:32 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2021-03-10 11:32 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:47403a0eefac52636db768dc46c3c88a2cd4b28e

commit r11-7595-g47403a0eefac52636db768dc46c3c88a2cd4b28e
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Wed Mar 10 12:05:53 2021 +0100

    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.

Diff:
---
 gcc/fortran/trans-intrinsic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 5c9258c65c3..9cf3642f694 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-10 11:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 11:32 [gcc r11-7595] Do not assume that __float128 exists Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).