-
- Downloads
Fortran: Generic processing of assumed rank objects (f202y) [PR116733]
2024-10-23 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/116733 * array.cc : White space corrections. * expr.cc (gfc_check_pointer_assign): Permit assumed rank target with -std=f202y. Add constraints that the data pointer object must have rank remapping specified and the that the data target be contiguous. * gfortran.h : Add a gfc_array_ref field 'ar' to the structure 'gfc_association_list'. * interface.cc (gfc_compare_actual_formal): If -Wsurprising is set, emit a warning if an assumed size array is passed to an assumed rank dummy. * intrinsic.cc (do_ts29113_check): Permit an assumed rank arg. for reshape if -std=f202y and the argument is contiguous. * invoke.texi : Introduce -std=f202y. Whitespace errors. * lang.opt : Accept -std=f202y. * libgfortran.h : Define GFC_STD_F202Y. * match.cc (gfc_match_associate): If -std=f202y an assumed rank selector is allowed if it is contiguous and the associate name has rank remapping specified. * options.cc (gfc_init_options): -std=f202y is equivalent to -std=f2023 with experimental f202y features. White space issues * parse.cc (parse_associate): If the selector is assumed rank, use the 'ar' field of the association list to build an array specification. * primary.cc (gfc_match_varspec): Do not resolve the assumed rank selector of a class associate name at this stage to avoid the rank change. * resolve.cc (find_array_spec): If an array_ref dimension is -1 reset it with the rank in the object's array_spec. (gfc_expression_rank): Do not check dimen types for an assumed rank variable expression. (resolve_variable): Do not emit the assumed rank context error if the context is pointer assignment and the variable is a target. (resolve_assoc_var): Resolve the bounds and check for missing bounds in the rank remap of an associate name with an assumed rank selector. Do not correct the rank of an associate name with an assumed rank selector. (resolve_symbol): Allow the reference to an assumed rank object if -std-f202y is enabled and the current operation is EXEC_BLOCK. * st.cc (gfc_free_association_list): Free bounds expressions of the 'ar' field, if present. * trans-array.cc (gfc_conv_ss_startstride): If -std=f202y and bounds checking activated, do not apply the assertion. * trans-expr.cc (gfc_trans_pointer_assignment): An assumed rank target has its offset set to zero. * trans-stmt.cc (trans_associate_var): If the selector is assumed rank, call gfc_trans_pointer_assignment using the 'ar' field in the association list as the array reference for expr1. The data target, expr2, is a copy of the selector expression. gcc/testsuite/ PR fortran/116733 * gfortran.dg/associate_3.f03: Change error message. * gfortran.dg/f202y/f202y.exp: Enable tests of f202y features. * gfortran.dg/f202y/generic_assumed_rank_1.f90: New test. * gfortran.dg/f202y/generic_assumed_rank_2.f90: New test. * gfortran.dg/f202y/generic_assumed_rank_3.f90: New test.
Showing
- gcc/fortran/array.cc 3 additions, 3 deletionsgcc/fortran/array.cc
- gcc/fortran/expr.cc 25 additions, 1 deletiongcc/fortran/expr.cc
- gcc/fortran/gfortran.h 2 additions, 0 deletionsgcc/fortran/gfortran.h
- gcc/fortran/interface.cc 10 additions, 0 deletionsgcc/fortran/interface.cc
- gcc/fortran/intrinsic.cc 14 additions, 3 deletionsgcc/fortran/intrinsic.cc
- gcc/fortran/invoke.texi 17 additions, 14 deletionsgcc/fortran/invoke.texi
- gcc/fortran/lang.opt 6 additions, 2 deletionsgcc/fortran/lang.opt
- gcc/fortran/libgfortran.h 1 addition, 0 deletionsgcc/fortran/libgfortran.h
- gcc/fortran/match.cc 52 additions, 1 deletiongcc/fortran/match.cc
- gcc/fortran/options.cc 18 additions, 9 deletionsgcc/fortran/options.cc
- gcc/fortran/parse.cc 24 additions, 3 deletionsgcc/fortran/parse.cc
- gcc/fortran/primary.cc 1 addition, 0 deletionsgcc/fortran/primary.cc
- gcc/fortran/resolve.cc 30 additions, 6 deletionsgcc/fortran/resolve.cc
- gcc/fortran/st.cc 16 additions, 0 deletionsgcc/fortran/st.cc
- gcc/fortran/trans-array.cc 6 additions, 3 deletionsgcc/fortran/trans-array.cc
- gcc/fortran/trans-expr.cc 52 additions, 13 deletionsgcc/fortran/trans-expr.cc
- gcc/fortran/trans-stmt.cc 52 additions, 4 deletionsgcc/fortran/trans-stmt.cc
- gcc/testsuite/gfortran.dg/associate_3.f03 3 additions, 3 deletionsgcc/testsuite/gfortran.dg/associate_3.f03
- gcc/testsuite/gfortran.dg/f202y/f202y.exp 57 additions, 0 deletionsgcc/testsuite/gfortran.dg/f202y/f202y.exp
- gcc/testsuite/gfortran.dg/f202y/generic_assumed_rank_1.f90 54 additions, 0 deletionsgcc/testsuite/gfortran.dg/f202y/generic_assumed_rank_1.f90
Loading
Please register or sign in to comment