aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.cc
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gcc.gnu.org>2025-04-01 12:17:43 +0200
committerAndre Vehreschild <vehre@gcc.gnu.org>2025-04-22 13:17:51 +0200
commit9ebd7c3b978dba986c44cbc61f94cd97f381cc62 (patch)
tree353176a5811c5b91af950cb6e4b0ff0b5e081e84 /gcc/fortran/trans-expr.cc
parent621fe931be1e0220854e4d3c49cf2ce05cf735f7 (diff)
downloadgcc-9ebd7c3b978dba986c44cbc61f94cd97f381cc62.zip
gcc-9ebd7c3b978dba986c44cbc61f94cd97f381cc62.tar.gz
gcc-9ebd7c3b978dba986c44cbc61f94cd97f381cc62.tar.bz2
Fortran: Add team-support to this_image [PR87326]
This_image() no longer has a distance formal argument, but a team one. The source of the distance argument could not be identified, i.e. whether it came from a TS or standard draft. To implement only the standard it is removed. Besides being defined, it was not used anyway. PR fortran/87326 gcc/fortran/ChangeLog: * check.cc (gfc_check_this_image): Check the three different parameter lists possible for this_image and sort them correctly. * gfortran.texi: Update documentation on this_image's API. * intrinsic.cc (add_functions): Update this_image's signature. (check_specific): Add specific check for this_image. * intrinsic.h (gfc_check_this_image): Change to flexible argument list. * intrinsic.texi: Update documentation on this_image(). * iresolve.cc (gfc_resolve_this_image): Resolve the different arguments. * simplify.cc (gfc_simplify_this_image): Simplify the simplify routine. * trans-decl.cc (gfc_build_builtin_function_decls): Update signature of this_image. * trans-expr.cc (gfc_caf_get_image_index): Use correct signature of this_image. * trans-intrinsic.cc (trans_this_image): Adapt to correct signature. libgfortran/ChangeLog: * caf/libcaf.h (_gfortran_caf_this_image): Correct prototype. * caf/single.c (struct caf_single_team): Add new_index of image. (_gfortran_caf_this_image): Return the image index in the given team. (_gfortran_caf_form_team): Set new_index in team structure. gcc/testsuite/ChangeLog: * gfortran.dg/coarray_10.f90: Update error messages. * gfortran.dg/coarray_lib_this_image_1.f90: Same. * gfortran.dg/coarray_lib_this_image_2.f90: Same. * gfortran.dg/coarray_this_image_1.f90: Add more tests and remove incorrect ones. * gfortran.dg/coarray_this_image_2.f90: Test more features. * gfortran.dg/coarray_this_image_3.f90: New test.
Diffstat (limited to 'gcc/fortran/trans-expr.cc')
-rw-r--r--gcc/fortran/trans-expr.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index 276f325..19e5669b 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -2579,10 +2579,8 @@ gfc_caf_get_image_index (stmtblock_t *block, gfc_expr *e, tree desc)
gcc_assert (ref != NULL);
if (ref->u.ar.dimen_type[ref->u.ar.dimen] == DIMEN_THIS_IMAGE)
- {
- return build_call_expr_loc (input_location, gfor_fndecl_caf_this_image, 1,
- integer_zero_node);
- }
+ return build_call_expr_loc (input_location, gfor_fndecl_caf_this_image, 1,
+ null_pointer_node);
img_idx = build_zero_cst (gfc_array_index_type);
extent = build_one_cst (gfc_array_index_type);