2016-20-10 Paul Thomas * trans-array.c (gfc_conv_expr_descriptor): Detect class object with an abstract declared type. Use the type of the data field and the dynamic element length from the symbol backend_decl. * trans-decl.c (gfc_trans_deferred_vars): Initialize the descriptor of allocatable class arrays.. 2016-09-10 Paul Thomas * trans-array.c (gfc_alloc_allocatable_for_assignment): Put calculation of element length before setting of extent and sm so that the element length field is set, ready for this. * trans-intrinsic.c (conv_isocbinding_subroutine): Set the elem len field of the descriptor. * trans-stmt.c (gfc_conv_intrinsic_size): The one that is subtracted from arg_2 has to be an integer_type. 2016-09-07 Paul Thomas * trans-expr.c (gfc_conv_scalar_to_descriptor): Correct error in setting 'type'. (gfc_conv_intrinsic_to_class): Use the expression typespec for unlimited polymorphic classes. * trans-intrinsic.c (conv_isocbinding_subroutine): Set the elem len field of the descriptor. * trans-stmt.c (trans_associate_var): Build a null descriptor for the associate name, if the target is unlimited polymorphic, and copy the dtype, element length and stride measures to the associate name. 2016-09-07 Paul Thomas * trans-array.c (gfc_build_null_descriptor): Set the element length to zero for deferred types. (gfc_trans_static_array_pointer): Initialize deferred string length to zero. (gfc_array_init_size): Restore chunk for calculating the ubound of array constructor sources. * trans-expr.c (gfc_conv_scalar_to_descriptor): If the type is NULL_TREE, set the element length to zero. (gfc_trans_pointer_assignment): Copy the element length. trans-io.c (gfc_build_io_library_fndecls): Update arguments for namelist transfers. (transfer_namelist_element): Calculate element length and update arguments to transfer calls. 2016-08-30 Paul Thomas * trans-array.c (gfc_array_init_size): Remove argument 'ts'. Use the 'expr' typespec instead. (gfc_array_allocate): Remove the typespec argument in the call to gfc_array_init_size. * trans-expr.c (gfc_conv_scalar_to_descriptor): Use the type of the scalar to get the element size, rather than that of the descriptor. (gfc_conv_intrinsic_to_class): Provide the typespec for the call to gfc_conv_scalar_to_descriptor. (gfc_conv_component_ref): Whitespace. (gfc_conv_procedure_call): Provide the typespec as above. (gfc_conv_structure): Provide rank for call to gfc_conv_initializer. (gfc_trans_pointer_assignment): Update the rank field in the case of rank remap. * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Provide the typespec for the calls to gfc_conv_scalar_to_descriptor. Change call to gfc_get_dtype_rank_type into gfc_get_dtype. Provide extra arguments for call to gfc_trans_create_temp_array. (conv_caf_send): As previous and eliminate 'tmp2'. (gfc_conv_intrinsic_sizeof): Use the elem_len field. 2014-06-14 Paul Thomas * trans-array.c (gfc_conv_array_parameter): Assign 'old_desc' to 'new_desc' rather than some of the components. 2014-06-03 Paul Thomas * trans-array.c (gfc_conv_expr_descriptor): Use the type of the expression for the type of the array. The element length should be set initially to the descriptor element type so that the stride measure is calculated correctly. * trans-stmt.c (gfc_conv_elemental_dependencies): Use the type of the elements of the descriptor for 'temptype'. Change the comment accordingly. 2014-05-22 Paul Thomas * trans-array.c (gfc_conv_descriptor_stride_get, gfc_conv_descriptor_stride_get): Only use 'elem_len' field for element size. * trans-stmt.c (trans_associate_var): Eliminate redundant declaration of 'desc'. Use 'sm' and 'elem_len' fields directly to calculate offset. 2013-06-05 Tobias Burnus * trans-array.c (gfc_array_init_size): Remove superfluous "ts" argument due to trunk merging. (gfc_array_allocate): Pass only one ts. 2013-05-07 Tobias Burnus * trans-intrinsic.c (gfc_conv_intrinsic_bound, gfc_conv_intrinsic_size): Set argse.data_not_needed. 2013-05-07 Tobias Burnus * trans-array.c (gfc_conv_descriptor_stride_get, gfc_conv_descriptor_stride_set): Use elem_len, unless it is a nonstring intrinsic type for which size_in_bytes is used. (gfc_array_init_size): Set elem_len before handling the strides. * trans-expr.c (gfc_conv_subref_array_arg): Remove no-op extent shifting code. 2013-05-06 Tobias Burnus * trans-array.c (gfc_conv_ss_startstride, set_loop_bounds): Handle GFC_ISYM_SHAPE in the scalarizer. (gfc_array_init_size, gfc_conv_expr_descriptor): Ensure that extent is never negative except for assumed size arrays. * trans-intrinsic.c (gfc_conv_intrinsic_bound): Optimizations of the bounds handling. (gfc_conv_intrinsic_size): Handle SIZE and SHAPE directly without calling the library. (gfc_conv_intrinsic_function, gfc_add_intrinsic_ss_code, gfc_walk_intrinsic_bound, gfc_is_intrinsic_libcall, gfc_walk_intrinsic_function): Handle SHAPE. 2013-04-30 Tobias Burnus * libgfortran.h (GFC_TYPE_MASK, GFC_TYPE_KIND_SHIFT, GFC_TYPE_INTEGER, GFC_TYPE_LOGICAL, GFC_TYPE_REAL, GFC_TYPE_COMPLEX, GFC_TYPE_CHARACTER, GFC_TYPE_STRUCT, GFC_TYPE_CPTR, GFC_TYPE_CFUNPTR, GFC_TYPE_OTHER): New. (GFC_DTYPE_TYPE_SHIFT, GFC_DTYPE_TYPE_MASK, GFC_DTYPE_SIZE_SHIFT): Remove. (bt): Reorder. * trans-array.c (OFFSET_FIELD, ATTR_FIELD): Change value (swap order). (gfc_conv_descriptor_rank_set, gfc_conv_descriptor_attr_set, gfc_build_null_descriptor): Change data type. (gfc_trans_create_temp_array): Add ts and strlen arguments. (gfc_trans_array_constructor_subarray, trans_array_constructor, gfc_alloc_allocatable_for_assignment): Update call. (gfc_conv_loop_setup, gfc_array_init_size): Ditto; add ts argument. (gfc_array_allocate, gfc_conv_array_initializer, gfc_conv_expr_descriptor): Update calls. (gfc_conv_expr_descriptor): Properly set the elem_len. (structure_alloc_comps, gfc_trans_deferred_array): Update get_dtype call. * trans-array.h (gfc_trans_create_temp_array, gfc_conv_loop_setup, gfc_build_null_descriptor): Update prototype. * trans-decl.c (gfc_trans_deferred_vars, gfc_trans_deferred_vars): Update calls. * trans-expr.c (gfc_conv_scalar_to_descriptor, realloc_lhs_loop_for_fcn_call): Take ts argument. (gfc_conv_class_to_class, gfc_conv_subref_array_arg, gfc_conv_procedure_call, gfc_conv_procedure_call, gfc_conv_initializer, gfc_trans_subarray_assign, gfc_trans_pointer_assignment, gfc_trans_arrayfunc_assign, gfc_trans_assignment_1): Update calls. * trans-intrinsic.c (trans_this_image): Change to extent. (gfc_conv_intrinsic_anyall, gfc_conv_intrinsic_count, gfc_conv_intrinsic_arith, gfc_conv_intrinsic_dot_product, gfc_conv_intrinsic_minmaxloc, gfc_conv_intrinsic_minmaxval, gfc_conv_intrinsic_transfer, conv_isocbinding_subroutine): Update calls. * trans-io.c (transfer_namelist_element, transfer_array_component, gfc_trans_transfer): Update calls. * trans-stmt.c (gfc_conv_elemental_dependencies, gfc_trans_call, trans_associate_var, generate_loop_for_temp_to_lhs, generate_loop_for_rhs_to_temp, compute_inner_temp_size, gfc_trans_pointer_assign_need_temp, gfc_evaluate_where_mask, gfc_trans_where_assign, gfc_copy_loopinfo_to_se): Ditto. * trans-types.c (gfc_init_types, gfc_get_dtype): Update dtype handling. (gfc_get_array_descriptor_base): Change data types of the descriptor. (struct gfc_array_descriptor): Update comment. * trans-types.h (gfc_get_dtype): Update prototype. * trans.c (gfc_build_final_call): Update calls. 2013-04-30 Tobias Burnus * trans-array.c (gfc_trans_dummy_array_bias, get_std_lbound, gfc_alloc_allocatable_for_assignment): Change ubound to extent. * trans-expr.c (gfc_trans_alloc_subarray_assign): Ditto. * trans-intrinsic.c (gfc_conv_intrinsic_bound): Ditto. 2013-04-25 Tobias Burnus * libgfortran.h (GFC_ATTRIBUTE_*): New defines. * trans-array.c (gfc_conv_descriptor_elem_len, gfc_conv_descriptor_elem_len_get, gfc_conv_descriptor_elem_len_set, gfc_conv_descriptor_rank_set, gfc_conv_descriptor_version_set, gfc_conv_descriptor_attr_set): New functions. (gfc_build_null_descriptor, gfc_trans_static_array_pointer, gfc_trans_create_temp_array, gfc_conv_array_initializer, gfc_conv_expr_descriptor, structure_alloc_comps): Fill new fields at decl time/DT-alloc time. (gfc_conv_descriptor_size_1, get_full_array_size, gfc_alloc_allocatable_for_assignment): Use extent directly. * trans-array.h (gfc_conv_descriptor_elem_len_get, gfc_conv_descriptor_elem_len_set, gfc_conv_descriptor_rank_set, gfc_conv_descriptor_version_set, gfc_conv_descriptor_attr_set): New prototype. * trans-common.c (create_common): Update calls. * trans-decl.c (gfc_get_symbol_decl, get_proc_pointer_decl, gfc_trans_deferred_vars, gfc_emit_parameter_debug_info): Ditto. * trans-expr.c (gfc_conv_scalar_to_descriptor, class_array_data_assign, gfc_conv_derived_to_class, gfc_conv_class_to_class, gfc_conv_initializer, gfc_trans_pointer_assignment, fcncall_realloc_result): Set new fields. (gfc_conv_structure): Update calls. (gfc_set_interface_mapping_bounds, gfc_conv_subref_array_arg): Use extent directly. * trans-intrinsic.c (size_of_string_in_bytes): Remove static. * trans-io.c (transfer_namelist_element): Pass elem_size. * trans-types.c (gfc_get_array_descriptor_base): Add "attribute" field. * trans.h (size_of_string_in_bytes): New prototype. (gfc_get_module_backend_decl): Update prototype. 2013-04-01 Tobias Burnus * libgfortran.h (GFC_MAX_DIMENSIONS): Change to 15. (GFC_DTYPE_RANK_MASK): Remove. * trans-array.c (RANK_FIELD): New define. (gfc_conv_descriptor_rank): Use rank field. (gfc_trans_create_temp_array, gfc_array_init_size, gfc_conv_expr_descriptor, gfc_alloc_allocatable_for_assignment): Set rank field. * trans-expr.c (gfc_conv_scalar_to_descriptor, class_array_data_assign, gfc_conv_derived_to_class, gfc_conv_class_to_class, gfc_trans_pointer_assignment, fcncall_realloc_result): Ditto. * trans-intrinsic.c (conv_isocbinding_subroutine): Ditto. * trans-io.c (gfc_build_io_library_fndecls, transfer_namelist_element): Pass rank as extra argument. * trans-types.c (gfc_get_element_type, gfc_get_dtype): Don't add the rank to dtype. (gfc_get_array_descriptor_base): New "rank" field. 2013-03-31 Tobias Burnus * trans-intrinsic.c (conv_isocbinding_subroutine): Fix merge-resolution bug. 2013-03-31 Tobias Burnus * trans-array.c (VERSION_FIELD): New define. (ELEM_LEN_FIELD): Renamed from SIZE_FIELD, reordered the fields. (gfc_build_null_descriptor): Also set version field (to 1). * trans-types.c (gfc_get_array_descriptor_base): Rename "size" to "elem_len" and move up, add "version" field. 2012-07-20 Tobias Burnus * trans-expr.c (conv_isocbinding_procedure): For C_F_Pointer, directly set extent and sm instead of using ubound and stride. 2012-07-15 Tobias Burnus * trans-intrinsic.c (gfc_conv_intrinsic_size, gfc_conv_intrinsic_sizeof): Replace (ubound-lbound+1) calculation by "extent". * trans-expr.c (fcncall_realloc_result): Ditto. * trans-io.c (gfc_convert_array_to_string): Ditto. * trans-openmp.c (gfc_omp_clause_default_ctor, gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op, gfc_trans_omp_array_reduction): Ditto. * trans-array.c (array_parameter_size): Ditto. (gfc_grow_array): Ditto - and fix size calculation for realloc. 2012-07-15 Tobias Burnus * trans-intrinsic.c (gfc_conv_associated): Compare sm instead of stride. 2012-03-12 Tobias Burnus * trans-types.c (gfc_get_array_descriptor_base): Rename "data" to "base_addr". 2012-03-11 Tobias Burnus * trans-array.c (UBOUND_SUBFIELD, STRIDE_SUBFIELD): Remove. (LBOUND_SUBFIELD, EXTENT_SUBFIELD, SM_SUBFIELD): Change value. (gfc_conv_descriptor_stride): Remove. (gfc_conv_descriptor_stride_set): Only set "sm". (gfc_conv_descriptor_ubound): Remove. (gfc_conv_descriptor_ubound_set): Only set "extent" (gfc_conv_shift_descriptor_lbound): Remove ubound-setting call. (gfc_conv_array_sm, gfc_conv_array_extent): New functions. * trans-array.h (gfc_conv_array_sm, gfc_conv_array_extent): New prototypes. * trans-types.c (gfc_get_desc_dim_type): Remove stride/ubound, rename and reorder according to TS29113. * trans-io.h (transfer_namelist_element): Pass extent/sm instead of ubound/stride. 2012-03-10 Tobias Burnus * trans-array.c (CAF_TOKEN_FIELD): Set to the correct value. (gfc_conv_descriptor_ubound_get, gfc_conv_descriptor_ubound_set): Remove bogus byte-size handling, correctly handle lower bounds which don't start with unity. (gfc_conv_shift_descriptor_lbound): Reorder to make sure that lbound comes before ubound. * trans-expr.c (gfc_conv_subref_array_arg, gfc_trans_alloc_subarray_assign): Ditto. 2010-09-01 Paul Thomas * trans-array.c : Define and subsequently undefine descriptor SIZE_FIELD, SM_SUBFIELD and EXTENT_SUBFIELD. Change the offset for DIMENSION_FIELD. (gfc_data_field_from_base_field): New function. (gfc_conv_descriptor_data_addr): Call it to maintain API. (gfc_dimension_field_from_base_field): New function. (gfc_conv_descriptor_dimension): Call it. (gfc_conv_descriptor_stride_get): Compute the stride from the 'sm' field. (gfc_conv_descriptor_stride_set): Compute and set 'sm' field. (gfc_conv_descriptor_sm, gfc_conv_descriptor_sm_get, gfc_conv_descriptor_sm_set): New functions. (gfc_conv_descriptor_extent, gfc_conv_descriptor_extent_get, gfc_conv_descriptor_extent_set): New functions. (gfc_conv_descriptor_ubound_get): Compute the ubound from the 'extent' field. (gfc_conv_descriptor_ubound_set): Compute and set 'extent' field. trans-array.h: New prototypes for gfc_conv_descriptor_sm_get, gfc_conv_descriptor_extent_get, gfc_data_field_from_base_field, gfc_dimension_field_from_base_field,gfc_conv_descriptor_sm_set, and gfc_conv_descriptor_extent_set. trans-types.c (gfc_get_desc_dim_type): Add 'sm' and 'extent' fields. (gfc_get_array_descriptor_base): Add 'size' field. (gfc_get_array_descr_info): Call gfc_data_field_from_base_field and gfc_dimension_field_from_base_field instead of using the field offsets explicitly.