2018-02-13 Janus Weil PR fortran/84313 * symbol.c (check_conflict): Reject procedure pointers in common blocks. 2018-02-13 Alastair McKinstry Janne Blomqvist * module.c (dump_module): Use lbasename to ensure that module files are reproducible. 2018-02-12 Janus Weil PR fortran/84273 * resolve.c (resolve_component): Fix checks of passed argument in procedure-pointer components. 2018-02-11 Francois-Xavier Coudert PR fortran/35299 * resolve.c (resolve_formal_arglist): Update error message. 2018-02-11 Andre Vehreschild * gfortran.texi: Fix typos in documentation of caf_register (). * trans-array.c (structure_alloc_comps): Only register a component of a derived typed corray, not of an ultimate component coarray. 2018-02-11 Steven G. Kargl PR fortran/54223 PR fortran/84276 * interface.c (compare_actual_formal): Add in_statement_function bool parameter. Skip check of INTENT attribute for statement functions. Arguments to a statement function cannot be optional, issue error for missing argument. (gfc_procedure_use, gfc_ppc_use, gfc_arglist_matches_symbol): Use in_statement_function. 2018-02-11 Paul Thomas PR fortran/84074 * trans-expr.c (gfc_conv_derived_to_class): Set the use_offset flag. If the is a vector subscript or the expression is not a variable, make the descriptor one-based. 2018-02-10 Paul Thomas PR fortran/84141 PR fortran/84155 * trans-array.c (gfc_array_init_size): Revert the change made in revision 257356 setting the dtype. * trans-types.c (gfc_get_dtype): Do not use the cached dtype. Call gfc_get_dtype_rank_type every time. PR fortran/56691 * trans-array.c (gfc_conv_expr_descriptor): If the source array is a descriptor type, use its offset, removing the condition that is be a class expression. 2018-02-07 Steven G. Kargl PR fortran/82994 * match.c (gfc_match_deallocate): Check for NULL pointer. 2018-02-07 Thomas Koenig PR fortran/68560 * trans-intrinsic.c (gfc_conv_intrinsic_shape): New function. (gfc_conv_intrinsic_function): Call it. 2018-02-07 Steven G. Kargl PR fortran/82049 * match.c (gfc_match_type_spec): If the charlen is non-NULL, then try to resolve it. While here return early if possible. 2018-02-04 Paul Thomas PR fortran/84115 * trans-decl.c (gfc_get_symbol_decl): Do not finish the decl of 'length' if the symbol charlen backend_decl is an indirect ref. 2018-02-03 Paul Thomas PR fortran/84141 PR fortran/84155 * trans-array.c (gfc_array_init_size): Instead of gfc_get_dtype use gfc_get_dtype_rank_type. 2018-02-01 Janne Blomqvist PR 83975 PR 83344 * resolve.c (resolve_assoc_var): Generate an error if target length unknown. 2018-02-01 Janne Blomqvist PR fortran/83705 * simplify.c (gfc_simplify_repeat): Increase limit for deferring to runtime, print a warning message. 2018-01-31 Jakub Jelinek PR fortran/84116 * openmp.c (gfc_match_omp_clauses): If all the linear gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist nor set *head = NULL. Formatting fixes. 2018-01-31 Paul Thomas PR fortran/84088 * trans-expr.c (gfc_conv_procedure_call): If the parm expr is an address expression passed to an assumed rank dummy, convert to an indirect reference. 2018-01-31 Thomas Koenig * dump-parse-tree.c (write_proc): Use sym_name (which may be sym->binding_label) instead of sym->name. 2018-01-31 Janne Blomqvist * trans-const.c (gfc_conv_string_init): Use gfc_charlen_t instead of int for slen. 2018-01-31 Janne Blomqvist PR fortran/78534 * trans-expr.c (fill_with_spaces): Use memset instead of generating loop. (gfc_trans_string_copy): Improve opportunity to use builtins with constant lengths. 2018-01-30 Jakub Jelinek PR debug/84131 * trans-array.c (gfc_get_descriptor_offsets_for_info): Set *data_off to DATA_FIELD's offset rather than OFFSET_FIELD's offset. 2018-01-30 Thomas Koenig PR fortran/84134 * array.c (gfc_ref_dimen_size): Whitespace fixes. If stride is zero, return false. 2018-01-30 Thomas Koenig PR fortran/84133 * frontend-passes (matmul_to_var_expr): Return early if in association list. (inline_matmul_assign): Likewise. 2017-01-29 Thomas Koenig PR fortran/84073 * resolve.c (resolve_component): Ensure BIND(C) character components have length one. (resolve_symbol): Likewise for variables. 2018-01-27 Jakub Jelinek PR fortran/84065 * decl.c (add_init_expr_to_sym): Ignore initializers for too large lengths. 2018-01-26 Damian Rouson Alessandro Fanfarillo Soren Rasmussen Partial support for Fortran 2018 teams features. * array.c (gfc_match_array_ref): add team attribute in coarray transfers. * check.c (gfc_check_get_team, gfc_check_team_number): add new functions for get_team and team_number. * dump-parse-tree.c (show_code_node): add new statements: form team, change team, end team, and sync team. * expr.c (gfc_find_team_co): add new function. * gfortran.h: add new statements. * intrinsic.c (add_functions): add get_team and team_number functions. * intrinsic.h: add get_team and team_number prototypes for check, simplify, and resolve. * iresolve.c (gfc_resolve_get_team, gfc_resolve_team_number): add new functions. * iso-fortran-env.def: add the team_type derived type. * match.c (gfc_match_if, gfc_match_form_team, gfc_match_team_number) (gfc_match_end_team, gfc_match_sync_team, gfc_match_change_team): add change team, end team, form team, sync team match and functions. * match.h: add new prototypes for change team, end team, form team, and sync team. * parse.c (decode_statement): add cases for change team, end team, form team, and sync team. * resolve.c: add cases for exec form team, change team, end team, and sync team. * simplify.c (gfc_simplify_get_team): add new function for get team. * st.c (gfc_free_statement): add cases exec for change team, end team, form team, sync team. * trans-decl.c (gfor_fndecl_caf_form_team) (gfor_fndecl_caf_change_team, gfor_fndecl_caf_end_team) (gfor_fndecl_caf_sync_team, gfor_fndecl_caf_get_team) (gfor_fndecl_caf_team_number): add functions and definitions. * trans-intrinsic.c (conv_caf_send, conv_intrinsic_team_number): add new function and team_type argument support. * trans-stmt.c (gfc_trans_form_team, gfc_trans_change_team) (gfc_trans_end_team, gfc_trans_sync_team): add new functions. * trans-stmt.h: add new prototypes. * trans-types.c (gfc_get_derived_type): check condition for team_type. * trans.c (trans_code): new exec cases for form team, change team, end team, and sync team. * trans.h: add new prototypes. 2018-01-26 Steven G. Kargl PR fortran/83998 * simplify.c (compute_dot_product): Initialize result to INTEGER(1) 0 or .false. The summation does the correct type conversion. (gfc_simplify_dot_product): Special case zero-sized arrays. 2018-25-01 Paul Thomas PR fortran/37577 * array.c (gfc_match_array_ref): If standard earlier than F2008 it is an error if the reference dimension is greater than 7. libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the dtype masks and shifts accordingly. * trans-array.c (gfc_conv_descriptor_dtype): Use the dtype type node to check the field. (gfc_conv_descriptor_dtype): Access the rank field of dtype. (duplicate_allocatable_coarray): Access the rank field of the dtype descriptor rather than the dtype itself. * trans-expr.c (get_scalar_to_descriptor_type): Store the type of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE (ie. a character). (gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to get_scalar_to_descriptor_type if the actual expression is a constant. (gfc_trans_structure_assign): Assign the rank directly to the dtype rank field. * trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result to default integer kind. (gfc_conv_intrinsic_sizeof): Obtain the element size from the 'elem_len' field of the dtype. * trans-io.c (gfc_build_io_library_fndecls): Replace gfc_int4_type_node with dtype_type_node where necessary. (transfer_namelist_element): Use gfc_get_dtype_rank_type for scalars. * trans-types.c : Provide 'get_dtype_type_node' to acces the dtype_type_node and, if necessary, build it. The maximum size of an array element is now determined by the maximum value of size_t. Update the description of the array descriptor, including the type def for the dtype_type. (gfc_get_dtype_rank_type): Build a constructor for the dtype. Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS. (gfc_get_array_descriptor_base): Change the type of the dtype field to dtype_type_node. (gfc_get_array_descr_info): Get the offset to the rank field of the dtype. * trans-types.h : Add a prototype for 'get_dtype_type_node ()'. * trans.h : Define the indices of the dtype fields. 2018-23-01 Paul Thomas PR fortran/83866 * decl.c (gfc_match_derived_decl): If eos not matched, recover and emit error about garbage after declaration. 2018-23-01 Paul Thomas PR fortran/83898 * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor for characters. 2018-01-22 Janne Blomqvist PR 78534 PR 83704 * arith.c (gfc_arith_concat): Use size_t for string length. (gfc_compare_string): Likewise. (gfc_compare_with_Cstring): Likewise. * array.c (gfc_resolve_character_array_constructor): Use HOST_WIDE_INT, gfc_mpz_get_hwi. * check.c (gfc_check_fe_runtime_error): Use size_t. * data.c (create_character_initializer): Use HOST_WIDE_INT, gfc_extract_hwi. * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t. (add_init_expr_to_sym): Use HOST_WIDE_INT. * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT, gfc_extract_hwi. (gfc_apply_init): Likewise. * match.h (gfc_set_constant_character_len): Update prototype. * primary.c (match_string_constant): Use size_t. * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT, gfc_mpz_get_hwi. * simplify.c (init_result_expr): Likewise. (gfc_simplify_len_trim): Use size_t. * target-memory.c (gfc_encode_character): Use size_t. (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi. (interpret_array): Use size_t. (gfc_interpret_character): Likewise. * target-memory.h (gfc_encode_character): Update prototype. (gfc_interpret_character): Likewise. (gfc_target_interpret_expr): Likewise. * trans-const.c (gfc_build_string_const): Use size_t for length argument. (gfc_build_wide_string_const): Likewise. * trans-const.h (gfc_build_string_const): Likewise. (gfc_build_wide_string_const): Likewise. 2018-01-20 Steven G. Kargl PR fortran/83900 * simplify.c (gfc_simplify_matmul): Set return type correctly. 2018-01-19 Steven G. Kargl PR fortran/83900 * simplify.c (gfc_simplify_matmul): Delete bogus assertion. 2018-01-17 Harald Anlauf PR fortran/83864 * expr.c (add_init_expr_to_sym): Do not dereference NULL pointer. 2018-01-17 Harald Anlauf PR fortran/83874 * decl.c (add_init_expr_to_sym): Do not dereference NULL pointer. 2018-01-15 Louis Krupp PR fortran/82257 * interface.c (compare_rank): Don't try to retrieve CLASS_DATA from symbol marked unlimited polymorphic. * resolve.c (resolve_structure_cons): Likewise. * misc.c (gfc_typename): Don't dereference derived->components if it's NULL. 2018-01-15 Thomas Koenig PR fortran/54613 * gfortran.h (gfc_check_f): Rename f4ml to f5ml. (gfc_logical_4_kind): New macro * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument. (gfc_simplify_maxloc): Likewise. (gfc_resolve_maxloc): Likewise. (gfc_resolve_minloc): Likewise. * check.c (gfc_check_minloc_maxloc): Add checking for "back" argument; also raise error if it is used (for now). Add it if it isn't present. * intrinsic.c (add_sym_4ml): Rename to (add_sym_5ml), adjust for extra argument. (add_functions): Add "back" constant. Adjust maxloc and minloc for back argument. * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is not of gfc_logical_4_kind, convert. (gfc_resolve_minloc): Likewise. * simplify.c (gfc_simplify_minloc): Add back argument. (gfc_simplify_maxloc): Likewise. * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last argument to %VAL to ensure passing by value. (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc also for library calls. 2018-01-13 Jerry DeLisle PR fortran/82007 * resolve.c (resolve_transfer): Delete code looking for 'DT' format specifiers in format strings. Set formatted to true if a format string or format label is present. * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix whitespace. 2018-01-13 Thomas Koenig PR fortran/83744 * dump-parse-tree.c (get_c_type_name): Remove extra line. Change for loop to use declaration in for loop. Handle BT_LOGICAL and BT_CHARACTER. (write_decl): Add where argument. Fix indentation. Replace assert with error message. Add typename to warning in comment. (write_type): Adjust locus to call of write_decl. (write_variable): Likewise. (write_proc): Likewise. Replace assert with error message. 2018-01-13 Paul Thomas PR fortran/52162 * trans-expr.c (gfc_trans_scalar_assign): Flag is_alloc_lhs if the rhs expression is neither an elemental nor a conversion function. PR fortran/83622 * trans-array.c (is_pointer_array): Remove unconditional return of false for -fopenmp. 2018-01-13 Thomas Koenig PR fortran/83803 * dump-parse-tree.c (write_proc): Always emit closing parenthesis for functions. 2018-01-10 Steven G. Kargl PR fortran/82367 * resolve.c (resolve_allocate_expr): Check for NULL pointer. 2018-01-10 Steven G. Kargl PR fortran/83093 * resolve.c (resolve_charlen): Check the type of cl->length after resolution. 2018-01-10 Janne Blomqvist PR fortran/83740 * trans-array.c (gfc_trans_array_ctor_element): Fix formatting. 2018-01-10 Janne Blomqvist PR fortran/83740 * trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the LHS type when assigning. 2018-01-09 Steven G. Kargl PR fortran/83742 * expr.c (gfc_is_simply_contiguous): Check for NULL pointer. 2018-01-08 Steven G. Kargl * match.c (gfc_match_allocate): Check for NULL pointer. 2018-01-08 Steven G. Kargl * expr.c (gfc_check_pointer_assign): Fix typo in comment. 2018-01-08 Paul Thomas PR fortran/83611 * decl.c (gfc_get_pdt_instance): If parameterized arrays have an initializer, convert the kind parameters and add to the component if the instance. * trans-array.c (structure_alloc_comps): Add 'is_pdt_type' and use it with case COPY_ALLOC_COMP. Call 'duplicate_allocatable' for parameterized arrays. Clean up typos in comments. Convert parameterized array initializers and copy into the array. * trans-expr.c (gfc_trans_scalar_assign): Do a deep copy for parameterized types. *trans-stmt.c (trans_associate_var): Deallocate associate vars as necessary, when they are PDT function results for example. PR fortran/83731 * trans-array.c (structure_alloc_comps): Only compare len parms when they are declared explicitly. 2018-01-06 Janne Blomqvist PR fortran/50892 * trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to lhs type. 2018-01-05 Janne Blomqvist PR fortran/78534 PR fortran/66310 * array.c (got_charlen): Use gfc_charlen_int_kind. * class.c (gfc_find_derived_vtab): Use gfc_size_kind instead of hardcoded kind. (find_intrinsic_vtab): Likewise. * decl.c (match_char_length): Use gfc_charlen_int_kind. (add_init_expr_to_sym): Use gfc_charlen_t and gfc_charlen_int_kind. (gfc_match_implicit): Use gfc_charlen_int_kind. * dump-parse-tree.c (show_char_const): Use gfc_charlen_t and size_t. (show_expr): Use HOST_WIDE_INT_PRINT_DEC. * expr.c (gfc_get_character_expr): Length parameter of type gfc_charlen_t. (gfc_get_int_expr): Value argument of type HOST_WIDE_INT. (gfc_extract_hwi): New function. (simplify_const_ref): Make string_len of type gfc_charlen_t. (gfc_simplify_expr): Use HOST_WIDE_INT for substring refs. * frontend-passes.c (optimize_trim): Use gfc_charlen_int_kind. * gfortran.h (gfc_mpz_get_hwi): New prototype. (gfc_mpz_set_hwi): Likewise. (gfc_charlen_t): New typedef. (gfc_expr): Use gfc_charlen_t for character lengths. (gfc_size_kind): New extern variable. (gfc_extract_hwi): New prototype. (gfc_get_character_expr): Use gfc_charlen_t for character length. (gfc_get_int_expr): Use HOST_WIDE_INT type for value argument. * gfortran.texi: Update description of hidden string length argument. * iresolve.c (check_charlen_present): Use gfc_charlen_int_kind. (gfc_resolve_char_achar): Likewise. (gfc_resolve_repeat): Pass string length directly without temporary, use gfc_charlen_int_kind. (gfc_resolve_transfer): Use gfc_charlen_int_kind. * match.c (select_intrinsic_set_tmp): Use HOST_WIDE_INT for charlen. * misc.c (gfc_mpz_get_hwi): New function. (gfc_mpz_set_hwi): New function. * module.c (atom_int): Change type from int to HOST_WIDE_INT. (parse_integer): Don't complain about large integers. (write_atom): Use HOST_WIDE_INT for integers. (mio_integer): Handle integer type mismatch. (mio_hwi): New function. (mio_intrinsic_op): Use HOST_WIDE_INT. (mio_array_ref): Likewise. (mio_expr): Likewise. * primary.c (match_substring): Use gfc_charlen_int_kind. * resolve.c (resolve_substring_charlen): Use gfc_charlen_int_kind. (resolve_character_operator): Likewise. (resolve_assoc_var): Likewise. (resolve_select_type): Use HOST_WIDE_INT for charlen, use snprintf. (resolve_charlen): Use mpz_sgn to determine sign. * simplify.c (gfc_simplify_repeat): Use HOST_WIDE_INT/gfc_charlen_t instead of long. * symbol.c (generate_isocbinding_symbol): Use gfc_charlen_int_kind. * target-memory.c (size_character): Length argument of type gfc_charlen_t. (gfc_encode_character): Likewise. (gfc_interpret_character): Use gfc_charlen_t. * target-memory.h (gfc_encode_character): Modify prototype. * trans-array.c (gfc_trans_array_ctor_element): Use existing type. (get_array_ctor_var_strlen): Use gfc_conv_mpz_to_tree_type. (trans_array_constructor): Use existing type. (get_array_charlen): Likewise. * trans-const.c (gfc_conv_mpz_to_tree_type): New function. * trans-const.h (gfc_conv_mpz_to_tree_type): New prototype. * trans-decl.c (gfc_trans_deferred_vars): Use existing type. (add_argument_checking): Likewise. * trans-expr.c (gfc_class_len_or_zero_get): Build const of type gfc_charlen_type_node. (gfc_conv_intrinsic_to_class): Use gfc_charlen_int_kind instead of 4, fold_convert to correct type. (gfc_conv_class_to_class): Build const of type size_type_node for size. (gfc_copy_class_to_class): Likewise. (gfc_conv_string_length): Use same type in expression. (gfc_conv_substring): Likewise, use HOST_WIDE_INT for charlen. (gfc_conv_string_tmp): Make sure len is of the right type. (gfc_conv_concat_op): Use same type in expression. (gfc_conv_procedure_call): Likewise. (fill_with_spaces): Comment out memset() block due to spurious -Wstringop-overflow warnings. (gfc_trans_string_copy): Use gfc_charlen_type_node. (alloc_scalar_allocatable_for_subcomponent_assignment): fold_convert to right type. (gfc_trans_subcomponent_assign): Likewise. (trans_class_vptr_len_assignment): Build const of correct type. (gfc_trans_pointer_assignment): Likewise. (alloc_scalar_allocatable_for_assignment): fold_convert to right type in expr. (trans_class_assignment): Build const of correct type. * trans-intrinsic.c (gfc_conv_associated): Likewise. (gfc_conv_intrinsic_repeat): Do calculation in sizetype. * trans-io.c (gfc_build_io_library_fndecls): Use gfc_charlen_type_node for character lengths. (set_string): Convert to right type in assignment. * trans-stmt.c (gfc_trans_label_assign): Build const of gfc_charlen_type_node. (trans_associate_var): Likewise. (gfc_trans_character_select): Likewise. (gfc_trans_allocate): Likewise, don't typecast strlen result. (gfc_trans_deallocate): Don't typecast strlen result. * trans-types.c (gfc_size_kind): New variable. (gfc_init_types): Determine gfc_charlen_int_kind and gfc_size_kind from size_type_node. * trans-types.h: Fix comment. 2018-01-04 Thomas Koenig PR fortran/83683 PR fortran/45689 * check.c (gfc_check_eoshift): Check for string length and for conformance of boundary. * intrinsic.c (add_functions): Add gfc_simplify_eoshift. * intrinsic.h: Add prototype for gfc_simplify_eoshift. * simplify.c (gfc_simplify_eoshift): New function. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * trans-types.c (gfc_type_for_mode): Check valid_vector_subparts_p. 2018-01-03 Thomas Koenig PR fortran/83664 * check.c (gfc_check_eoshift): Error for missing boundary if array is not one of the standard types. 2018-01-03 Jakub Jelinek Update copyright years. * gfortranspec.c (lang_specific_driver): Update copyright notice dates. * gfc-internals.texi: Bump @copying's copyright year. * gfortran.texi: Ditto. * intrinsic.texi: Ditto. * invoke.texi: Ditto. 2017-01-02 Thomas Koenig PR fortran/45689 * intrinsic.c (add_function): Add gfc_simplify_maxloc and gfc_simplify_minloc to maxloc and minloc, respectively. * intrinsic.h: Add prototypes for gfc_simplify_minloc and gfc_simplify_maxloc. * simplify.c (min_max_chose): Adjust prototype. Modify function to have a return value which indicates if the extremum was found. (is_constant_array_expr): Fix typo in comment. (simplify_minmaxloc_to_scalar): New function. (simplify_minmaxloc_nodim): New function. (new_array): New function. (simplify_minmaxloc_to_array): New function. (gfc_simplify_minmaxloc): New function. (simplify_minloc): New function. (simplify_maxloc): New function. 2018-01-02 Thomas Koenig PR fortran/45689 PR fortran/83650 * simplify.c (gfc_simplify_cshift): Re-implement to allow full range of arguments. 2018-01-01 Paul Thomas PR fortran/83076 * resolve.c (resolve_fl_derived0): Add caf_token fields for allocatable and pointer scalars, when -fcoarray selected. * trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token field as well as the backend_decl. (gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module derived types that are not vtypes. Components with caf_token attribute are pvoid types. For a component requiring it, find the caf_token field and have the component token field point to its backend_decl. PR fortran/83319 *trans-types.c (gfc_get_array_descriptor_base): Add the token field to the descriptor even when codimen not set. Copyright (C) 2018 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.