https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96983

--- Comment #13 from anlauf at gcc dot gnu.org ---
(In reply to r...@cebitec.uni-bielefeld.de from comment #12)
> Here's how the types align:
> 
>                       kind    mode_precision  c_long_double   c_float128
> x86 long double         10      80              1               0
> x86 __float128          16      128             0               1
> sparc long double       16      128             1               0

This may lead to a total mess, and I am unable to test it, but can you try:

diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 26fdb2803a7..4d5de9066af 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -844,7 +844,14 @@ gfc_build_real_type (gfc_real_info *info)
   if (mode_precision == DOUBLE_TYPE_SIZE)
     info->c_double = 1;
   if (mode_precision == LONG_DOUBLE_TYPE_SIZE)
-    info->c_long_double = 1;
+    {
+      info->c_long_double = 1;
+      if (mode_precision == 128)
+       {
+         info->c_float128 = 1;
+         gfc_real16_is_float128 = true;
+       }
+    }
   if (mode_precision != LONG_DOUBLE_TYPE_SIZE && mode_precision == 128)
     {
       info->c_float128 = 1;

It's likely to screw up power completely, but I don't have any feedback from
them.

Reply via email to