On 12/13/21 8:55 AM, Bill Schmidt via Gcc-patches wrote:
Hi!

PR103623 shows that we ICE if __builtin_pack_longdouble or 
__builtin_unpack_longdouble
is used when long double is not defined to be the IBM-128 (double-double) 
format.
To solve this, I introduce a new built-in function attribute "ibmld" that 
enforces
this requirement.

Tested the fix on a powerpc-e300c3-linux-gnu cross.  Bootstrapped and tested on
powerpc64le-linux-gnu with no regressions.  Is this okay for trunk?

Just a minor note about the format of the new error message
below:

...
diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index d9736eaf21c..b6f0c6c4c08 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -15741,6 +15741,13 @@ rs6000_expand_new_builtin (tree exp, rtx target,
        return const0_rtx;
      }
+ if (bif_is_ibmld (*bifaddr) && !FLOAT128_2REG_P (TFmode))
+    {
+      error ("%<%s%> requires long double to be IBM 128-bit format",

as a keyword long double should be quoted in the message.

Martin

Reply via email to