[gcc(refs/users/mikael/heads/refactor_descriptor_v08)] Correction in_pack.m4 et in_unpack.m4

Mikael Morin mikael@gcc.gnu.org
Tue Sep 9 14:24:55 GMT 2025


https://gcc.gnu.org/g:2fa241907ef02b9e25ea9adf078d51e42e30a29b

commit 2fa241907ef02b9e25ea9adf078d51e42e30a29b
Author: Mikael Morin <mikael@gcc.gnu.org>
Date:   Tue Sep 9 14:21:41 2025 +0200

    Correction in_pack.m4 et in_unpack.m4

Diff:
---
 libgfortran/m4/in_pack.m4   | 2 +-
 libgfortran/m4/in_unpack.m4 | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libgfortran/m4/in_pack.m4 b/libgfortran/m4/in_pack.m4
index 49dc7572a759..b6c7c3562f5f 100644
--- a/libgfortran/m4/in_pack.m4
+++ b/libgfortran/m4/in_pack.m4
@@ -52,7 +52,7 @@ internal_pack_'rtype_ccode` ('rtype` * source)
      since the stride=0 thing has been removed from the frontend.  */
 
   dim = GFC_DESCRIPTOR_RANK (source);
-  ssize = 1;
+  ssize = sizeof ('rtype_name`);
   packed = 1;
   for (index_type n = 0; n < dim; n++)
     {
diff --git a/libgfortran/m4/in_unpack.m4 b/libgfortran/m4/in_unpack.m4
index 843323cee6c3..ff1d86dbb582 100644
--- a/libgfortran/m4/in_unpack.m4
+++ b/libgfortran/m4/in_unpack.m4
@@ -48,7 +48,7 @@ internal_unpack_'rtype_ccode` ('rtype` * d, const 'rtype_name` * src)
     return;
 
   dim = GFC_DESCRIPTOR_RANK (d);
-  dsize = 1;
+  dsize = sizeof ('rtype_name`);
   for (index_type n = 0; n < dim; n++)
     {
       count[n] = 0;
@@ -65,7 +65,7 @@ internal_unpack_'rtype_ccode` ('rtype` * d, const 'rtype_name` * src)
 
   if (dsize != 0)
     {
-      memcpy (dest, src, dsize * sizeof ('rtype_name`));
+      memcpy (dest, src, dsize);
       return;
     }


More information about the Gcc-cvs mailing list