[gcc(refs/users/mikael/heads/refactor_descriptor_v08)] Correction cshift0.m4
Mikael Morin
mikael@gcc.gnu.org
Sat Sep 13 19:10:23 GMT 2025
https://gcc.gnu.org/g:7e427d335629ee19bb97f0aa63c776123692cff4
commit 7e427d335629ee19bb97f0aa63c776123692cff4
Author: Mikael Morin <mikael@gcc.gnu.org>
Date: Sat Sep 13 20:37:07 2025 +0200
Correction cshift0.m4
Retour en arrière cshift0
Remodif cshift0.m4
Réapplication modifs cshift0
Correction cshift0.m4
Correction cshift0.m4
Correction cshift0.m4
Diff:
---
libgfortran/m4/cshift0.m4 | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/libgfortran/m4/cshift0.m4 b/libgfortran/m4/cshift0.m4
index 674407c69771..2725025182ba 100644
--- a/libgfortran/m4/cshift0.m4
+++ b/libgfortran/m4/cshift0.m4
@@ -48,7 +48,6 @@ cshift0_'rtype_code` ('rtype` *ret, const 'rtype` *array, ptrdiff_t shift,
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
- index_type contiguous_extent;
index_type dim;
index_type len;
index_type n;
@@ -75,7 +74,6 @@ cshift0_'rtype_code` ('rtype` *ret, const 'rtype` *array, ptrdiff_t shift,
{
/* Test if both ret and array are contiguous. */
do_blocked = true;
- contiguous_extent = 1;
dim = GFC_DESCRIPTOR_RANK (array);
for (n = 0; n < dim; n ++)
{
@@ -92,10 +90,8 @@ cshift0_'rtype_code` ('rtype` *ret, const 'rtype` *array, ptrdiff_t shift,
do_blocked = false;
break;
}
- index_type extent = GFC_DESCRIPTOR_EXTENT (array, n);
r_ex *= GFC_DESCRIPTOR_EXTENT (ret, n);
- a_ex *= extent;
- contiguous_extent = extent;
+ a_ex *= GFC_DESCRIPTOR_EXTENT (array, n);
}
}
else
@@ -120,8 +116,9 @@ cshift0_'rtype_code` ('rtype` *ret, const 'rtype` *array, ptrdiff_t shift,
rstride[0] = sizeof ('rtype_name`);
roffset = sizeof ('rtype_name`);
soffset = sizeof ('rtype_name`);
- len = contiguous_extent * GFC_DESCRIPTOR_EXTENT(array, which);
- shift *= contiguous_extent;
+ index_type count_low = GFC_DESCRIPTOR_STRIDE(array, which);
+ len = count_low * GFC_DESCRIPTOR_EXTENT(array, which);
+ shift *= count_low;
for (dim = which + 1; dim < GFC_DESCRIPTOR_RANK (array); dim++)
{
count[n] = 0;
More information about the Gcc-cvs
mailing list