https://gcc.gnu.org/g:4e363d1b229aed839c834a87a81276a1336837aa
commit 4e363d1b229aed839c834a87a81276a1336837aa Author: Mikael Morin <[email protected]> Date: Tue Sep 9 19:06:59 2025 +0200 Correction cshift1a.m4 Diff: --- libgfortran/m4/cshift1.m4 | 2 +- libgfortran/m4/cshift1a.m4 | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libgfortran/m4/cshift1.m4 b/libgfortran/m4/cshift1.m4 index ef629454e820..bbb521c3a240 100644 --- a/libgfortran/m4/cshift1.m4 +++ b/libgfortran/m4/cshift1.m4 @@ -239,7 +239,7 @@ cshift1 (gfc_array_char * const restrict ret, if (rstride[0] == 0) rstride[0] = size; if (hstride[0] == 0) - hstride[0] = GFC_DESCRIPTOR_SIZE(h); + hstride[0] = sizeof ('atype_name`); dim = GFC_DESCRIPTOR_RANK (array); rstride0 = rstride[0]; diff --git a/libgfortran/m4/cshift1a.m4 b/libgfortran/m4/cshift1a.m4 index 336051bde4d2..1b5f983a2404 100644 --- a/libgfortran/m4/cshift1a.m4 +++ b/libgfortran/m4/cshift1a.m4 @@ -86,10 +86,10 @@ cshift1'rtype_qual`_'atype_code` ('atype` * const restrict ret, { roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim); if (roffset == 0) - roffset = 1; + roffset = sizeof ('atype_name`); soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim); if (soffset == 0) - soffset = 1; + soffset = sizeof ('atype_name`); len = GFC_DESCRIPTOR_EXTENT(array,dim); } else @@ -106,11 +106,11 @@ cshift1'rtype_qual`_'atype_code` ('atype` * const restrict ret, } } if (sstride[0] == 0) - sstride[0] = GFC_DESCRIPTOR_SIZE(array); + sstride[0] = sizeof ('atype_name`); if (rstride[0] == 0) - rstride[0] = GFC_DESCRIPTOR_SIZE(ret); + rstride[0] = sizeof ('atype_name`); if (hstride[0] == 0) - hstride[0] = GFC_DESCRIPTOR_SIZE(h); + hstride[0] = sizeof ('rtype_name`); dim = GFC_DESCRIPTOR_RANK (array); rstride0 = rstride[0]; @@ -134,9 +134,9 @@ cshift1'rtype_qual`_'atype_code` ('atype` * const restrict ret, if (sh < 0) sh += len; } - src = &sptr[sh * soffset]; + src = (const 'atype_name` *) (((char*)sptr) + sh * soffset); dest = rptr; - if (soffset == 1 && roffset == 1) + if (soffset == sizeof ('atype_name`) && roffset == sizeof ('atype_name`)) { size_t len1 = sh * sizeof ('atype_name`); size_t len2 = (len - sh) * sizeof ('atype_name`);
