aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/dependency.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-03trans.h (gfc_inline_intrinsic_function_p): Move prototype...Mikael Morin1-0/+11
* trans.h (gfc_inline_intrinsic_function_p): Move prototype... * gfortran.h (gfc_inline_intrinsic_function_p): ... here. * dependency.c (gfc_check_argument_var_dependency): Check dependencies of inline intrinsics' arguments. From-SVN: r180904
2011-08-20re PR fortran/49638 ([OOP] length parameter is ignored when overriding type ↵Janus Weil1-15/+19
bound character functions with constant length.) 2011-08-20 Janus Weil <janus@gcc.gnu.org> PR fortran/49638 * dependency.c (gfc_dep_compare_expr): Add new result value "-3". (gfc_check_element_vs_section,gfc_check_element_vs_element): Handle result value "-3". * frontend-passes.c (optimize_comparison): Ditto. * interface.c (gfc_check_typebound_override): Ditto. 2011-08-20 Janus Weil <janus@gcc.gnu.org> PR fortran/49638 * gfortran.dg/typebound_override_1.f90: Modified. From-SVN: r177932
2011-08-07re PR fortran/49638 ([OOP] length parameter is ignored when overriding type ↵Janus Weil1-2/+12
bound character functions with constant length.) 2011-08-07 Janus Weil <janus@gcc.gnu.org> Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/49638 * dependency.c (are_identical_variables): For dummy arguments only check for equal names, not equal symbols. * interface.c (gfc_check_typebound_override): Add checking for rank and character length. 2011-08-07 Janus Weil <janus@gcc.gnu.org> PR fortran/49638 * gfortran.dg/typebound_override_1.f90: New. Co-Authored-By: Thomas Koenig <tkoenig@gcc.gnu.org> From-SVN: r177550
2011-08-07re PR fortran/49638 ([OOP] length parameter is ignored when overriding type ↵Janus Weil1-27/+22
bound character functions with constant length.) 2011-08-07 Janus Weil <janus@gcc.gnu.org> PR fortran/49638 * dependency.h (gfc_is_same_range,gfc_are_identical_variables): Remove two prototypes. * dependency.c (gfc_are_identical_variables,are_identical_variables): Renamed the former to the latter and made static. (gfc_dep_compare_expr): Renamed 'gfc_are_identical_variables', handle commutativity of multiplication. (gfc_is_same_range,is_same_range): Renamed the former to the latter, made static and removed argument 'def'. (check_section_vs_section): Renamed 'gfc_is_same_range'. * gfortran.h (gfc_check_typebound_override): New prototype. * interface.c (gfc_check_typebound_override): Moved here from ... * resolve.c (check_typebound_override): ... here (and renamed). (resolve_typebound_procedure): Renamed 'check_typebound_override'. From-SVN: r177545
2011-05-26[multiple changes]Paul Thomas1-12/+21
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-04-18convert each use of gfc_free (p) to free (p)Jim Meyering1-1/+1
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-03-21re PR fortran/22572 (Double occurrence of matmul intrinsic not optimised)Thomas Koenig1-30/+44
2010-03-21 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/22572 * gfortran.h (gfc_option_t) : Add flag_aggressive_function_elimination. (gfc_dep_compare_functions): Add prototype. * lang.opt: Add faggressive-function-elimination. * invoke.texi: Document -faggressive-function-elimination. * frontend_passes (expr_array): New static variable. (expr_size): Likewise. (expr_count): Likewise. (current_code): Likewise. (current_ns): Likewise. (gfc_run_passes): Allocate and free space for expressions. (cfe_register_funcs): New function. (create_var): New function. (cfc_expr_0): New function. (cfe_code): New function. (optimize_namespace): Invoke gfc_code_walker with cfe_code and cfe_expr_0. * dependency.c (gfc_dep_compare_functions): New function. (gfc_dep_compare_expr): Use it. * options.c (gfc_init_options): Handle flag_aggressive_function_elimination. (gfc_handle_option): Likewise. 2010-03-21 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/22572 * gfortran.dg/function_optimize_1.f90: New test. * gfortran.dg/function_optimize_2.f90: New test. From-SVN: r171207
2010-12-03re PR fortran/45159 (Unnecessary temporaries)Thomas Koenig1-47/+50
2010-12-02 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * dependency.c (check_section_vs_section): Pre-calculate the relationship between the strides and the relationship between the start values. Use an integer constant one for that purpose. Forward dependencies for positive strides apply for where the lhs start <= rhs start and lhs stride <= rhs stride and vice versa for negative stride. No need to compare end expressions in either case (assume no bounds violation). 2010-12-02 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * gfortran.dg/dependency_38.f90: New test. From-SVN: r167413
2010-10-10frontend-passes.c: Include opts.h.Thomas Koenig1-0/+46
2010-10-09 Thomas Koenig <tkoenig@gcc.gnu.org> * frontend-passes.c: Include opts.h. (optimize_comparison): Renamed from optimize_equality. Change second argument to operation to be compared. Use flag_finite_math_only to avoid comparing REAL and COMPLEX only when NANs are honored. Simplify comparing of string concatenations where left or right operands are equal. Simplify all comparison operations, based on the result of gfc_dep_compare_expr. * dependency.c: Include arith.h. (gfc_are_identical_variables): Volatile variables should not compare equal to themselves. (gfc_dep_compare_expr): Handle string constants and string concatenations. 2010-10-09 Thomas Koenig <tkoenig@gcc.gnu.org> * gfortran.dg/character_comparison_4.f90: New test. * gfortran.dg/character_comparison_5.f90: New test. * gfortran.dg/character_comparison_6.f90: New test. From-SVN: r165248
2010-09-10gfortran.h (gfc_expr): Remove inline_noncopying_intrinsic attribute.Mikael Morin1-12/+16
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-07re PR fortran/45576 (ICE on character stuff)Thomas Koenig1-1/+7
2010-09-07 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45576 * dependency.c (gfc_deb_compare_expr): Take missing optional arguments into account. 2010-09-07 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45576 * gfortran.dg/char_length_18.f90: New test. From-SVN: r163978
2010-09-03re PR fortran/45159 (Unnecessary temporaries)Thomas Koenig1-28/+21
2010-09-03 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * dependency.c (gfc_deb_compare_expr): Compare equal for equal arglists for pure user functions, or for those intrinsic functions which are also pure. * intrinsics.c (add_conv): Mark conversion functions as pure. (add_char_conversions): Likewise. 2010-09-03 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * gfortran.dg/dependency_34.f90: New test. From-SVN: r163834
2010-08-27re PR fortran/45159 (Unnecessary temporaries)Thomas Koenig1-15/+21
2010-08-27 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * dependency.c (check_section_vs_section): Single test for identical strides which takes into account that only one of the strides may be NULL. 2010-08-27 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * gfortran.dg/dependency_33.f90: New test. From-SVN: r163584
2010-08-06re PR fortran/45159 (Unnecessary temporaries)Thomas Koenig1-2/+22
2010-08-06 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * dependency.c (check_section_vs_section): Handle cases where the start expression coincides with the lower or upper bound of the array. 2010-08-06 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * gfortran.dg/dependency_31.f90: New test. From-SVN: r162966
2010-08-03re PR fortran/45159 (Unnecessary temporaries)Thomas Koenig1-14/+38
2010-08-03 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * dependency.c (gfc_deb_compare_expr): Remove any integer conversion functions to larger types from both arguments. Remove handling these functions futher down. 2010-08-03 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * gfortran.dg/dependency_30.f90: New test. From-SVN: r162848
2010-08-02re PR fortran/45159 (Unnecessary temporaries)Thomas Koenig1-2/+2
2010-08-02 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * depencency.c (gfc_dep_resolver): Fix logic for when a loop can be reversed. 2010-08-02 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * gfortran.dg/dependency_29.f90: New test. From-SVN: r162829
2010-08-02re PR fortran/36854 ([meta-bug] fortran front-end optimization)Thomas Koenig1-26/+123
2010-08-02 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36854 * dependency.h: Add prototype for gfc_are_identical_variables. * frontend-passes.c: Include depencency.h. (optimimize_equality): Use gfc_are_identical_variables. * dependency.c (identical_array_ref): New function. (gfc_are_identical_variables): New function. (gfc_deb_compare_expr): Use gfc_are_identical_variables. * dependency.c (gfc_check_section_vs_section). Rename gfc_ prefix from statc function. (check_section_vs_section): Change arguments to gfc_array_ref, adjust function body accordingly. 2010-08-02 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36854 * gfortran.dg/character_comparison_2.f90: New test. * gfortran.dg/character_comparison_3.f90: New test. * gfortran.dg/dependency_28.f90: New test. From-SVN: r162824
2010-07-23re PR fortran/24524 (Fortran dependency checking should reverse loops)Paul Thomas1-4/+65
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-22re PR fortran/45019 (Aliasing of TARGET dummy argument not detected correctly)Tobias Burnus1-0/+13
2010-07-22 Tobias Burnus <burnus@net-b.de> PR fortran/45019 * dependency.c (gfc_check_dependency): Add argument alising * check. * symbol.c (gfc_symbols_could_alias): Add argument alising * check. 2010-07-22 Tobias Burnus <burnus@net-b.de> PR fortran/45019 * gfortran.dg/aliasing_dummy_5.f90: New. From-SVN: r162410
2010-07-14re PR fortran/44925 ([OOP] C_LOC with CLASS pointer)Janus Weil1-1/+1
2010-07-14 Janus Weil <janus@gcc.gnu.org> PR fortran/44925 * gfortran.h (gfc_is_data_pointer): Remove prototype. * dependency.c (gfc_is_data_pointer): Make it static. * intrinsic.texi: Update documentation on C_LOC. * resolve.c (gfc_iso_c_func_interface): Fix pointer and target checks and add a check for polymorphic variables. 2010-07-14 Janus Weil <janus@gcc.gnu.org> PR fortran/44925 * gfortran.dg/c_loc_tests_15.f90: New. From-SVN: r162169
2010-06-21re PR fortran/40632 (Support F2008's contiguous attribute)Tobias Burnus1-1/+0
2010-06-20 Tobias Burnus <burnus@net-b.de> PR fortran/40632 * interface.c (compare_parameter): Add gfc_is_simply_contiguous checks. * symbol.c (gfc_add_contiguous): New function. (gfc_copy_attr, check_conflict): Handle contiguous attribute. * decl.c (match_attr_spec): Ditto. (gfc_match_contiguous): New function. * resolve.c (resolve_fl_derived, resolve_symbol): Handle contiguous. * gfortran.h (symbol_attribute): Add contiguous. (gfc_is_simply_contiguous): Add prototype. (gfc_add_contiguous): Add prototype. * match.h (gfc_match_contiguous): Add prototype. * parse.c (decode_specification_statement, decode_statement): Handle contiguous attribute. * expr.c (gfc_is_simply_contiguous): New function. * dump-parse-tree.c (show_attr): Handle contiguous. * module.c (ab_attribute, attr_bits, mio_symbol_attribute): Ditto. * trans-expr.c (gfc_add_interface_mapping): Copy attr.contiguous. * trans-array.c (gfc_conv_descriptor_stride_get, gfc_conv_array_parameter): Handle contiguous arrays. * trans-types.c (gfc_build_array_type, gfc_build_array_type, gfc_sym_type, gfc_get_derived_type, gfc_get_array_descr_info): Ditto. * trans.h (gfc_array_kind): Ditto. * trans-decl.c (gfc_get_symbol_decl): Ditto. 2010-06-20 Tobias Burnus <burnus@net-b.de> PR fortran/40632 * gfortran.dg/contiguous_1.f90: New. * gfortran.dg/contiguous_2.f90: New. * gfortran.dg/contiguous_3.f90: New. From-SVN: r161079
2010-05-31re PR fortran/36928 (array temporary for interleaving assignment with ↵Thomas Koenig1-0/+36
non-constant start values) 2010-05-31 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36928 * dependency.c (gfc_check_section_vs_section): Check for interleaving array assignments without conflicts. 2010-05-31 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36928 * gfortran.dg/dependency_27.f90: New test. * gfortran.dg/array_assign_1.F90: New test. From-SVN: r160085
2010-05-23gfortran.h: Do not include system.h.Tobias Burnus1-0/+1
2010-05-21 Tobias Burnus <burnus@net-b.de> * gfortran.h: Do not include system.h. * bbt.c: Include system.h. * data.c: Ditto. * dependency.c: Ditto. * dump-parse-tree.c: Ditto. * arith.h: Do not include gfortran.h. * constructor.h: Do not include gfortran.h and splay-tree.h. * match.h: Do not include gfortran.h. * parse.h: Ditto. * target-memory.h: Ditto. * openmp.c: Do not include toplev.h and target.h. * trans-stmt.c: Ditto not include toplev.h. * primary.c: Ditto. * trans-common.c: Tell why toplev.h is needed. And do not include target.h. * trans-expr.c: Tell why toplev.h is needed. * trans-array.c: Ditto. * trans-openmp.c: Ditto. * trans-const.c: Ditto. * trans.c: Ditto. * trans-types.c: Ditto. * trans-io.c: Ditto. * trans-decl.c: Ditto. * scanner.c: Ditto. * convert.c: Ditto. * trans-intrinsic.c: Ditto. * options.c: Ditto. From-SVN: r159763
2010-04-13[multiple changes]Jerry DeLisle1-2/+5
2010-04-12 Jerry DeLisle <jvdelisle@gcc.gnu.org> * array.c (extract_element): Restore function from trunk. (gfc_get_array_element): Restore function from trunk. (gfc_expand_constructor): Restore check against flag_max_array_constructor. * constructor.c (node_copy_and_append): Delete unused. * gfortran.h: Delete comment and extra include. * constructor.h: Bump copyright and clean up TODO comments. * resolve.c: Whitespace. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * simplify.c (compute_dot_product): Replaced usage of ADVANCE macro with direct access access to elements. Adjusted prototype, fixed all callers. (gfc_simplify_dot_product): Removed duplicate check for zero-sized array. (gfc_simplify_matmul): Removed usage of ADVANCE macro. (gfc_simplify_spread): Removed workaround, directly insert elements at a given array position. (gfc_simplify_transpose): Likewise. (gfc_simplify_pack): Replaced usage of ADVANCE macro with corresponding function calls. (gfc_simplify_unpack): Likewise. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * simplify.c (only_convert_cmplx_boz): Renamed to ... (convert_boz): ... this and moved to start of file. (gfc_simplify_abs): Whitespace fix. (gfc_simplify_acos): Whitespace fix. (gfc_simplify_acosh): Whitespace fix. (gfc_simplify_aint): Whitespace fix. (gfc_simplify_dint): Whitespace fix. (gfc_simplify_anint): Whitespace fix. (gfc_simplify_and): Replaced if-gate by more common switch-over-type. (gfc_simplify_dnint): Whitespace fix. (gfc_simplify_asin): Whitespace fix. (gfc_simplify_asinh): Moved creation of result-expr out of switch. (gfc_simplify_atan): Likewise. (gfc_simplify_atanh): Whitespace fix. (gfc_simplify_atan2): Whitespace fix. (gfc_simplify_bessel_j0): Removed ATTRIBUTE_UNUSED. (gfc_simplify_bessel_j1): Likewise. (gfc_simplify_bessel_jn): Likewise. (gfc_simplify_bessel_y0): Likewise. (gfc_simplify_bessel_y1): Likewise. (gfc_simplify_bessel_yn): Likewise. (gfc_simplify_ceiling): Reorderd statements. (simplify_cmplx): Use convert_boz(), check for constant arguments. Whitespace fix. (gfc_simplify_cmplx): Use correct default kind. Removed check for constant arguments. (gfc_simplify_complex): Replaced if-gate. Removed check for constant arguments. (gfc_simplify_conjg): Whitespace fix. (gfc_simplify_cos): Whitespace fix. (gfc_simplify_cosh): Replaced if-gate by more common switch-over-type. (gfc_simplify_dcmplx): Removed check for constant arguments. (gfc_simplify_dble): Use convert_boz() and gfc_convert_constant(). (gfc_simplify_digits): Whitespace fix. (gfc_simplify_dim): Whitespace fix. (gfc_simplify_dprod): Reordered statements. (gfc_simplify_erf): Whitespace fix. (gfc_simplify_erfc): Whitespace fix. (gfc_simplify_epsilon): Whitespace fix. (gfc_simplify_exp): Whitespace fix. (gfc_simplify_exponent): Use convert_boz(). (gfc_simplify_floor): Reorderd statements. (gfc_simplify_gamma): Whitespace fix. (gfc_simplify_huge): Whitespace fix. (gfc_simplify_iand): Whitespace fix. (gfc_simplify_ieor): Whitespace fix. (simplify_intconv): Use gfc_convert_constant(). (gfc_simplify_int): Use simplify_intconv(). (gfc_simplify_int2): Reorderd statements. (gfc_simplify_idint): Reorderd statements. (gfc_simplify_ior): Whitespace fix. (gfc_simplify_ishftc): Removed duplicate type check. (gfc_simplify_len): Use range_check() instead of manual range check. (gfc_simplify_lgamma): Removed ATTRIBUTE_UNUSED. Whitespace fix. (gfc_simplify_log): Whitespace fix. (gfc_simplify_log10): Whitespace fix. (gfc_simplify_minval): Whitespace fix. (gfc_simplify_maxval): Whitespace fix. (gfc_simplify_mod): Whitespace fix. (gfc_simplify_modulo): Whitespace fix. (simplify_nint): Reorderd statements. (gfc_simplify_not): Whitespace fix. (gfc_simplify_or): Replaced if-gate by more common switch-over-type. (gfc_simplify_radix): Removed unused result-variable. Whitespace fix. (gfc_simplify_range): Removed unused result-variable. Whitespace fix. (gfc_simplify_real): Use convert_boz() and gfc_convert_constant(). (gfc_simplify_realpart): Whitespace fix. (gfc_simplify_selected_char_kind): Removed unused result-variable. (gfc_simplify_selected_int_kind): Removed unused result-variable. (gfc_simplify_selected_real_kind): Removed unused result-variable. (gfc_simplify_sign): Whitespace fix. (gfc_simplify_sin): Whitespace fix. (gfc_simplify_sinh): Replaced if-gate by more common switch-over-type. (gfc_simplify_sqrt): Avoided goto by inlining check. Whitespace fix. (gfc_simplify_tan): Replaced if-gate by more common switch-over-type. (gfc_simplify_tanh): Replaced if-gate by more common switch-over-type. (gfc_simplify_xor): Replaced if-gate by more common switch-over-type. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * gfortran.h (gfc_start_constructor): Removed. (gfc_get_array_element): Removed. * array.c (gfc_start_constructor): Removed, use gfc_get_array_expr instead. Fixed all callers. (extract_element): Removed. (gfc_expand_constructor): Temporarily removed check for max-array-constructor. Will be re-introduced later if still required. (gfc_get_array_element): Removed, use gfc_constructor_lookup_expr instead. Fixed all callers. * expr.c (find_array_section): Replaced manual lookup of elements by gfc_constructor_lookup. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * gfortran.h (gfc_get_null_expr): New prototype. (gfc_get_operator_expr): New prototype. (gfc_get_character_expr): New prototype. (gfc_get_iokind_expr): New prototype. * expr.c (gfc_get_null_expr): New. (gfc_get_character_expr): New. (gfc_get_iokind_expr): New. (gfc_get_operator_expr): Moved here from matchexp.c (build_node). * matchexp.c (build_node): Renamed and moved to expr.c (gfc_get_operator_expr). Reordered arguments to match other functions. Fixed all callers. (gfc_get_parentheses): Use specific function to build expr. * array.c (gfc_match_array_constructor): Likewise. * arith.c (eval_intrinsic): Likewise. (gfc_hollerith2int): Likewise. (gfc_hollerith2real): Likewise. (gfc_hollerith2complex): Likewise. (gfc_hollerith2logical): Likewise. * data.c (create_character_intializer): Likewise. * decl.c (gfc_match_null): Likewise. (enum_initializer): Likewise. * io.c (gfc_match_format): Likewise. (match_io): Likewise. * match.c (gfc_match_nullify): Likewise. * primary.c (match_string_constant): Likewise. (match_logical_constant): Likewise. (build_actual_constructor): Likewise. * resolve.c (build_default_init_expr): Likewise. * symbol.c (generate_isocbinding_symbol): Likewise. (gfc_build_class_symbol): Likewise. (gfc_find_derived_vtab): Likewise. * simplify.c (simplify_achar_char): Likewise. (gfc_simplify_adjustl): Likewise. (gfc_simplify_adjustr): Likewise. (gfc_simplify_and): Likewise. (gfc_simplify_bit_size): Likewise. (gfc_simplify_is_iostat_end): Likewise. (gfc_simplify_is_iostat_eor): Likewise. (gfc_simplify_isnan): Likewise. (simplify_bound): Likewise. (gfc_simplify_leadz): Likewise. (gfc_simplify_len_trim): Likewise. (gfc_simplify_logical): Likewise. (gfc_simplify_maxexponent): Likewise. (gfc_simplify_minexponent): Likewise. (gfc_simplify_new_line): Likewise. (gfc_simplify_null): Likewise. (gfc_simplify_or): Likewise. (gfc_simplify_precision): Likewise. (gfc_simplify_repeat): Likewise. (gfc_simplify_scan): Likewise. (gfc_simplify_size): Likewise. (gfc_simplify_trailz): Likewise. (gfc_simplify_trim): Likewise. (gfc_simplify_verify): Likewise. (gfc_simplify_xor): Likewise. * trans-io.c (build_dt): Likewise. (gfc_new_nml_name_expr): Removed. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * arith.h (gfc_constant_result): Removed prototype. * constructor.h (gfc_build_array_expr): Removed prototype. (gfc_build_structure_constructor_expr): Removed prototype. * gfortran.h (gfc_int_expr): Removed prototype. (gfc_logical_expr): Removed prototype. (gfc_get_array_expr): New prototype. (gfc_get_structure_constructor_expr): New prototype. (gfc_get_constant_expr): New prototype. (gfc_get_int_expr): New prototype. (gfc_get_logical_expr): New prototype. * arith.c (gfc_constant_result): Moved and renamed to expr.c (gfc_get_constant_expr). Fixed all callers. * constructor.c (gfc_build_array_expr): Moved and renamed to expr.c (gfc_get_array_expr). Split gfc_typespec argument to type and kind. Fixed all callers. (gfc_build_structure_constructor_expr): Moved and renamed to expr.c (gfc_get_structure_constructor_expr). Split gfc_typespec argument to type and kind. Fixed all callers. * expr.c (gfc_logical_expr): Renamed to ... (gfc_get_logical_expr): ... this. Added kind argument. Fixed all callers. (gfc_int_expr): Renamed to ... (gfc_get_int_expr): ... this. Added kind and where arguments. Fixed all callers. (gfc_get_constant_expr): New. (gfc_get_array_expr): New. (gfc_get_structure_constructor_expr): New. * simplify.c (int_expr_with_kind): Removed, callers use gfc_get_int_expr instead. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * constructor.h: New. * constructor.c: New. * Make-lang.in: Add new files to F95_PARSER_OBJS. * arith.c (reducy_unary): Use constructor API. (reduce_binary_ac): Likewise. (reduce_binary_ca): Likewise. (reduce_binary_aa): Likewise. * check.c (gfc_check_pack): Likewise. (gfc_check_reshape): Likewise. (gfc_check_unpack): Likewise. * decl.c (add_init_expr_to_sym): Likewise. (build_struct): Likewise. * dependency.c (gfc_check_dependency): Likewise. (contains_forall_index_p): Likewise. * dump-parse-tree.c (show_constructor): Likewise. * expr.c (free_expr0): Likewise. (gfc_copy_expr): Likewise. (gfc_is_constant_expr): Likewise. (simplify_constructor): Likewise. (find_array_element): Likewise. (find_component_ref): Likewise. (find_array_section): Likewise. (find_substring_ref): Likewise. (simplify_const_ref): Likewise. (scalarize_intrinsic_call): Likewise. (check_alloc_comp_init): Likewise. (gfc_default_initializer): Likewise. (gfc_traverse_expr): Likewise. * iresolve.c (check_charlen_present): Likewise. (gfc_resolve_reshape): Likewise. (gfc_resolve_transfer): Likewise. * module.c (mio_constructor): Likewise. * primary.c (build_actual_constructor): Likewise. (gfc_match_structure_constructor): Likewise. * resolve.c (resolve_structure_cons): Likewise. * simplify.c (is_constant_array_expr): Likewise. (init_result_expr): Likewise. (transformational_result): Likewise. (simplify_transformation_to_scalar): Likewise. (simplify_transformation_to_array): Likewise. (gfc_simplify_dot_product): Likewise. (simplify_bound): Likewise. (simplify_matmul): Likewise. (simplify_minval_maxval): Likewise. (gfc_simplify_pack): Likewise. (gfc_simplify_reshape): Likewise. (gfc_simplify_shape): Likewise. (gfc_simplify_spread): Likewise. (gfc_simplify_transpose): Likewise. (gfc_simplify_unpack): Likewise.q (gfc_convert_constant): Likewise. (gfc_convert_char_constant): Likewise. * target-memory.c (size_array): Likewise. (encode_array): Likewise. (encode_derived): Likewise. (interpret_array): Likewise. (gfc_interpret_derived): Likewise. (expr_to_char): Likewise. (gfc_merge_initializers): Likewise. * trans-array.c (gfc_get_array_constructor_size): Likewise. (gfc_trans_array_constructor_value): Likewise. (get_array_ctor_strlen): Likewise. (gfc_constant_array_constructor_p): Likewise. (gfc_build_constant_array_constructor): Likewise. (gfc_trans_array_constructor): Likewise. (gfc_conv_array_initializer): Likewise. * trans-decl.c (check_constant_initializer): Likewise. * trans-expr.c (flatten_array_ctors_without_strlen): Likewise. (gfc_apply_interface_mapping_to_cons): Likewise. (gfc_trans_structure_assign): Likewise. (gfc_conv_structure): Likewise. * array.c (check_duplicate_iterator): Likewise. (match_array_list): Likewise. (match_array_cons_element): Likewise. (gfc_match_array_constructor): Likewise. (check_constructor_type): Likewise. (check_constructor): Likewise. (expand): Likewise. (expand_constructor): Likewise. (extract_element): Likewise. (gfc_expanded_ac): Likewise. (resolve_array_list): Likewise. (gfc_resolve_character_array_constructor): Likewise. (copy_iterator): Renamed to ... (gfc_copy_iterator): ... this. (gfc_append_constructor): Removed. (gfc_insert_constructor): Removed unused function. (gfc_get_constructor): Removed. (gfc_free_constructor): Removed. (qgfc_copy_constructor): Removed. * gfortran.h (struct gfc_expr): Removed member 'con_by_offset'. Removed all references. Replaced constructor list by splay-tree. (struct gfc_constructor): Removed member 'next', moved 'offset' from the inner struct, added member 'base'. (gfc_append_constructor): Removed prototype. (gfc_insert_constructor): Removed prototype. (gfc_get_constructor): Removed prototype. (gfc_free_constructor): Removed prototype. (qgfc_copy_constructor): Removed prototype. (gfc_copy_iterator): New prototype. * trans-array.h (gfc_constant_array_constructor_p): Adjusted prototype. From-SVN: r158253
2010-04-01ioparm.def: Update copyright.Paul Thomas1-1/+1
2010-04-01 Paul Thomas <pault@gcc.gnu.org> * ioparm.def : Update copyright. * lang.opt : ditto * trans-array.c : ditto * trans-array.h : ditto * expr.c: ditto * trans-types.c: ditto * dependency.c : ditto * gfortran.h : ditto * options.c : ditto * trans-io.c : ditto * trans-intrinsic.c : ditto * libgfortran.h : ditto * invoke.texi : ditto * intrinsic.texi : ditto * trans.c : ditto * trans.h : ditto * intrinsic.c : ditto * interface.c : ditto * iresolve.c : ditto * trans-stmt.c : ditto * trans-stmt.h : ditto * parse,c : ditto * match.h : ditto * error.c : ditto From-SVN: r157923
2010-02-22re PR fortran/43072 (unneeded temporary (s=s+f(a)))Paul Thomas1-8/+25
2010-02-22 Paul Thomas <pault@gcc.gnu.org> PR fortran/43072 * dependency.c (gfc_full_array_ref_p): Check for contiguous by checking the rest of the dimensions for elements. 2010-02-22 Paul Thomas <pault@gcc.gnu.org> PR fortran/43072 * gfortran.dg/internal_pack_6.f90: Number of 'packs' now zero. * gfortran.dg/internal_pack_9.f90: New test. From-SVN: r156949
2010-02-20re PR fortran/36932 (unneeded temporary (2x))Paul Thomas1-2/+80
2010-02-20 Paul Thomas <pault@gcc.gnu.org> PR fortran/36932 PR fortran/36933 PR fortran/43072 PR fortran/43111 * dependency.c (gfc_check_argument_var_dependency): Use enum value instead of arithmetic vaue for 'elemental'. (check_data_pointer_types): New function. (gfc_check_dependency): Call check_data_pointer_types. * trans-array.h : Change fourth argument of gfc_conv_array_parameter to boolean. * trans-array.c (gfc_conv_array_parameter): A contiguous array can be a dummy but it must not be assumed shape or deferred. Change fourth argument to boolean. Array constructor exprs will always be contiguous and do not need packing and unpacking. * trans-expr.c (gfc_conv_procedure_call): Clean up some white space and change fourth argument of gfc_conv_array_parameter to boolean. (gfc_trans_arrayfunc_assign): Change fourth argument of gfc_conv_array_parameter to boolean. * trans-io.c (gfc_convert_array_to_string): The same. * trans-intrinsic.c (gfc_conv_intrinsic_loc): The same. 2010-02-20 Paul Thomas <pault@gcc.gnu.org> PR fortran/36932 PR fortran/36933 * gfortran.dg/dependency_26.f90: New test. PR fortran/43072 * gfortran.dg/internal_pack_7.f90: New test. PR fortran/43111 * gfortran.dg/internal_pack_8.f90: New test. From-SVN: r156926
2009-07-05re PR fortran/40646 ([F03] array-valued procedure pointer components)Paul Thomas1-1/+8
2009-07-05 Paul Thomas <pault@gcc.gnu.org> and Tobias Burnus <burnus@gcc.gnu.org> PR fortran/40646 * gfortran.h : Change the compcall member of the 'value' union in the gfc_expr structure so that its fields overlap with the 'function' member. * resolve.c (resolve_compcall): Set the function.esym. * trans-expr.c (gfc_trans_arrayfunc_assign): Use is_proc_ptr_comp in the condition. * dependency.c (gfc_full_array_ref_p): Ensure that 'contiguous' retunrs a value if non-NULL. 2009-07-05 Paul Thomas <pault@gcc.gnu.org> and Tobias Burnus <burnus@gcc.gnu.org> PR fortran/40646 * gfortran.dg/func_assign_3.f90 : New test. From-SVN: r149262
2009-06-29re PR fortran/40551 (Optimizations possible using gfc_full_array_ref_p)Paul Thomas1-8/+23
2009-06-29 Paul Thomas <pault@gcc.gnu.org> PR fortran/40551 * dependency.h : Add second bool* argument to prototype of gfc_full_array_ref_p. * dependency.c (gfc_full_array_ref_p): If second argument is present, return true if last dimension of reference is an element or has unity stride. * trans-array.c : Add NULL second argument to references to gfc_full_array_ref_p. * trans-expr.c : The same, except for; (gfc_trans_arrayfunc_assign): Return fail if lhs reference is not a full array or a contiguous section. 2009-06-29 Paul Thomas <pault@gcc.gnu.org> PR fortran/40551 * gfortran.dg/func_assign_2.f90 : New test. From-SVN: r149062
2009-04-06re PR fortran/38863 (WHERE with multiple elemental defined assignments gives ↵Paul Thomas1-0/+72
wrong answer) 2009-04-06 Paul Thomas <pault@gcc.gnu.org> PR fortran/38863 * dependency.c (ref_same_as_full_array): New function. (gfc_dep_resolver): Call it. 2009-04-06 Paul Thomas <pault@gcc.gnu.org> PR fortran/38863 * gfortran.dg/dependency_23.f90: New test. From-SVN: r145621
2009-01-09check.c: Update copyright year.Paul Thomas1-1/+1
2009-01-10 Paul Thomas <pault@gcc.gnu.org> * check.c : Update copyright year. * dependency.c : Update copyright year. * interface.c : ditto. * intrinsic.c : ditto. * intrinsic.h : ditto. * module.c : ditto. * simplify.c : ditto. * symbol.c : ditto. * trans-stmt.c : ditto. * trans-types.c : ditto. From-SVN: r143236
2009-01-04re PR fortran/35681 (wrong result for vector subscripted array expression in ↵Mikael Morin1-16/+18
MVBITS) 2009-01-04 Mikael Morin <mikael.morin@tele2.fr> PR fortran/35681 * ChangeLog-2008: Fix function name. PR fortran/38487 * dependency.c (gfc_check_argument_var_dependency): Move the check for pointerness inside the if block so that it doesn't affect the return value. PR fortran/38669 * trans-stmt.c (gfc_trans_call): Add the dependency code after the loop bounds calculation one. 2009-01-04 Mikael Morin <mikael.morin@tele2.fr> PR fortran/38669 * gfortran.dg/elemental_dependency_3.f90: New test. * gfortran.dg/elemental_subroutine_7.f90: New test. From-SVN: r143057
2009-01-04re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going ↵Mikael Morin1-2/+6
through expr->ref) 2009-01-04 Mikael Morin <mikael.morin@tele2.fr> PR fortran/38536 * gfortran.h (gfc_is_data_pointer): Added prototype * resolve.c (gfc_iso_c_func_interface): Use gfc_is_data_pointer to test for pointer attribute. * dependency.c (gfc_is_data_pointer): Support pointer-returning functions. 2009-01-04 Mikael Morin <mikael.morin@tele2.fr> PR fortran/38536 * gfortran.dg/c_loc_tests_13.f90: New test. * gfortran.dg/c_loc_tests_14.f90: New test. From-SVN: r143050
2008-12-15re PR fortran/38487 (Bogus Warning: INTENT(INOUT) actual argument might ↵Mikael Morin1-12/+22
interfere with actual argument) 2008-12-15 Mikael Morin <mikael.morin@tele2.fr> PR fortran/38487 * gfortran.dg/elemental_dependency_2.f90: New test. 2008-12-15 Mikael Morin <mikael.morin@tele2.fr> PR fortran/38487 * dependency.c (gfc_is_data_pointer): New function. (gfc_check_argument_var_dependency): Disable the warning in the pointer case. (gfc_check_dependency): Use gfc_is_data_pointer. From-SVN: r142766
2008-11-16re PR fortran/35681 (wrong result for vector subscripted array expression in ↵Mikael Morin1-11/+69
MVBITS) 2008-11-16 Mikael Morin <mikael.morin@tele2.fr> PR fortran/35681 * dependency.c (gfc_check_argument_var_dependency): Add elemental check flag. Issue a warning if we find a dependency but don't generate a temporary. Add the case of an elemental function call as actual argument to an elemental procedure. Add the case of an operator expression as actual argument to an elemental procedure. (gfc_check_argument_dependency): Add elemental check flag. Update calls to gfc_check_argument_var_dependency. (gfc_check_fncall_dependency): Add elemental check flag. Update call to gfc_check_argument_dependency. * trans-stmt.c (gfc_trans_call): Make call to gfc_conv_elemental_dependency unconditional, but with a flag whether we should check dependencies between variables. (gfc_conv_elemental_dependency): Add elemental check flag. Update call to gfc_check_fncall_dependency. * trans-expr.c (gfc_trans_arrayfunc_assign): Update call to gfc_check_fncall_dependency. * resolve.c (find_noncopying_intrinsics): Update call to gfc_check_fncall_dependency. * dependency.h (enum gfc_dep_check): New enum. (gfc_check_fncall_dependency): Update prototype. 2008-11-16 Mikael Morin <mikael.morin@tele2.fr> PR fortran/35681 * gfortran.dg/elemental_dependency_1.f90: New test. From-SVN: r141931
2008-10-19re PR fortran/37723 (wrong result for left-right hand side array overlap and ↵Paul Thomas1-0/+8
(possibly) negative strides) 2008-10-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/37723 * dependency.c (gfc_dep_resolver ): If we find equal array element references, go on to the next reference. 2008-10-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/37723 * gfortran.dg/dependency_22.f90: New test. From-SVN: r141221
2008-10-12re PR fortran/37787 (right-left hand side overlap not recognized with ↵Paul Thomas1-1/+7
EQUIVALENCEd array assignment) 2008-10-12 Paul Thomas <pault@gcc.gnu.org> PR fortran/37787 * dependency.c (gfc_are_equivalenced_arrays): Look in symbol namespace rather than current namespace, if it is available. 2008-10-12 Paul Thomas <pault@gcc.gnu.org> PR fortran/37787 * gfortran.dg/module_equivalence_5.f90: New test. From-SVN: r141073
2008-08-23gfortran.h (gfc_component): Add field "symbol_attribute attr"...Janus Weil1-2/+2
2008-08-23 Janus Weil <janus@gcc.gnu.org> * gfortran.h (gfc_component): Add field "symbol_attribute attr", remove fields "pointer", "allocatable", "dimension", "access". Remove functions "gfc_set_component_attr" and "gfc_get_component_attr". * interface.c (gfc_compare_derived_types): Ditto. * trans-array.c (gfc_array_allocate,structure_alloc_comps): Ditto. * trans-expr.c (gfc_conv_component_ref,gfc_trans_subcomponent_assign, gfc_conv_structure): Ditto. * symbol.c (gfc_find_component,free_components,gfc_set_component_attr, gfc_get_component_attr,verify_bind_c_derived_type, generate_isocbinding_symbol): Ditto. * decl.c (build_struct): Ditto. * dump-parse-tree.c (show_components): Ditto. * trans-stmt.c (gfc_trans_deallocate): Ditto. * expr.c (gfc_check_assign,gfc_check_pointer_assign, gfc_default_initializer): Ditto. * module.c (mio_component): Ditto. * trans-types.c (copy_dt_decls_ifequal,gfc_get_derived_type): Ditto. * resolve.c (has_default_initializer,resolve_structure_cons, gfc_iso_c_func_interface,find_array_spec,resolve_ref, resolve_deallocate_expr,resolve_allocate_expr,resolve_fl_derived, resolve_equivalence_derived): Ditto. * trans-io.c (transfer_expr): Ditto. * parse.c (parse_derived): Ditto. * dependency.c (gfc_check_dependency): Ditto. * primary.c (gfc_variable_attr): Ditto. From-SVN: r139524
2008-07-21fmt_g0_3.f08: Fix typo in expected error message.Ralf Wildenhues1-3/+3
gcc/testsuite/ * gfortran.dg/fmt_g0_3.f08: Fix typo in expected error message. gcc/fortran/ * expr.c (gfc_check_pointer_assign): Fix typo in string. * io.c (check_format): Fix typo in string. Fix comment typos. * parse.c (gfc_global_used): Likewise. * resolve.c (resolve_allocate_expr): Likewise. * symbol.c (gfc_set_default_type): Likewise. * arith.c: Fix typos in comments. * array.c: Likewise. * data.c: Likewise. * decl.c: Likewise. * dependency.c: Likewise. * f95-lang.c: Likewise. * gfortran.h: Likewise. * matchexp.c: Likewise. * module.c: Likewise. * primary.c: Likewise. * scanner.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-expr.c: Likewise. * trans-intrinsic.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. * trans.h: Likewise. From-SVN: r138040
2008-07-19gfortran.h (operator): Remove macro.Kaveh R. Ghazi1-11/+11
* gfortran.h (operator): Remove macro. (gfc_namespace, gfc_expr): Avoid C++ keywords. * arith.c (eval_intrinsic, eval_intrinsic_f2, eval_intrinsic_f3): Likewise. * decl.c (access_attr_decl): Likewise. * dependency.c (gfc_dep_compare_expr): Likewise. * dump-parse-tree.c (show_expr, show_uop, show_namespace): Likewise. * expr.c (gfc_copy_expr, gfc_type_convert_binary, simplify_intrinsic_op, check_intrinsic_op): Likewise. * interface.c (fold_unary, gfc_match_generic_spec, gfc_match_interface, gfc_match_end_interface, check_operator_interface, check_uop_interfaces, gfc_check_interfaces, gfc_extend_expr, gfc_extend_assign, gfc_add_interface, gfc_current_interface_head, gfc_set_current_interface_head): Likewise. * iresolve.c (gfc_resolve_dot_product, gfc_resolve_matmul): Likewise. * matchexp.c (gfc_get_parentheses, build_node): Likewise. * module.c (gfc_use_rename, gfc_match_use, find_use_name_n, number_use_names, mio_expr, load_operator_interfaces, read_module, write_operator, write_module): Likewise. * openmp.c (resolve_omp_atomic): Likewise. * resolve.c (resolve_operator, gfc_resolve_character_operator, gfc_resolve_uops): Likewise. * symbol.c (free_uop_tree, gfc_free_namespace): Likewise. * trans-expr.c (gfc_conv_expr_op): Likewise. * trans-openmp.c (gfc_trans_omp_atomic): Likewise. From-SVN: r137981
2008-02-24arith.c: Update copyright years.Tobias Schlüter1-1/+1
* arith.c: Update copyright years. * arith.h: Likewise. * array.c: Likewise. * bbt.c: Likewise. * check.c: Likewise. * data.c: Likewise. * data.h: Likewise. * decl.c: Likewise. * dependency.c: Likewise. * dependency.h: Likewise. * dump-parse-tree.c: Likewise. * error.c: Likewise. * expr.c: Likewise. * gfc-internals.texi: Likewise. * gfortran.h: Likewise. * gfortran.texi: Likewise. * gfortranspec.c: Likewise. * interface.c: Likewise. * intrinsic.c: Likewise. * intrinsic.h: Likewise. * intrinsic.texi: Likewise. * invoke.texi: Likewise. * io.c: Likewise. * iresolve.c: Likewise. * iso-c-binding.def: Likewise. * iso-fortran-env.def: Likewise. * lang-specs.h: Likewise. * lang.opt: Likewise. * libgfortran.h: Likewise. * match.c: Likewise. * match.h: Likewise. * matchexp.c: Likewise. * misc.c: Likewise. * module.c: Likewise. * openmp.c: Likewise. * options.c: Likewise. * parse.c: Likewise. * parse.h: Likewise. * primary.c: Likewise. * resolve.c: Likewise. * scanner.c: Likewise. * simplify.c: Likewise. * st.c: Likewise. * symbol.c: Likewise. * target-memory.c: Likewise. * target-memory.h: Likewise. * trans-array.h: Likewise. * trans-const.h: Likewise. * trans-stmt.h: Likewise. * trans-types.c: Likewise. * trans-types.h: Likewise. * types.def: Likewise. From-SVN: r132600
2007-10-29[multiple changes]Paul Thomas1-4/+4
2007-10-29 Paul Thomas <pault@gcc.gnu.org> PR fortran/31217 PR fortran/33811 PR fortran/33686 * trans-array.c (gfc_conv_loop_setup): Send a complete type to gfc_trans_create_temp_array if the temporary is character. * trans-stmt.c (gfc_trans_assign_need_temp): Do likewise for allocate_temp_for_forall_nest. (forall_replace): New function. (forall_replace_symtree): New function. (forall_restore): New function. (forall_restore_symtree): New function. (forall_make_variable_temp): New function. (check_forall_dependencies): New function. (cleanup_forall_symtrees): New function. gfc_trans_forall_1): Add and initialize pre and post blocks. Call check_forall_dependencies to check for all dependencies and either trigger second forall block to copy temporary or copy lval, outside the forall construct and replace all dependent references. After assignment clean-up and coalesce the blocks at the end of the function. * gfortran.h : Add prototypes for gfc_traverse_expr and find_forall_index. expr.c (gfc_traverse_expr): New function to traverse expression and visit all subexpressions, under control of a logical flag, a symbol and an integer pointer. The slave function is caller defined and is only called on EXPR_VARIABLE. (expr_set_symbols_referenced): Called by above to set symbols referenced. (gfc_expr_set_symbols_referenced): Rework of this function to use two new functions above. * resolve.c (find_forall_index): Rework with gfc_traverse_expr, using forall_index. (forall_index): New function used by previous. * dependency.c (gfc_check_dependency): Use gfc_dep_resolver for all references, not just REF_ARRAY. (gfc_dep_resolver): Correct the logic for substrings so that overlapping arrays are handled correctly. 2007-10-29 Paul Thomas <pault@gcc.gnu.org> PR fortran/31217 PR fortran/33811 * gfortran.dg/forall_12.f90: New test. PR fortran/33686 * gfortran.dg/forall_13.f90: New test. From-SVN: r129720
2007-08-01arith.c: Change copyright header to refer to version 3 of the GNU General ↵Nick Clifton1-4/+3
Public... * arith.c: Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page. * openmp.c, interface.c, intrinsic.c, trans-array.c, trans-expr.c, symbol.c, iso-fortran-env.def, intrinsic.h, decl.c, trans-array.h, matchexp.c, dump-parse-tree.c, trans-common.c, array.c, Make-lang.in, trans-openmp.c, gfortran.h, error.c, iso-c-binding.def, lang.opt, data.c, trans-const.c, trans-stmt.c, expr.c, trans-const.h, trans-stmt.h, module.c, trans.c, scanner.c, trans-types.c, trans.h, gfortranspec.c, trans-types.h, lang-specs.h, io.c, bbt.c, resolve.c, f95-lang.c, st.c, iresolve.c, match.c, trans-decl.c, trans-io.c, target-memory.c, match.h, target-memory.h, parse.c, arith.h, check.c, dependency.c, parse.h, types.def, convert.c, dependency.h, primary.c, trans-intrinsic.c, options.c, misc.c, simplify.c: Likewise. From-SVN: r127129
2007-05-29gfortran.h: Renamed 'enum gfc_generic_isym_id' to 'enum gfc_isym_id'...Daniel Franke1-2/+2
2007-05-29 Daniel Franke <franke.daniel@gmail.com> * gfortran.h: Renamed 'enum gfc_generic_isym_id' to 'enum gfc_isym_id', added missing GFC_ISYM_* enumerators, ordered alphabetically. (struct gfc_intrinsic_sym): Renamed 'generic_id' to 'id'. (gfc_find_subroutine): New prototype. * intrinsic.c (add_sym, add_sym_*): Added argument 'id' and changed all callers. (find_subroutine): Renamed to 'gfc_find_subroutine', removed static. * dependency.c: Changed usage of isym->generic_id to isym->id. * openmp.c: Likewise. * resolve.c: Likewise. * trans-array.c: Likewise. * trans-expr.c: Likewise. * trans-intrinsic.c: Likewise. * trans-openmp.c: Likewise. From-SVN: r125168
2007-05-01re PR fortran/31732 (Assignment to array slice affects whole array)Thomas Koenig1-0/+18
2007-05-01 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/31732 * dependency.c (gfc_full_array_ref_p): If the reference is to a single element, check that the array has a single element and that the correct element is referenced. 2007-05-01 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/31732 * gfortran.dg/array_memset_2: New test case. From-SVN: r124326
2007-02-02dependency.c (gfc_check_dependency): Implement dependency checking for array ↵Roger Sayle1-3/+15
constructors. * dependency.c (gfc_check_dependency) <EXPR_ARRAY>: Implement dependency checking for array constructors. * gfortran.dg/dependency_20.f90: New test case. From-SVN: r121490
2007-01-20dependency.c (gfc_full_array_ref_p): Check that ref->next is NULL, i.e.Roger Sayle1-0/+2
* dependency.c (gfc_full_array_ref_p): Check that ref->next is NULL, i.e. that the ARRAY_REF doesn't mention components. * trans-array.c (gfc_constant_array_constructor_p): Export external function renamed from constant_array_constructor_p. (gfc_build_constant_array_constructor): Export. (gfc_trans_array_constructor): Update call to the renamed function constant_array_constructor_p. * trans-array.h (gfc_constant_array_constructor_p): Prototype here. (gfc_build_constant_array_constructor): Likewise. * trans-expr.c (gfc_build_memcpy_call): New helper function split out from gfc_trans_array_copy. (gfc_trans_array_copy): Use gfc_build_memcpy_call. (gfc_trans_array_constructor_copy): New function to optimize assigning an entire array from a constant array constructor. (gfc_trans_assignment): Call gfc_trans_array_constructor_copy when appropriate. * gfortran.dg/array_memcpy_3.f90: New test case. * gfortran.dg/vect/vect-5.f90: Update vectorized loop count. From-SVN: r121010
2007-01-07decl.c, [...]: Update Copyright dates.Steven G. Kargl1-59/+43
2007-01-07 Steven G. Kargl <kargl@gcc.gnu.org> * decl.c, dump-parse-tree.c, error.c, data.c, expr.c, dependency.c, convert.c: Update Copyright dates. Fix whitespace. From-SVN: r120552
2006-12-21re PR fortran/30273 ([4.1 only] gfc_todo: Not Implemented: Unable to ↵Paul Thomas1-0/+1
determine rank of expression) 2006-12-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/30273 * dependency.c (gfc_check_dependency): There is no dependency with EXPR_NULL so always return 0. 2006-12-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/30273 * gfortran.dg/dependency_19.f90: New test. From-SVN: r120117
2006-12-17re PR fortran/30207 (ICE in gfc_dep_resolver with where (a < 0) a(:) = 1)Roger Sayle1-0/+53
2006-12-17 Roger Sayle <roger@eyesopen.com> Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/30207 * dependency.c (gfc_full_array_ref_p): New function to test whether the given array ref specifies the entire array. (gfc_dep_resolver): Use gfc_full_array_ref_p to analyze AR_FULL array refs against AR_SECTION array refs, and vice versa. * dependency.h (gfc_full_array_ref_p): Prototype here. * trans-array.c (gfc_conv_expr_descriptor): Use gfc_full_array_ref_p. * gfortran.fortran-torture/execute/where21.f90: New test. From-SVN: r119990