]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
vms: Replace use of LONG_DOUBLE_TYPE_SIZE
authorKewen Lin <linkw@linux.ibm.com>
Tue, 25 Jun 2024 05:04:51 +0000 (00:04 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Tue, 25 Jun 2024 05:04:51 +0000 (00:04 -0500)
Joseph pointed out "floating types should have their mode,
not a poorly defined precision value" in the discussion[1],
as he and Richi suggested, the existing macros
{FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a
hook mode_for_floating_type.  To be prepared for that, this
patch is to replace use of LONG_DOUBLE_TYPE_SIZE in vms port
with TYPE_PRECISION of long_double_type_node.

[1] https://gcc.gnu.org/pipermail/gcc-patches/2024-May/651209.html

gcc/ChangeLog:

* config/vms/vms.cc (vms_patch_builtins): Use TYPE_PRECISION of
long_double_type_node to replace LONG_DOUBLE_TYPE_SIZE.

gcc/config/vms/vms.cc

index d468c79e5590e833c0777e69843e25b337147a32..2fcc673c8a91e26983914aafaff4580ed7dd51f9 100644 (file)
@@ -141,6 +141,7 @@ vms_patch_builtins (void)
   if (builtin_decl_implicit_p (BUILT_IN_FWRITE_UNLOCKED))
     set_builtin_decl_implicit_p (BUILT_IN_FWRITE_UNLOCKED, false);
 
+  unsigned long_double_type_size = TYPE_PRECISION (long_double_type_node);
   /* Define aliases for names.  */
   for (i = 0; i < NBR_CRTL_NAMES; i++)
     {
@@ -179,7 +180,7 @@ vms_patch_builtins (void)
          vms_add_crtl_xlat (alt, nlen + 1, res, rlen);
 
          /* Long double version.  */
-         res[rlen - 1] = (LONG_DOUBLE_TYPE_SIZE == 128 ? 'X' : 'T');
+         res[rlen - 1] = (long_double_type_size == 128 ? 'X' : 'T');
          alt[nlen] = 'l';
          vms_add_crtl_xlat (alt, nlen + 1, res, rlen);
 
@@ -223,7 +224,7 @@ vms_patch_builtins (void)
       if (n->flags & VMS_CRTL_FLOAT64)
         res[rlen++] = 't';
 
-      if ((n->flags & VMS_CRTL_FLOAT128) && LONG_DOUBLE_TYPE_SIZE == 128)
+      if ((n->flags & VMS_CRTL_FLOAT128) && long_double_type_size == 128)
         res[rlen++] = 'x';
 
       memcpy (res + rlen, n->name, nlen);