aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2021-01-04 23:16:10 +0100
committerThomas Koenig <tkoenig@gcc.gnu.org>2021-01-05 13:04:44 +0100
commit5ec390b478ec20d11fab41065a4e90fb0ecd74fc (patch)
tree835a7666ede95dc46eeb9de1fa304ed0810b4a56 /libgfortran
parentafae4a55ccaa0de95ea11e5f634084db6ab2f444 (diff)
downloadgcc-5ec390b478ec20d11fab41065a4e90fb0ecd74fc.zip
gcc-5ec390b478ec20d11fab41065a4e90fb0ecd74fc.tar.gz
gcc-5ec390b478ec20d11fab41065a4e90fb0ecd74fc.tar.bz2
Fix CO_REDUCE with RESULT_IMAGE.
gcc/fortran/ChangeLog: * trans-array.c (gfc_conv_ss_descriptor): Use correct ref. * trans-intrinsic.c (trans_argument): Use gfc_conv_expr_reference. * trans-decl.c (gfc_build_builtin_function_decls): Correct spec for array. libgfortran/ChangeLog: * caf_shared/collective_subroutine.c (collsub_reduce_array): Fix off by one error for result. gcc/testsuite/ChangeLog: * gfortran.dg/caf-shared/co_reduce_1.f90: New test.
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/caf_shared/collective_subroutine.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgfortran/caf_shared/collective_subroutine.c b/libgfortran/caf_shared/collective_subroutine.c
index 875eb94..a39f0ae 100644
--- a/libgfortran/caf_shared/collective_subroutine.c
+++ b/libgfortran/caf_shared/collective_subroutine.c
@@ -121,7 +121,7 @@ collsub_reduce_array (collsub_iface *ci, gfc_array_char *desc,
for (; (local->total_num_images >> cbit) != 0; cbit++)
collsub_sync (ci);
- if (!result_image || *result_image == this_image.image_num)
+ if (!result_image || (*result_image - 1 ) == this_image.image_num)
{
if (packed)
memcpy (GFC_DESCRIPTOR_DATA (desc), buffer, this_image_size_bytes);