aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/dependency.c
AgeCommit message (Collapse)AuthorFilesLines
2015-01-05re PR fortran/47674 (gfortran.dg/realloc_on_assign_5.f03: Segfault at run ↵Thomas Koenig1-24/+24
time for deferred (allocatable) string length) 2015-01-05 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/47674 * dependency.c: Update copyright years. (gfc_discard_nops): Add prototype. * dependency.c (discard_nops): Rename to gfc_discard_nops, make non-static. (gfc_discard_nops): Use gfc_discard_nops. (gfc_dep_difference): Likewise. * frontend-passes.c Update copyright years. (realloc_strings): New function. Add prototype. (gfc_run_passes): Call realloc_strings. (realloc_string_callback): New function. (create_var): Add prototype. Handle case of a scalar character variable. (optimize_trim): Do not handle allocatable variables. 2015-01-05 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/47674 * gfortran.dg/realloc_on_assign_25.f90: New test. From-SVN: r219193
2015-01-05Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r219188
2014-12-03re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, ↵Manuel López-Ibáñez1-1/+1
!GCC$ diagnostic (pragmas) and color) gcc/testsuite/ChangeLog: 2014-12-03 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * gfortran.dg/warnings_are_errors_1.f90: Update warnings to errors. * gfortran.dg/warnings_are_errors_1.f: Likewise. gcc/fortran/ChangeLog: 2014-12-03 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * gfortran.h (gfc_warning): Now returns bool. Add overload that accepts opt. (gfc_warning_1): Declare. * error.c (pp_warning_buffer,warningcount_buffered,werrorcount_buffered): New. (gfc_buffer_error): Set pp_warning_buffer.flush_p. (gfc_clear_pp_buffer): New. (gfc_warning_1): Renamed from gfc_warning. (gfc_warning): Add three new overloads. One that takes just a format string and ellipsis, another that takes also a warning option, and another that takes also va_list instead of ellipsis. (gfc_clear_warning): Clear pp_warning_buffer. (gfc_warning_check): Flush pp_warning_buffer and update warning and werror counters. (gfc_diagnostics_init): Init pp_warning_buffer. * Update all gfc_warning calls that do not multiple locations to use %qs and OPT_W*, otherwise use gfc_warning_1. gcc/ChangeLog: 2014-12-03 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * pretty-print.c (output_buffer::output_buffer): Init flush_p to true. (pp_flush): Flush only if flush_p. (pp_really_flush): New. * pretty-print.h (struct output_buffer): Add flush_p. (pp_really_flush): Declare. From-SVN: r218326
2014-09-20trans-expr.c (gfc_reset_vptr): Fix comment whitespace.Joost VandeVondele1-2/+2
2014-09-20 Joost VandeVondele <vondele@gcc.gnu.org> * trans-expr.c (gfc_reset_vptr): Fix comment whitespace. (gfc_conv_class_to_class): Likewise. (gfc_conv_procedure_call): Likewise. (arrayfunc_assign_needs_temporary): Likewise. (realloc_lhs_loop_for_fcn_call): Likewise. (gfc_trans_assignment_1): Likewise. * trans-array.c (gfc_conv_array_ref): Likewise. (gfc_array_allocate): Likewise. (gfc_alloc_allocatable_for_assignment): Likewise. * symbol.c (generate_isocbinding_symbol): Likewise. * class.c (finalization_scalarizer): Likewise. (finalizer_insert_packed_call): Likewise. (generate_finalization_wrapper): Likewise. (find_intrinsic_vtab): Likewise. * decl.c (gfc_match_import): Likewise. (match_procedure_decl): Likewise. (gfc_match_subroutine): Likewise. (gfc_match_bind_c): Likewise. (gfc_match_volatile): Likewise. * trans-common.c (create_common): Likewise. * error.c (gfc_diagnostic_starter): Likewise. * trans-stmt.c (gfc_trans_sync): Likewise. (gfc_trans_critical): Likewise. (gfc_trans_simple_do): Likewise. (gfc_trans_do): Likewise. (gfc_trans_where_assign): Likewise. * expr.c (gfc_is_simply_contiguous): Likewise. * module.c (unquote_string): Likewise. * trans.c (gfc_add_finalizer_call): Likewise. * trans-types.c (gfc_init_kinds): Likewise. * scanner.c (preprocessor_line): Likewise. * gfortranspec.c (lang_specific_driver): Likewise. * frontend-passes.c (create_var): Likewise. (cfe_expr_0): Likewise. * resolve.c (check_host_association): Likewise. (gfc_resolve_code): Likewise. (resolve_fl_derived0): Likewise. (resolve_symbol): Likewise. * f95-lang.c (poplevel): Likewise. * trans-decl.c (create_main_function): Likewise. * trans-io.c (transfer_expr): Likewise. * arith.c (gfc_arith_divide): Likewise. * parse.c (resolve_all_program_units): Likewise. * check.c (gfc_check_rank): Likewise. (gfc_check_sizeof): Likewise. (is_c_interoperable): Likewise. * dependency.c (gfc_dep_difference): Likewise. * primary.c (gfc_match_rvalue): Likewise. * trans-intrinsic.c (conv_intrinsic_system_clock): Likewise. (conv_isocbinding_subroutine): Likewise. * options.c (gfc_post_options): Likewise. (gfc_handle_fpe_option): Likewise. (gfc_get_option_string): Likewise. * simplify.c (simplify_transformation_to_scalar): Likewise. (gfc_simplify_spread): Likewise. From-SVN: r215420
2014-08-30re PR fortran/62278 (gfc_check_dependency should also check for TARGET ↵Tobias Burnus1-3/+8
attribute) 2014-08-30 Tobias Burnus <burnus@net-b.de> PR fortran/62278 PR fortran/44735 PR fortran/60593 * dependency.c (gfc_check_dependency): Allow for optimizations in the pointer-alias check. From-SVN: r214757
2014-07-12re PR fortran/61780 (Wrong code when shifting elements of a multidimensional ↵Paul Thomas1-43/+52
array) 2014-07-12 Paul Thomas <pault@gcc.gnu.org> PR fortran/61780 * dependency.c (gfc_dep_resolver): Index the 'reverse' array so that elements are skipped. This then correctly aligns 'reverse' with the scalarizer loops. 2014-07-12 Paul Thomas <pault@gcc.gnu.org> PR fortran/61780 * gfortran.dg/dependency_44.f90 : New test From-SVN: r212486
2014-01-02Update copyright years in gcc/Richard Sandiford1-1/+1
From-SVN: r206289
2013-08-25re PR fortran/58146 (Array slice bounds checking)Thomas Koenig1-63/+42
2013-08-26 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/58146 * array.c (gfc_ref_dimen_size): If possible, use gfc_dep_difference to calculate array refrence sizes. Fall back to integer code otherwise. * dependency.c (discard_nops). Move up. Also discarde widening integer conversions. (gfc_dep_compare_expr): Use discard_nops. 2013-08-26 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/58146 * gfortran.dg/bounds_check_18.f90: New test. From-SVN: r201981
2013-07-21re PR fortran/56937 (Unnecessarily temporary with array-vector assignments)Thomas Koenig1-3/+17
2013-07-21 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/56937 * dependency.c (gfc_dep_resolver): Treat identical array subscripts as identical; don't unconditionally return a dependency if an array subscript is found. 2013-07-21 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/56937 * gfortran.dg/dependency_42.f90: New test. * gfortran.dg/dependency_43.f90: New test. From-SVN: r201094
2013-06-15re PR fortran/49074 ([OOP] Defined assignment w/ CLASS arrays: Incomplete ↵Mikael Morin1-1/+3
error message) fortran/ PR fortran/49074 PR fortran/56136 * dependency.c (gfc_check_argument_var_dependency): Return 0 in the array constructor case. testsuite/ PR fortran/49074 PR fortran/56136 * gfortran.dg/typebound_assignment_5.f03: Check the absence of any packing. * gfortran.dg/typebound_assignment_6.f03: New. From-SVN: r200128
2013-04-15class.c (gfc_find_intrinsic_vtab): Removed unused var.Tobias Burnus1-1/+1
2013-04-15 Tobias Burnus <burnus@net-b.de> * class.c (gfc_find_intrinsic_vtab): Removed unused var. * dependency.c (check_data_pointer_types): Fix check. * frontend-passes.c (check_data_pointer_types): Remove superfluous statement. * parse.c (decode_omp_directive): Add missing break. * resolve.c (resolve_typebound_subroutine: Free variable. * trans-decl.c (create_function_arglist): Correct condition. From-SVN: r197961
2013-04-11Replace enum gfc_try with bool type.Janne Blomqvist1-2/+2
2013-04-11 Janne Blomqvist <jb@gcc.gnu.org> * gfortran.h: Remove enum gfc_try, replace gfc_try with bool type. * arith.c: Replace gfc_try with bool type. * array.c: Likewise. * check.c: Likewise. * class.c: Likewise. * cpp.c: Likewise. * cpp.h: Likewise. * data.c: Likewise. * data.h: Likewise. * decl.c: Likewise. * error.c: Likewise. * expr.c: Likewise. * f95-lang.c: Likewise. * interface.c: Likewise. * intrinsic.c: Likewise. * intrinsic.h: Likewise. * io.c: Likewise. * match.c: Likewise. * match.h: Likewise. * module.c: Likewise. * openmp.c: Likewise. * parse.c: Likewise. * parse.h: Likewise. * primary.c: Likewise. * resolve.c: Likewise. * scanner.c: Likewise. * simplify.c: Likewise. * symbol.c: Likewise. * trans-intrinsic.c: Likewise. * trans-openmp.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. From-SVN: r197682
2013-03-28re PR fortran/45159 (Unnecessary temporaries)Thomas Koenig1-7/+270
2013-03-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * gfortran.h (gfc_dep_difference): Add prototype. * dependency.c (discard_nops): New function. (gfc_dep_difference): New function. (check_section_vs_section): Use gfc_dep_difference to calculate the difference of starting indices. * trans-expr.c (gfc_conv_substring): Use gfc_dep_difference to calculate the length of substrings where possible. 2013-03-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45159 * gfortran.dg/string_length_2.f90: New test. * gfortran.dg/dependency_41.f90: New test. From-SVN: r197217
2013-01-29re PR fortran/54107 ([F03] Memory hog with abstract interface)Janus Weil1-1/+1
2013-01-29 Janus Weil <janus@gcc.gnu.org> Mikael Morin <mikael@gcc.gnu.org> PR fortran/54107 * gfortran.h (gfc_component): Delete members 'formal' and 'formal_ns'. (gfc_copy_formal_args,gfc_copy_formal_args_ppc,gfc_expr_replace_symbols, gfc_expr_replace_comp): Delete. (gfc_sym_get_dummy_args): New prototype. * dependency.c (gfc_check_fncall_dependency): Use 'gfc_sym_get_dummy_args'. * expr.c (gfc_is_constant_expr): Ditto. (replace_symbol,gfc_expr_replace_symbols,replace_comp, gfc_expr_replace_comp): Deleted. * frontend-passes.c (doloop_code,do_function): Use 'gfc_sym_get_dummy_args'. * interface.c (gfc_check_operator_interface,gfc_compare_interfaces, gfc_procedure_use,gfc_ppc_use,gfc_arglist_matches_symbol, gfc_check_typebound_override): Ditto. * module.c (MOD_VERSION): Bump module version. (mio_component): Do not read/write 'formal' and 'formal_ns'. * resolve.c (resolve_procedure_interface,resolve_fl_derived0): Do not copy formal args, but just keep a pointer to the interface. (resolve_function,resolve_call,resolve_typebound_generic_call, resolve_ppc_call,resolve_expr_ppc,generate_component_assignments, resolve_fl_procedure,gfc_resolve_finalizers,check_generic_tbp_ambiguity, resolve_typebound_procedure,check_uop_procedure): Use 'gfc_sym_get_dummy_args'. * symbol.c (free_components): Do not free 'formal' and 'formal_ns'. (gfc_copy_formal_args,gfc_copy_formal_args_ppc): Deleted. (gfc_sym_get_dummy_args): New function. * trans-array.c (get_array_charlen,gfc_walk_elemental_function_args): Use 'gfc_sym_get_dummy_args'. * trans-decl.c (build_function_decl,create_function_arglist, build_entry_thunks,init_intent_out_dt,gfc_trans_deferred_vars, add_argument_checking): Ditto. * trans-expr.c (gfc_map_fcn_formal_to_actual,gfc_conv_procedure_call, gfc_conv_statement_function): Ditto. * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto. * trans-types.c (create_fn_spec,gfc_get_function_type): Ditto. 2013-01-29 Janus Weil <janus@gcc.gnu.org> Mikael Morin <mikael@gcc.gnu.org> PR fortran/54107 * gfortran.dg/proc_ptr_comp_36.f90: New. Co-Authored-By: Mikael Morin <mikael@gcc.gnu.org> From-SVN: r195562
2013-01-10Update copyright years in gcc/Richard Sandiford1-2/+1
From-SVN: r195098
2013-01-04Update Copyright years for files modified in 2011 and/or 2012.Jakub Jelinek1-2/+2
From-SVN: r194903
2012-09-22re PR fortran/54599 (Issues found in gfortran by the Coverity Scan)Thomas Koenig1-21/+12
2012-09-22 Thomas König <tkoenig@gcc.gnu.org> PR fortran/54599 * dependency.c (gfc_dep_compare_expr): Clarify logic, remove dead code. From-SVN: r191640
2012-08-27re PR fortran/54384 (gfortran memory leaks)Tobias Burnus1-1/+1
2012-08-27 Tobias Burnus <burnus@net-b.de> PR fortran/54384 * dependency.c (check_section_vs_section): Use gfc_free_expr instead of free. * trans-intrinsic.c (conv_generic_with_optional_char_arg): Use gfc_free_symbol instead of free. From-SVN: r190728
2012-07-31re PR fortran/54134 ([OOP] ICE overriding derived type bound function with ↵Janus Weil1-0/+3
allocatable character as result) 2012-07-31 Janus Weil <janus@gcc.gnu.org> PR fortran/54134 * dependency.c (gfc_dep_compare_expr): Check if arguments are NULL. 2012-07-31 Janus Weil <janus@gcc.gnu.org> PR fortran/54134 * gfortran.dg/typebound_override_3.f90: New. From-SVN: r190010
2012-07-08gfortran.h: Do not include coretypes.h here.Steven Bosscher1-0/+1
* gfortran.h: Do not include coretypes.h here. Make it an error to include this before coretypes.h * openmp.c: Include coretypes.h. * interface.c: Likewise. * intrinsic.c: Likewise. * symbol.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * matchexp.c: Likewise. * dump-parse-tree.c: Likewise. * array.c: Likewise. * constructor.c: Likewise. * error.c: Likewise. * data.c: Likewise. * expr.c: Likewise. * module.c: Likewise. * scanner.c: Likewise. * bbt.c: Likewise. * io.c: Likewise. * frontend-passes.c: Likewise. * resolve.c: Likewise. * st.c: Likewise. * target-memory.c: Likewise. * match.c: Likewise. * arith.c: Likewise. * parse.c: Likewise. * check.c: Likewise. * dependency.c: Likewise. * primary.c: Likewise. * misc.c: Likewise. * simplify.c: Likewise. From-SVN: r189357
2011-12-29dependency.c (gfc_dep_compare_functions): Document new behavior for REALs ↵Thomas Koenig1-6/+33
and complex. 2011-12-29 Thomas Koenig <tkoenig@gcc.gnu.org> * dependency.c (gfc_dep_compare_functions): Document new behavior for REALs and complex. Add comment to cases where only INTEGERs are handled. Compare REAL and COMPLEX constants, returning 0 and -2 only. Add assert to make sure that only integer constants are compared. 2011-12-29 Thomas Koenig <tkoenig@gcc.gnu.org> * gfortran.dg/function_optimize_9.f90: New test. From-SVN: r182720
2011-12-05re PR fortran/51338 (seg fault in gfc_dep_compare_expr with -O2)Thomas Koenig1-2/+12
2011-12-05 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/51338 * dependency.c (are_identical_variables): Handle case where end fields of substring references are NULL. 2011-12-05 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/51338 * gfortran.dg/assumed_charlen_substring_1.f90: New test. From-SVN: r182024
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