aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
AgeCommit message (Collapse)AuthorFilesLines
2011-06-122011-06-12 Tobias BurnusTobias Burnus1-1/+2
PR fortran/49324 * trans-expr.c (gfc_trans_assignment_1): Tell gfc_trans_scalar_assign to also deep-copy RHS nonvariables with allocatable components. * trans-array.c (gfc_conv_expr_descriptor): Ditto. 2011-06-12 Tobias Burnus PR fortran/49324 * gfortran.dg/alloc_comp_assign_11.f90: New. From-SVN: r174959
2011-05-31re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-0/+2
2011-05-31 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * trans-array.c (gfc_trans_dummy_array_bias): Handle cobounds of assumed-shape arrays. 2011-05-31 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray/dummy_1.f90: New. From-SVN: r174504
2011-05-31re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-20/+39
2011-05-31 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * resolve.c (resolve_fl_variable): Handle static coarrays with non-constant cobounds. (resolve_symbol): Handle SAVE statement without arguments for coarrays. * trans-array.c (gfc_trans_array_cobounds): New function. (gfc_trans_array_bounds): Place code by call to it. * trans-array.h (gfc_trans_array_cobounds): New prototype. * trans-decl.c (gfc_get_symbol_decl, gfc_trans_deferred_vars): Handle static coarrays with nonconstant cobounds. 2011-05-31 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray/save_1.f90: New. * gfortran.dg/coarray_4.f90: Update dg-error. From-SVN: r174503
2011-05-29re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-1/+1
2011-05-29 Tobias Burnus <burnus@net-b.de> Richard Guenther <rguenther@suse.de> PR fortran/18918 * trans-types.c (gfc_get_nodesc_array_type): Don't mess with the type's TREE_TYPE. * trans-array.c (gfc_conv_array_ref): Use TYPE_MAIN_VARIANT. * trans.c (gfc_build_array_ref): Ditto. 2011-05-29 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_23.f90: New. Co-Authored-By: Richard Guenther <rguenther@suse.de> From-SVN: r174410
2011-05-26[multiple changes]Paul Thomas1-1/+1
2011-05-26 Paul Thomas <pault@gcc.gnu.org> Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/48955 * trans-expr.c (gfc_trans_assignment_1): GFC_REVERSE_NOT_SET changed to GFC_ENABLE_REVERSE. * trans-array.c (gfc_init_loopinfo): GFC_CANNOT_REVERSE changed to GFC_INHIBIT_REVERSE. * gfortran.h : Enum gfc_reverse is now GFC_ENABLE_REVERSE, GFC_FORWARD_SET, GFC_REVERSE_SET and GFC_INHIBIT_REVERSE. * dependency.c (gfc_dep_resolver): Change names for elements of gfc_reverse as necessary. Change the logic so that forward dependences are remembered as well as backward ones. When both have appeared, force a temporary. 2011-05-26 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/48955 * gfortran.dg/dependency_40.f90 : New test. From-SVN: r174302
2011-05-26re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-0/+4
2011-05-26 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * trans-array.c (gfc_conv_array_ref): Handle pointer coarrays. * trans-decl.c (has_coarray_vars, caf_init_block, gfor_fndecl_caf_register): New file-global variables. (gfc_finish_var_decl): Make sure that coarrays in main are static. (gfc_build_qualified_array): Generate coarray token variable. (gfc_get_symbol_decl): Don't use a static initializer for coarrays. (gfc_build_builtin_function_decls): Set gfor_fndecl_caf_register. (gfc_trans_deferred_vars, gfc_emit_parameter_debug_info): Skip for static coarrays. (generate_local_decl): Check for local coarrays. (create_main_function): SYNC ALL before calling MAIN. (generate_coarray_sym_init): Register static coarray. (generate_coarray_init): Generate CAF registering constructor function. (gfc_generate_function_code): Call it, if needed, do not create cgraph twice. (gfc_generate_module_vars, gfc_process_block_locals): Call generate_coarray_init. * trans-types.c (gfc_get_nodesc_array_type): Generate pointers * for -fcoarray=lib. * trans.h (gfor_fndecl_caf_register): New variable. (lang_type): New element caf_token. (GFC_TYPE_ARRAY_CAF_TOKEN): New macro. 2011-05-26 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray/registering_1.f90: New. From-SVN: r174301
2011-05-19re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-1/+6
2011-06-19 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * trans-types.c (gfc_get_element_type): Handle scalar coarrays. (gfc_get_nodesc_array_type): Make a variant-type copy for scalar coarrays. * trans.c (gfc_build_array_ref): Return original type not * variant copy for scalar coarrays. * trans-array.c (gfc_conv_array_ref): Ditto. 2011-06-19 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_21.f90: New. From-SVN: r173920
2011-05-06re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-1/+1
2011-05-06 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * trans-array.c (gfc_walk_variable_expr): Continue walking for scalar coarrays. * trans-intrinsic.c (convert_element_to_coarray_ref): New * function. (trans_this_image, trans_image_index, conv_intrinsic_cobound): Use it. (trans_this_image): Fix algorithm. * trans-types.c (gfc_get_element_type, * gfc_get_array_descriptor_base, gfc_sym_type): Handle scalar coarrays. 2011-05-06 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray/this_image_2.f90: New. From-SVN: r173506
2011-05-04trans-array.c (gfc_trans_array_constructor_value): Use size_int for bounds ↵Richard Guenther1-2/+2
of range types. 2011-05-04 Richard Guenther <rguenther@suse.de> * trans-array.c (gfc_trans_array_constructor_value): Use size_int for bounds of range types. (gfc_trans_array_constructor_value): Use size_type_node for memcpy argument. * trans-common.c (build_field): Use gfc_charlen_type_node for lengths. * trans-openmp.c (gfc_trans_omp_clauses): Do not pass NULL as type to build_int_cst. * trans-const.c (gfc_build_string_const): Use size_int for bounds of range types. (gfc_build_wide_string_const): Likewise. * trans-stmt.c (gfc_trans_label_assign): Use gfc_charlen_type_node for lengths. (gfc_trans_character_select): Likewise. (gfc_trans_character_select): Do not pass NULL as type to build_int_cst. (gfc_trans_character_select): Use size_int for bounds of range types. * trans-io.c (gfc_build_io_library_fndecls): Likewise. (add_case): Do not pass NULL as type to build_int_cst. (transfer_expr): Likewise. (transfer_array_desc): Likewise. * trans-decl.c (gfc_add_assign_aux_vars): Use gfc_charlen_type_node for lengths. (gfc_trans_assign_aux_var): Likewise. (create_main_function): Use size_int for bounds of range types. * trans-intrinsic.c (gfc_conv_intrinsic_minmax_char): Do not pass NULL as type to build_int_cst. (gfc_conv_intrinsic_spacing): Likewise. (gfc_conv_intrinsic_rrspacing): Likewise. (gfc_conv_intrinsic_len): Use gfc_charlen_type_node for lengths. From-SVN: r173374
2011-04-18convert each use of gfc_free (p) to free (p)Jim Meyering1-13/+13
Do that by running this command: perl -pi -e 's/\bgfc_free ?\(/free (/' \ $(git grep -El '\bgfc_free ?\(') which also corrects the few uses that lacked a space between the function name and the open parenthesis. Manually undo the change to the function definition itself and its prototype. They'll be removed next. * array.c (gfc_free_array_spec, gfc_set_array_spec): s/gfc_free/free/ * constructor.c (node_free): Likewise. * cpp.c (dump_queued_macros): Likewise. * data.c (gfc_assign_data_value): Likewise. * decl.c (free_variable, free_value, gfc_free_data): Likewise. (gfc_free_data_all, match_old_style_init): Likewise. (gfc_set_constant_character_len, gfc_free_enum_history, NUM_DECL): Likewise. (gfc_match_modproc): Likewise. * dependency.c (check_section_vs_section): Likewise. * error.c (gfc_pop_error, gfc_free_error): Likewise. * expr.c (free_expr0, gfc_free_expr, gfc_free_actual_arglist): Likewise. (gfc_free_ref_list, gfc_replace_expr, gfc_copy_ref): Likewise. (find_substring_ref, gfc_simplify_expr, gfc_check_assign_symbol): Likewise. * frontend-passes.c (gfc_run_passes, cfe_expr_0): Likewise. (strip_function_call, optimize_comparison): Likewise. * interface.c (gfc_free_interface, arginfo, check_interface0): Likewise. (CHECK_OS_COMPARISON, gfc_extend_assign, gfc_free_formal_arglist): Likewise. * intrinsic.c (gfc_intrinsic_done_1, gfc_convert_type_warn): Likewise. (gfc_convert_chartype): Likewise. * io.c (gfc_free_open, compare_to_allowed_values, gfc_free_close): Likewise. (gfc_free_filepos, gfc_free_dt, gfc_free_inquire): Likewise. * match.c (gfc_free_iterator, gfc_match_associate): Likewise. (gfc_free_alloc_list, gfc_free_namelist, gfc_free_equiv_until): Likewise. (free_case, gfc_free_forall_iterator): Likewise. * misc.c: Likewise. * module.c (free_pi_tree, resolve_fixups, free_rename): Likewise. (free_true_name, peek_atom, mio_allocated_wide_string): Likewise. (mio_pool_string, mio_internal_string, mio_gmp_integer): Likewise. (mio_gmp_real, mio_expr, mio_typebound_proc): Likewise. (mio_full_typebound_tree, skip_list, load_equiv): Likewise. (free_written_common, gfc_use_module, gfc_free_use_stmts): Likewise. * openmp.c (gfc_free_omp_clauses): Likewise. * options.c (gfc_post_options): Likewise. * parse.c (select_type_pop, parse_omp_structured_block): Likewise. * primary.c (gfc_free_structure_ctor_component): Likewise. * resolve.c (resolve_structure_cons, check_host_association): Likewise. (gfc_resolve_forall, resolve_equivalence): Likewise. * scanner.c (gfc_scanner_done_1, gfc_release_include_path): Likewise. (gfc_define_undef_line, preprocessor_line, include_line): Likewise. (load_file, gfc_read_orig_filename): Likewise. * simplify.c (simplify_transformation_to_array): Likewise. (gfc_simplify_ibits, simplify_shift, gfc_simplify_ishftc, STRING): Likewise. (gfc_simplify_compiler_options): Likewise. * st.c (gfc_free_statement, gfc_free_statements): Likewise. (gfc_free_association_list): Likewise. * symbol.c (free_components, gfc_free_st_label, free_st_labels): Likewise. (gfc_delete_symtree, gfc_free_symbol, gfc_undo_symbols): Likewise. (free_old_symbol, gfc_commit_symbols, free_tb_tree): Likewise. (free_common_tree, free_uop_tree, free_sym_tree): Likewise. (gfc_free_dt_list, gfc_free_equiv_infos, gfc_free_equiv_lists): Likewise. (gfc_free_finalizer, gfc_free_charlen, free_entry_list): Likewise. (gfc_free_namespace): Likewise. * trans-array.c (gfc_free_ss, gfc_trans_array_bound_check): Likewise. (gfc_conv_array_ref, gfc_conv_ss_startstride): Likewise. (gfc_trans_dummy_array_bias, gfc_conv_array_parameter): Likewise. * trans-common.c (get_init_field, create_common): Likewise. * trans-const.c (gfc_build_wide_string_const): Likewise. (gfc_conv_string_init): Likewise. * trans-decl.c (gfc_generate_function_code): Likewise. * trans-expr.c (gfc_conv_substring, gfc_free_interface_mapping): Likewise. (SCALAR_POINTER, gfc_conv_statement_function): Likewise. (gfc_trans_subarray_assign): Likewise. * trans-intrinsic.c (conv_generic_with_optional_char_arg): Likewise. * trans-io.c (gfc_trans_io_runtime_check, set_string): Likewise. (transfer_namelist_element, transfer_array_component): Likewise. * trans-openmp.c (gfc_trans_omp_array_reduction): Likewise. * trans-stmt.c (cleanup_forall_symtrees, gfc_trans_forall_1): Likewise. * trans.c (trans_runtime_error_vararg, gfc_restore_backend_locus): Likewise. From-SVN: r172666
2011-04-18re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-15/+0
2011-04-18 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * iresolve.c (gfc_resolve_image_index): Set ts.type. * simplify.c (gfc_simplify_image_index): Don't abort if the * bounds are not known at compile time and handle -fcoarray=lib. * trans-intrinsics.c (gfc_conv_intrinsic_function): Handle IMAGE_INDEX. (conv_intrinsic_cobound): Fix comment typo. (trans_this_image): New function. * trans-array.c (gfc_unlikely): Move to trans.c. * trans.c (gfc_unlikely): Function moved from trans-array.c. (gfc_trans_runtime_check): Use it. * trans-io.c (gfc_trans_io_runtime_check): Ditto. * trans.h (gfc_unlikely): Add prototype. 2011-04-18 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_16.f90: New. From-SVN: r172637
2011-04-15trans-array.c (toplevel): Include gimple.h.Michael Matz1-13/+56
* trans-array.c (toplevel): Include gimple.h. (gfc_trans_allocate_array_storage): Check flag_stack_arrays, properly expand variable length arrays. (gfc_trans_auto_array_allocation): If flag_stack_arrays create variable length decls and associate them with their scope. * gfortran.h (gfc_option_t): Add flag_stack_arrays member. * options.c (gfc_init_options): Handle -fstack_arrays option. * lang.opt (fstack-arrays): Add option. * invoke.texi (Code Gen Options): Document it. * Make-lang.in (trans-array.o): Depend on GIMPLE_H. From-SVN: r172524
2011-04-12re PR fortran/48360 (ICE on array assignment statement with allocatable LHS)Paul Thomas1-0/+10
2011-04-12 Paul Thomas <pault@gcc.gnu.org> PR fortran/48360 PR fortran/48456 * trans-array.c (get_std_lbound): For derived type variables return array valued component lbound. 2011-04-12 Paul Thomas <pault@gcc.gnu.org> PR fortran/48360 PR fortran/48456 * gfortran.dg/realloc_on_assign_6.f03: New test. From-SVN: r172339
2011-04-11re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-4/+22
2011-04-11 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * simplify.c (simplify_bound_dim): Exit for ucobound's last dimension unless -fcoarray=single. * trans-array (gfc_conv_descriptor_size_1): Renamed from gfc_conv_descriptor_size, made static, has now from_dim and to_dim arguments. (gfc_conv_descriptor_size): Call gfc_conv_descriptor_size. (gfc_conv_descriptor_cosize): New function. * trans-array.h (gfc_conv_descriptor_cosize): New prototype. * trans-intrinsic.c (conv_intrinsic_cobound): Add input_location and handle last codim of ucobound for when -fcoarray is not "single". From-SVN: r172262
2011-04-04re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-52/+154
2011-04-04 Tobias Burnus <burnus@net-b.de> Mikael Morin <mikael.morin@sfr.fr> PR fortran/18918 * check.c (is_coarray): Update - because of DIMEN_THIS_IMAGE. * expr.c (gfc_is_coindexed): Ditto. * gfortran.h (gfc_array_ref_dimen_type): Add DIMEN_THIS_IMAGE. * interface.c (compare_parameter): Use gfc_expr_attr and gfc_is_coindexed. * resolve.c (check_dimension, compare_spec_to_ref, resolve_allocate_expr, check_data_variable): Update for DIMEN_THIS_IMAGE. * simplify.c (gfc_simplify_lcobound, gfc_simplify_this_image, gfc_simplify_ucobound): Allow non-constant bounds. * trans-array.c (gfc_set_loop_bounds_from_array_spec, gfc_trans_create_temp_array, gfc_trans_constant_array_constructor, gfc_set_vector_loop_bounds, gfc_conv_array_index_offset, gfc_start_scalarized_body, gfc_trans_scalarizing_loops, gfc_trans_scalarized_loop_boundary, gfc_conv_section_startstride, gfc_conv_ss_startstride, gfc_conv_loop_setup, gfc_trans_array_bounds, gfc_conv_expr_descriptor, gfc_walk_variable_expr): Handle codimen. * trans-decl.c (gfc_build_qualified_array): Save cobounds. * trans-intrinsic.c (gfc_conv_intrinsic_bound): Use arg2. (conv_intrinsic_cobound): New function. (gfc_conv_intrinsic_function): Call it. (gfc_walk_intrinsic_function, gfc_add_intrinsic_ss_code): Handle ucobound, lcobound, this_image. * fortran/trans-types.c (gfc_build_array_type): Save cobounds. (gfc_get_dtype): Honour corank. (gfc_get_nodesc_array_type): Save corank and codimensions. (gfc_get_array_type_bounds): Save cobound. * fortran/trans.h (gfc_ss_info,gfc_loopinfo): Add codimen item. (gfc_array_kind): Add corank item. (GFC_TYPE_ARRAY_CORANK): New macro. 2011-04-04 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_10.f90: Add coarray descriptor diagnostic check. * gfortran.dg/coarray_13.f90: Add checks for run-time cobounds. * gfortran.dg/coarray_15.f90: New. Co-Authored-By: Mikael Morin <mikael.morin@sfr.fr> From-SVN: r171949
2011-02-23re PR fortran/40850 (double free in nested types with allocatable components)Mikael Morin1-3/+4
2011-02-23 Mikael Morin <mikael@gcc.gnu.org> PR fortran/40850 * trans.c (gfc_prepend_expr_to_block): New function. * trans.h (gfc_prepend_expr_to_block): Declare. * trans-array.c (gfc_conv_array_parameter): Replace gfc_add_expr_to_block with gfc_prepend_expr_to_block. 2011-02-23 Mikael Morin <mikael@gcc.gnu.org> PR fortran/40850 * gfortran.dg/nested_allocatables_1.f90: New. From-SVN: r170445
2011-02-20re PR fortran/47797 (Debug: Odd first break point for subroutine breakp w/ ↵Tobias Burnus1-3/+4
allocatables) 2011-02-20 Tobias Burnus <burnus@net-b.de> PR fortran/47797 * trans-decl.c (gfc_trans_deferred_vars): Use gfc_set_backend_locus and gfc_restore_backend_locus to have better debug locations. * trans-array.c (gfc_trans_deferred_array): Ditto. From-SVN: r170347
2011-02-19re PR fortran/47348 (wrong string length with array constructor)Paul Thomas1-50/+52
2011-02-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/47348 * trans-array.c (get_array_ctor_all_strlen): Move up in file. (get_array_ctor_var_strlen): Add block dummy and add call to get_array_ctor_all_strlen instead of giving up on substrings. Call gcc_unreachable for default case. (get_array_ctor_strlen): Add extra argument to in call to get_array_ctor_var_strlen. 2011-02-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/47348 * gfortran.dg/array_constructor_36.f90 : New test. * gfortran.dg/bounds_check_10.f90 : Change dg-output message to allow for comparison between different elements of the array constructor at different levels of optimization. From-SVN: r170317
2011-01-11re PR fortran/47051 (Wrong reallocate)Paul Thomas1-82/+71
2011-01-11 Paul Thomas <pault@gcc.gnu.org> PR fortran/47051 * trans-array.c (gfc_alloc_allocatable_for_assignment): Change to be standard compliant by testing for shape rather than size before skipping reallocation. Improve comments. 2011-01-11 Paul Thomas <pault@gcc.gnu.org> PR fortran/47051 * gfortran.dg/realloc_on_assign_2.f03 : Modify 'test1' to be standard compliant and comment. From-SVN: r168650
2011-01-08re PR fortran/45777 (Alias analysis broken for arrays where LHS or RHS is a ↵Thomas Koenig1-4/+91
component ref) 2011-01-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45777 * symbol.c (gfc_symbols_could_alias): Strip gfc_ prefix, make static and move in front of its only caller, to ... * trans-array.c (symbols_could_alias): ... here. Pass information about pointer and target status as arguments. Allocatable arrays don't alias anything unless they have the POINTER attribute. (gfc_could_be_alias): Keep track of pointer and target status when following references. Also check if typespecs of components match those of other components or symbols. 2011-01-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45777 * gfortran.dg/dependency_39.f90: New test. From-SVN: r168596
2010-12-23re PR fortran/46978 (TRANSPOSE with RESHAPE and ALLOCATE: Segfault)Mikael Morin1-2/+2
2010-12-23 Mikael Morin <mikael.morin@gcc.gnu.org> PR fortran/46978 Revert part of revision 164112 * trans-array.c (gfc_trans_create_temp_array): Set loop n'th upper bound from (possibly transposed) array's dim bounds. From-SVN: r168206
2010-12-15re PR fortran/46945 (gfortran.dg/unpack_zerosize_1.f90 FAILs with -ftree-vrp ↵Jakub Jelinek1-27/+24
-fno-tree-ccp -fno-tree-fre) PR fortran/46945 * trans-array.c (gfc_array_init_size): Perform stride overflow checking and multiplication by element_size in size_type_node instead of sizetype, return value with size_type_node type instead of sometimes with sizetype and sometimes with gfc_array_index_type. * gfortran.dg/pr46945.f90: New test. From-SVN: r167871
2010-12-11re PR fortran/46842 (wrong results with MATMUL(..., TRANSPOSE (func ())) -- ↵Mikael Morin1-10/+12
465.tonto test run miscompares) 2010-12-11 Mikael Morin <mikael@gcc.gnu.org> Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/46842 * trans-array.c (dim_ok): New helper function. (gfc_conv_expr_descriptor): Use new helper function to check function array is full. Co-Authored-By: Jerry DeLisle <jvdelisle@gcc.gnu.org> From-SVN: r167713
2010-12-03trans-array.c (gfc_could_be_alias): Handle BT_CLASS as well as BT_DERIVED.Thomas Koenig1-8/+11
2010-12-02 Thomas Koenig <tkoenig@gcc.gnu.org> * trans-array.c (gfc_could_be_alias): Handle BT_CLASS as well as BT_DERIVED. (gfc_array_allocate): Likewise. (gfc_conv_array_parameter): Likewise. (structure_alloc_comps): Likewise. (gfc_is_reallocatable_lhs): Likewise. (gfc_trans_deferred_array): Likewise. From-SVN: r167412
2010-11-30PR fortran/28105 Overflow check for ALLOCATE statementJanne Blomqvist1-11/+130
From-SVN: r167317
2010-11-28re PR fortran/35810 ([TR 15581 / F2003] Automatic reallocation on assignment ↵Paul Thomas1-1/+476
to allocatable variables) 2010-11-28 Paul Thomas <pault@gcc.gnu.org> PR fortran/35810 * trans-array.c (gfc_trans_array_constructor): If the loop->to is a VAR_DECL, assume this is dynamic. In this case, use the counter to obtain the value and set loop->to appropriately. (gfc_conv_ss_descriptor): Always save the offset of a variable in info.saved_offset. (gfc_conv_ss_startstride): Do not attempt bound checking of the lhs of an assignment, if allocatable and f2003 is allowed. (gfc_conv_loop_setup): If possible, do not use an allocatable lhs variable for the loopspec. (gfc_is_reallocatable_lhs): New function. (get_std_lbound): New function. (gfc_alloc_allocatable_for_assignment): New function. * gfortran.h : Add flag_realloc_lhs to the options structure. * lang.opt : Add option f(no-)realloc-lhs. * invoke.texi : Document option f(no-)realloc-lhs. * options.c (gfc_init_options, gfc_post_options, gfc_handle_option): Incorporate f(no-)realloc-lhs with default to frealloc_lhs for -std > f95. * trans-array.h : Add primitive for previous. * trans-expr.c (gfc_conv_string_length): Return if character length is a variable and the expression is NULL. (gfc_conv_procedure_call): If the call is of the kind x = f(...) and the lhs is allocatable and reallocation on assignment OK, call gfc_alloc_allocatable_for_assignment. Do not generate the function call unless direct by reference. (realloc_lhs_loop_for_fcn_call): New function. (realloc_lhs_bounds_for_intrinsic_call): New function. (gfc_trans_arrayfunc_assign): Reallocation assignments need a loopinfo and for the loop bounds to be set. With intrinsic functions, free the lhs data and let the library allocate the data array. Done by the new functions above. (gfc_trans_assignment_1): If the lhs is allocatable and reallocation on assignment is allowed, mark the lhs and use gfc_alloc_allocatable_for_assignment to make the reallocation. * trans.h : Add is_alloc_lhs bitfield to gfc_ss structure. 2010-11-28 Paul Thomas <pault@gcc.gnu.org PR fortran/35810 * gfortran.dg/realloc_on_assign_1.f03: New test. * gfortran.dg/realloc_on_assign_2.f03: New test. * gfortran.dg/transpose_2.f90: dg-option -fno-realloc-lhs. * gfortran.dg/unpack_bounds_1.f90: The same. * gfortran.dg/cshift_bounds_2.f90: The same. * gfortran.dg/matmul_bounds_2.f90: The same. * gfortran.dg/matmul_bounds_3.f90: The same. * gfortran.dg/matmul_bounds_4.f90: The same. * gfortran.dg/matmul_bounds_5.f90: The same. From-SVN: r167220
2010-11-10cfgloop.c (verify_loop_structure): Use %' in diagnostics.Joseph Myers1-1/+1
* cfgloop.c (verify_loop_structure): Use %' in diagnostics. Start diagnostics with lowercase letters. * cgraphunit.c (verify_cgraph_node): Start diagnostics with lowercase letters. * collect2.c (maybe_run_lto_and_relink): Remove trailing '.' from diagnostic. * config/alpha/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/arm/arm.c (arm_get_pcs_model): Start diagnostics with lowercase letters. * config/arm/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. Remove trailing ' ' from diagnostic. * config/avr/avr.c (print_operand_address): Start diagnostic with a lowercase letter and remove trailing '.'. * config/avr/avr.opt (mpmem-wrap-around): Fix typo in help text. * config/bfin/bfin.c (bfin_option_override): Start diagnostics with lowercase letters. Use %' in diagnostics. Remove trailing '.' from diagnostics. (bfin_handle_longcall_attribute): Use %' in diagnostic. * config/cris/cris.c (cris_split_movdx, cris_expand_pic_call_address): Start diagnostics with lowercase letters. (cris_asm_output_label_ref): Use %' in diagnostic. * config/cris/cris.h (ASM_SPEC): Start diagnostic with a lowercase letter. * config/crx/crx.h (FUNCTION_PROFILER): Start diagnostic with a lowercase letter. * config/darwin-c.c (version_as_macro): Start diagnostic with a lowercase letter. * config/darwin-driver.c (darwin_default_min_version): Use %' in diagnostic. * config/host-darwin.c (darwin_gt_pch_use_address): Use %' in diagnostic. * config/i386/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/i386/host-cygwin.c (cygwin_gt_pch_get_address): Use %' in diagnostics. * config/i386/i386.c (ix86_option_override_internal): Write diagnostic as a single sentence without trailing '.'. Use %' in diagnostics. (ix86_function_sseregparm, classify_argument): Start diagnostics with lowercase letters. (ix86_expand_prologue): Use %' in diagnostic. * config/i386/i386.h (CC1_CPU_SPEC_1): Remove trailing '.' from diagnostic. * config/i386/nwld.h (LINK_SPEC): Start diagnostic with a lowercase letter. * config/i386/winnt.c (i386_pe_determine_dllimport_p): Use %' in diagnostic. * config/ia64/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/ia64/ia64.opt (msched-max-memory-insns-hard-limit): Avoid '`' in help text. * config/lm32/lm32.c (lm32_print_operand): Start diagnostic with a lowercase letter. * config/mep/mep.c (mep_validate_vliw): Start diagnostics with lowercase letters. * config/microblaze/microblaze.c (microblaze_handle_option): Remove trailing '.' from diagnostic. (print_operand): Start diagnostic with a lowercase letter. * config/pa/pa-hpux10.h (LINK_SPEC): Start diagnostics with lowercase letters. Avoid '`' in diagnostics. * config/pa/pa-hpux11.h (LINK_SPEC): Start diagnostics with lowercase letters. Avoid '`' in diagnostics. * config/pa/pa64-hpux.h (LINK_SPEC): Start diagnostics with lowercase letters. Avoid '`' in diagnostics. * config/picochip/picochip.c (picochip_option_override, picochip_emit_save_register, picochip_function_arg, picochip_output_label, picochip_output_internal_label, picochip_asm_output_opcode, picochip_output_cbranch, picochip_output_compare, picochip_output_branch, picochip_get_vliw_alu_id): Remove trailing '.' and '\n' from diagnostics. Start diagnostics with lowercase letters. Use %' in diagnostics. * config/rs6000/rs6000.c (rs6000_option_override_internal): Use "SPE" capitalization. Start diagnostic with a lowercase letter. (rs6000_handle_option): Start diagnostics with lowercase letters. (def_builtin): Remove trailing '.' from diagnostic. (rs6000_savres_routine_name): Start diagnostic with a lowercase letter. * config/rs6000/sysv4.h (LINK_OS_FREEBSD_SPEC): Avoid '`' in diagnostic. * config/rx/rx.c (rx_handle_option): Start diagnostic with a lowercase letter. * config/s390/s390.c (s390_option_override) Start diagnostics with lowercase letters. Use %' in diagnostic. * config/sh/sh.c (sh_output_mi_thunk): Start diagnostics with lowercase letters. * config/sh/symbian-base.c (sh_symbian_mark_dllimport): Use %' in diagnostic. * config/sh/symbian-c.c (sh_symbian_is_dllimported): Use %' in diagnostic. * config/sh/symbian-cxx.c (sh_symbian_is_dllimported): Use %' in diagnostic. * config/sparc/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/spu/spu.c (spu_option_override): Start diagnostics with lowercase letters. Use %qs for quoting in diagnostics. (spu_check_builtin_parm): Remove trailing '.' from diagnostics. Use %wd instead of HOST_WIDE_INT_PRINT_DEC in diagnostic . * config/v850/v850.c (construct_save_jarl): Remove trailing '\n' from diagnostic. * convert.c (convert_to_integer, convert_to_vector): Use %' in diagnostics. * dbgcnt.c (dbg_cnt_process_opt): Start diagnostic with lowercase letter and use "cannot" spelling. * expmed.c (extract_fixed_bit_field): Start diagnostic with lowercase letter and format as a single sentence without '.'. * ggc-common.c (write_pch_globals, gt_pch_save, gt_pch_restore): Use %' in diagnostics. * ggc-page.c (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read): Use %' in diagnostics. * ggc-zone.c (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read): Use %' in diagnostics. * graph.c (clean_graph_dump_file): Use %' in diagnostic. * graphite-poly.c (graphite_read_scop_file): Start diagnostics with lowercase letters and remove tailing '.' and '\n'. * lto-cgraph.c (input_profile_summary): Start diagnostic with lowercase letter and remove trailing '.'. (input_cgraph): Start diagnostics with lowercase letters and remove trailing '\n'. * opts.c (finish_options, common_handle_option): Start diagnostics with lowercase letters and remove trailing '.'. Fix typo in diagnostic. * passes.c (position_pass): Start diagnostic with lowercase letter. * plugin.c (add_new_plugin, parse_plugin_arg_opt, register_callback, try_init_one_plugin): Start diagnostics with lowercase letters. * reload1.c (spill_failure): Use %' in diagnostic. (gen_reload): Start diagnostic with a lowercase letter. * stor-layout.c (place_field): Start diagnostic with a lowercase letter. * toplev.c (open_auxiliary_file): Use %' in diagnostic. * tree-cfg.c (verify_expr, verify_types_in_gimple_reference, verify_gimple_call, verify_gimple_phi, verify_eh_throw_stmt_node): Start diagnostics with lowercase letters, remove trailing '.' and use %' in diagnostics. * tree-ssa.c (verify_def): Remove trailing '.' from diagnostic. (verify_ssa): Don't split diagnostic across two error calls. Spell out "number" and use %' in diagnostic. * value-prof.c (visit_hist, check_counter): Start diagnostics with lowercase letters. c-family: * c-common.c (handle_mode_attribute): Use %' and word "signedness" in diagnostic. * c-opts.c (c_common_parse_file): Start diagnostics with lowercase letter. * c-pragma.c (handle_pragma_target, handle_pragma_optimize): Remove trailing '.' from diagnostics. * c.opt (Wwrite-strings_: Avoid '`' in help text. cp: * cvt.c (cp_convert_to_pointer): Use %' in diagnostic. * decl.c (layout_var_decl, maybe_commonize_var, grokdeclarator): Use %' in diagnostics. * decl2.c (check_classfn): Use %' in diagnostic. * init.c (build_java_class_ref): Use %' in diagnostic. (build_delete): Remove trailing '.' from diagnostic. * method.c (do_build_copy_assign, walk_field_subobs): Use %' in diagnostics. * name-lookup.c (pushdecl_maybe_friend): Use %' in diagnostic. * parser.c (cp_parser_exception_specification_opt): Remove trailing '.' from diagnostic. (cp_parser_objc_interstitial_code): Use %qs for quoting in diagnostic. * pt.c (check_valid_ptrmem_cst_expr): Use %< and %> for quoting in diagnostic. * repo.c (reopen_repo_file_for_write): Use %' in diagnostic. fortran: * trans-array.c (gfc_trans_deferred_array): Use "front-end" spelling in diagnostic. * trans.c (gfc_allocate_array_with_status): Add missing space in diagnostic. java: * expr.c (expand_java_field_op): Use %' in diagnostic. * jcf-parse.c (java_parse_file): Use %' in diagnostics. * jvspec.c (lang_specific_driver): Use %' in diagnostic. * lang.c (java_post_options): Use %' in diagnostics. lto: * lto.c (lto_resolution_read): Start diagnostics with lowercase letters and remove trailing '.'. (lto_file_finalize): Start diagnostic with a lowercase letter. objc: * objc-act.c (objc_init): Use %' in diagnostic. (objc_set_method_opt): Remove trailing '.' from diagnostic. From-SVN: r166570
2010-11-09re PR fortran/46313 ([OOP] class container naming collisions)Janus Weil1-2/+2
2010-11-09 Janus Weil <janus@gcc.gnu.org> PR fortran/46313 * gfortran.h (gfc_add_data_component,gfc_add_vptr_component, gfc_add_hash_component,gfc_add_size_component, gfc_add_def_init_component): New macros. * class.c (gfc_add_component_ref): Renamed data component. (get_unique_type_string): New function. (gfc_build_class_symbol): Use 'get_unique_type_string' to construct uniques names for the class containers. Rename components. (gfc_find_derived_vtab): Use 'get_unique_type_string' to construct uniques names for the vtab symbols. Rename components. * decl.c (attr_decl1): Renamed class container components. * iresolve.c (gfc_resolve_extends_type_of): Ditto. * match.c (select_type_set_tmp): Renamed temporaries. * module.c (read_module): Renamed vtab and vtype symbols. * resolve.c (resolve_structure_cons,resolve_typebound_function, resolve_typebound_subroutine,resolve_deallocate_expr, resolve_select_type,resolve_fl_derived): Renamed class container and vtab components. * trans-array.c (structure_alloc_comps): Ditto. * trans-decl.c (gfc_trans_deferred_vars): Ditto. * trans-expr.c (gfc_conv_derived_to_class,gfc_conv_structure, gfc_trans_class_init_assign,gfc_trans_class_assign): Ditto. * trans-intrinsic.c (gfc_conv_intrinsic_sizeof, gfc_conv_intrinsic_storage_size,gfc_conv_allocated,gfc_conv_associated, gfc_conv_same_type_as): Ditto. * trans-stmt.c (gfc_trans_allocate): Ditto. 2010-11-09 Janus Weil <janus@gcc.gnu.org> PR fortran/46313 * gfortran.dg/class_29.f03: New. From-SVN: r166480
2010-10-26re PR fortran/42647 ([F03] Missed initialization/dealloc of allocatable ↵Janus Weil1-14/+12
scalar DT with allocatable component) 2010-10-26 Janus Weil <janus@gcc.gnu.org> PR fortran/42647 * trans.h (gfc_deallocate_scalar_with_status): New prototype. * trans.c (gfc_deallocate_scalar_with_status): New function for deallocation of allocatable scalars. * trans-array.c (structure_alloc_comps): Call it here ... * trans-decl.c (gfc_trans_deferred_vars): ... here ... * trans-stmt.c (gfc_trans_deallocate): ... and here. 2010-10-26 Janus Weil <janus@gcc.gnu.org> PR fortran/42647 * gfortran.dg/allocatable_scalar_9.f90: Extended. * gfortran.dg/allocatable_scalar_10.f90: New. * gfortran.dg/class_19.f03: Extended. From-SVN: r165973
2010-10-26[multiple changes]Tobias Burnus1-1/+1
2010-10-26 Tobias Burnus <burnus@net-b.de> PR fortran/45451 * trans-stmt.c (gfc_trans_allocate): Do a deep-copy for SOURCE=. PR fortran/43018 * trans-array.c (duplicate_allocatable): Use size of type and not the size of the pointer to the type. 2010-10-26 Tobias Burnus <burnus@net-b.de> PR fortran/45451 * gfortran.dg/class_allocate_5.f90: New. From-SVN: r165936
2010-10-06trans-array.c (gfc_free_ss_chain): Made non-static.Mikael Morin1-1/+1
2010-10-06 Mikael Morin <mikael@gcc.gnu.org> * trans-array.c (gfc_free_ss_chain): Made non-static. * trans-array.h (gfc_free_ss_chain): New prototype. * trans-stmt.c (gfc_trans_where_2): Free ss chains. From-SVN: r165052
2010-10-06trans-array.c (gfc_conv_tmp_array_ref): Add factorized call to ↵Mikael Morin1-0/+1
gfc_advance_se_ss_chain. 2010-10-06 Mikael Morin <mikael@gcc.gnu.org> * trans-array.c (gfc_conv_tmp_array_ref): Add factorized call to gfc_advance_se_ss_chain. * trans-expr.c (gfc_conv_subref_array_ref, gfc_conv_procedure_call, gfc_conv_array_constructor_expr, gfc_trans_assignment_1): Remove calls to gfc_advance_se_ss_chain after gfc_conv_tmp_array_ref. * trans-intrinsic.c (gfc_conv_intrinsic_function): Ditto. * trans-stmt.c (gfc_trans_where_assign, gfc_trans_where_3): Ditto. From-SVN: r165046
2010-10-06trans.c (gfc_restore_backend_locus): New function.Mikael Morin1-6/+9
2010-10-06 Mikael Morin <mikael@gcc.gnu.org> * trans.c (gfc_restore_backend_locus): New function. (gfc_get_backend_locus): Renamed to ... (gfc_save_backend_locus): ... this. * trans.h (gfc_restore_backend_locus, gfc_get_backend_locus, gfc_save_backend_locus): Same. * trans-array.c (gfc_trans_g77_array, gfc_trans_dummy_array_bias, gfc_trans_deferred_array): Rename gfc_get_backend_locus to gfc_save_backend_locus. (gfc_trans_dummy_array_bias): Call gfc_restore_backend_locus at the end. (gfc_trans_g77_array, gfc_trans_deferred_array): Use gfc_restore_backend_locus instead of gfc_set_backend_locus. (gfc_trans_deferred_array): Call gfc_restore_backend_locus on early return. * trans-decl.c (gfc_get_extern_function_decl, build_entry_thunks, gfc_trans_deferred_vars): Rename gfc_get_backend_locus to gfc_save_backend_locus. Use gfc_restore_backend_locus insted of gfc_set_backend_locus. From-SVN: r165045
2010-10-06trans-array.c (gfc_build_constant_array_constructor): Free array spec when done.Mikael Morin1-0/+7
2010-10-06 Mikael Morin <mikael@gcc.gnu.org> * trans-array.c (gfc_build_constant_array_constructor): Free array spec when done. From-SVN: r165041
2010-09-23re PR fortran/45745 (ICE in gfc_conv_array_stride)Mikael Morin1-6/+10
2010-09-23 Mikael Morin <mikael@gcc.gnu.org> PR fortran/45745 PR fortran/45648 * trans-array.c (gfc_conv_expr_descriptor): Handle ss->type == GFC_SS_INTRINSIC (for {l,u}bound intrinsics) case. 2010-09-23 Mikael Morin <mikael@gcc.gnu.org> PR fortran/45745 PR fortran/45648 * gfortran.dg/vector_subscript_bound_1.f90: New. From-SVN: r164558
2010-09-21re PR fortran/45648 (Unnecessary temporary for transpose calls as actual ↵Mikael Morin1-31/+62
argument.) 2010-09-21 Mikael Morin <mikael@gcc.gnu.org> PR fortran/45648 * trans-array.c (gfc_conv_expr_descriptor): Calculate dim out of n and info->dim. PR fortran/45648 * trans-array.c (gfc_conv_expr_descriptor): Unset full if we are accessing dimensions in reversed order. PR fortran/45648 * trans-array.c (gfc_conv_expr_descriptor): Special case noncopying intrinsic function call. * trans-array.c (gfc_conv_expr_descriptor): Remove ss lookup. Update asserts accordingly. PR fortran/45648 * trans.h (gfc_se): New field force_tmp. * trans-expr.c (gfc_conv_procedure_call): Check for argument alias and set parmse.force_tmp if some alias is found. * trans-array.c (gfc_conv_expr_descriptor): Force a temporary creation if se->force_tmp is set. 2010-09-21 Mikael Morin <mikael@gcc.gnu.org> PR fortran/45648 * gfortran.dg/inline_transpose_1.f90: Update temporary's locations and counts. Add non-elemental function call check. PR fortran/45648 * gfortran.dg/inline_transpose_1.f90: Add function calls with aliasing arguments checks. Update temporary counts. * gfortran.dg/transpose_optimization_1.f90: New. From-SVN: r164494
2010-09-10gfortran.h (gfc_expr): Remove inline_noncopying_intrinsic attribute.Mikael Morin1-92/+1
2010-09-11 Mikael Morin <mikael@gcc.gnu.org> * gfortran.h (gfc_expr): Remove inline_noncopying_intrinsic attribute. * dependency.c (gfc_check_dependency): Don't depend on expr's inline_noncopying_intrinsic_attribute. * dependency.c (gfc_check_argument_var_dependency, gfc_check_argument_dependency): Ditto. Recursively check dependency as NOT_ELEMENTAL in the non-copying (=transpose) case. * trans-intrinsic.c (gfc_conv_intrinsic_function): Ditto. * resolve.c (find_noncopying_intrinsics): Remove. (resolve_function, resolve_call): Remove call to find_noncopying_intrinsics. * trans-array.c (gfc_conv_array_transpose): Remove. (gfc_walk_subexpr): Make non-static. Move prototype... * trans-array.h (gfc_walk_subexpr): ... here. * trans-intrinsic.c (gfc_conv_intrinsic_function): Update transpose handling. (walk_inline_intrinsic_transpose, walk_inline_intrinsic_function, gfc_inline_intrinsic_function_p): New. (gfc_is_intrinsic_libcall): Return early in inline intrinsic case. Remove transpose from the libcall list. (gfc_walk_intrinsic_function): Special case inline intrinsic. * trans.h (gfc_inline_intrinsic_function_p): New prototype. 2010-09-11 Mikael Morin <mikael@gcc.gnu.org> * gfortran.dg/inline_transpose_1.f90: Update temporary's locations and counts. Check that transpose is not called. * gfortran.dg/transpose_2.f90: Update error message. From-SVN: r164205
2010-09-10trans-array.c (gfc_conv_loop_setup): Access the shape along the real array ↵Mikael Morin1-1/+1
dimension instead of the scalarizer... 2010-09-10 Mikael Morin <mikael@gcc.gnu.org> * trans-array.c (gfc_conv_loop_setup): Access the shape along the real array dimension instead of the scalarizer (loop) dimension. From-SVN: r164162
2010-09-10trans-array.c (gfc_conv_resolve_dependencies): Handle same-array transposed ↵Mikael Morin1-0/+14
references. 2010-09-10 Mikael Morin <mikael@gcc.gnu.org> * trans-array.c (gfc_conv_resolve_dependencies): Handle same-array transposed references. From-SVN: r164158
2010-09-10re PR fortran/45186 (Gfortran 4.5.0 emits wrong linenumbers)Tobias Burnus1-6/+8
2010-09-10 Tobias Burnus <burnus@net-b.de> PR fortran/45186 * trans.h (build1_stat_loc, build2_stat_loc, build3_stat_loc, build4_stat_loc): New inline functions. (build1_loc, build2_loc, build3_loc, build4_loc): New macros. (build1_v, build2_v, build3_v, build4_v): Use input_location as locus. * trans-array.c (gfc_trans_scalarized_loop_end, gfc_conv_array_parameter): Replace build[1-4] by build[1-4]_loc. * trans.c (gfc_build_addr_expr, gfc_build_array_ref, gfc_finish_wrapped_block): Ditto. * trans-decl.c (gfc_init_default_dt, init_intent_out_dt): Ditto. * trans-expr.c (gfc_conv_missing_dummy, gfc_trans_alloc_subarray_assign, gfc_trans_zero_assign): Ditto. * trans-openmp.c (gfc_omp_clause_default_ctor, gfc_trans_omp_critical, gfc_trans_omp_parallel, gfc_trans_omp_parallel_do, gfc_trans_omp_parallel_sections, gfc_trans_omp_parallel_workshare, gfc_trans_omp_sections gfc_trans_omp_single, gfc_trans_omp_task, gfc_trans_omp_workshare): Ditto. From-SVN: r164143
2010-09-09trans-array.c (gfc_get_array_ref_dim): New function.Mikael Morin1-15/+53
2010-09-09 Mikael Morin <mikael@gcc.gnu.org> * trans-array.c (gfc_get_array_ref_dim): New function. (gfc_trans_create_temp_array): Reconstruct array bounds from loop bounds. Use array bounds instead of loop bounds. From-SVN: r164112
2010-09-09trans-array.c (gfc_set_loop_bounds_from_array_spec): Get the array dimension ↵Mikael Morin1-2/+4
from the dim array. 2010-09-09 Mikael Morin <mikael@gcc.gnu.org> * trans-array.c (gfc_set_loop_bounds_from_array_spec): Get the array dimension from the dim array. From-SVN: r164109
2010-09-09trans-array.c (gfc_trans_preloop_setup): Unconditionally use the dim array ↵Mikael Morin1-7/+8
to get the stride in the innermost loop. 2010-09-09 Mikael Morin <mikael@gcc.gnu.org> * trans-array.c (gfc_trans_preloop_setup): Unconditionally use the dim array to get the stride in the innermost loop. From-SVN: r164103
2010-09-09trans-array.c (gfc_trans_create_temp_array): Don't set dim array.Mikael Morin1-1/+8
2010-09-09 Mikael Morin <mikael@gcc.gnu.org> * trans-array.c (gfc_trans_create_temp_array): Don't set dim array. (gfc_conv_loop_setup, gfc_walk_function_expr): Set dim array. * trans-intrinsic.c (gfc_walk_intrinsic_libfunc): Ditto. From-SVN: r164094
2010-09-09trans-array.c (gfc_trans_create_temp_array): Assert loop dimension and info ↵Mikael Morin1-4/+5
dimension are the same. 2010-09-09 Mikael Morin <mikael@gcc.gnu.org> * trans-array.c (gfc_trans_create_temp_array): Assert loop dimension and info dimension are the same. Loop over loop dimension. * trans-stmt.c (gfc_conv_elemental_dependencies): Set loop dimension Co-Authored-By: Janus Weil <janus@gcc.gnu.org> From-SVN: r164090
2010-09-09trans-array.c (gfc_conv_array_transpose): Change generated descriptor nameMikael Morin1-1/+1
2010-09-09 Mikael Morin <mikael@gcc.gnu.org> * trans-array.c (gfc_conv_array_transpose): Change generated descriptor name 2010-09-09 Mikael Morin <mikael@gcc.gnu.org> * gfortran.dg/inline_transpose_1.f90: New test. From-SVN: r164087
2010-09-07re PR fortran/45186 (Gfortran 4.5.0 emits wrong linenumbers)Tobias Burnus1-329/+455
2010-09-07 Tobias Burnus <burnus@net-b.de> PR fortran/45186 * trans-array.c (gfc_conv_descriptor_data_get, gfc_conv_descriptor_data_set, gfc_conv_descriptor_data_addr, gfc_conv_descriptor_offset, gfc_conv_descriptor_dtype, gfc_conv_descriptor_dimension, gfc_conv_descriptor_stride, gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound, gfc_conv_shift_descriptor_lbound, gfc_set_loop_bounds_from_array_spec, gfc_trans_allocate_array_storage, gfc_trans_create_temp_array, gfc_conv_array_transpose, gfc_get_iteration_count, gfc_grow_array, gfc_trans_array_ctor_element, gfc_trans_array_constructor_subarray, gfc_trans_array_constructor_value, constant_array_constructor_loop_size, gfc_trans_array_constructor, gfc_set_vector_loop_bounds, gfc_trans_array_bound_check, gfc_conv_array_index_offset, gfc_conv_scalarized_array_ref, gfc_conv_array_ref, gfc_trans_preloop_setup, gfc_trans_scalarized_loop_end, gfc_conv_ss_startstride, gfc_conv_loop_setup, gfc_conv_array_extent_dim, gfc_conv_descriptor_size, gfc_array_init_size, gfc_array_allocate, gfc_array_deallocate, gfc_trans_array_bounds, gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias, gfc_get_dataptr_offset, get_array_charlen, gfc_conv_expr_descriptor, array_parameter_size, gfc_conv_array_parameter, gfc_trans_dealloc_allocated, get_full_array_size, duplicate_allocatable, structure_alloc_comps): Change fold_build[0-9] to fold_build[0-9]_loc. (duplicate_allocatable, structure_alloc_comps, gfc_duplicate_allocatable): Add space after function name. From-SVN: r163964
2010-08-19re PR fortran/29785 (Fortran 2003: POINTER Rank Remapping)Daniel Kraft1-51/+132
2010-08-19 Daniel Kraft <d@domob.eu> PR fortran/29785 PR fortran/45016 * trans.h (struct gfc_se): New flag `byref_noassign'. * trans-array.h (gfc_conv_shift_descriptor_lbound): New method. (gfc_conv_array_extent_dim), (gfc_conv_descriptor_size): New methods. * expr.c (gfc_check_pointer_assign): Allow bounds and rank remapping and check for compile-time errors with those. * trans-decl.c (trans_associate_var): Use new routine `gfc_conv_shift_descriptor_lbound' instead of doing it manually. * trans-array.c (gfc_conv_shift_descriptor_lbound): New method. (gfc_conv_array_extent_dim), (gfc_conv_descriptor_size): New methods. (gfc_array_init_size): Use new `gfc_conv_array_extent_dim'. (gfc_conv_expr_descriptor): Handle new flag `byref_noassign'. * trans-expr.c (gfc_trans_pointer_assignment): Handle bounds and rank remapping for assignment. 2010-08-19 Daniel Kraft <d@domob.eu> PR fortran/29785 PR fortran/45016 * gfortran.dg/pointer_assign_5.f90: Remove 'not implemented' error. * gfortran.dg/pointer_remapping_1.f90: New test. * gfortran.dg/pointer_remapping_2.f03: New test. * gfortran.dg/pointer_remapping_3.f08: New test. * gfortran.dg/pointer_remapping_4.f03: New test. * gfortran.dg/pointer_remapping_5.f08: New test. * gfortran.dg/pointer_remapping_6.f08: New test. From-SVN: r163377
2010-07-23re PR fortran/24524 (Fortran dependency checking should reverse loops)Paul Thomas1-7/+23
2009-07-23 Paul Thomas <pault@gcc.gnu.org> PR fortran/24524 * trans-array.c (gfc_init_loopinfo): Initialize the reverse field. gfc_trans_scalarized_loop_end: If reverse set in dimension n, reverse the scalarization loop. gfc_conv_resolve_dependencies: Pass the reverse field of the loopinfo to gfc_dep_resolver. trans-expr.c (gfc_trans_assignment_1): Enable loop reversal for assignment by resetting loop.reverse. gfortran.h : Add the gfc_reverse enum. trans.h : Add the reverse field to gfc_loopinfo. dependency.c (gfc_check_dependency): Pass null to the new arg of gfc_dep_resolver. (gfc_check_section_vs_section): Check for reverse dependencies. (gfc_dep_resolver): Add reverse argument and deal with the loop reversal logic. dependency.h : Modify prototype for gfc_dep_resolver to include gfc_reverse *. From-SVN: r162462
2010-07-17trans-array.c (gfc_free_ss): Don't free beyond ss rank.Mikael Morin1-115/+133
2010-07-17 Mikael Morin <mikael@gcc.gnu.org> * trans-array.c (gfc_free_ss): Don't free beyond ss rank. Access subscript through the "dim" field index. (gfc_trans_create_temp_array): Access ss info through the "dim" field index. (gfc_conv_array_index_offset): Ditto. (gfc_conv_loop_setup): Ditto. (gfc_conv_expr_descriptor): Ditto. (gfc_conv_ss_startstride): Ditto. Update call to gfc_conv_section_startstride. (gfc_conv_section_startstride): Set values along the array dimension. Get array dimension directly from the argument. From-SVN: r162276