aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-19re PR fortran/49708 (ICE with allocate and no dimensions)Janus Weil1-1/+1
2011-07-19 Janus Weil <janus@gcc.gnu.org> PR fortran/49708 * resolve.c (resolve_allocate_expr): Fix diagnostics for pointers. 2011-07-19 Janus Weil <janus@gcc.gnu.org> PR fortran/49708 * gfortran.dg/allocate_error_3.f90: New. From-SVN: r176447
2011-07-18resolve.c (resolve_transfer): Mention defined I/O in the diagnostic for ↵Tobias Burnus1-5/+7
alloc_comp/pointer_comp. 2011-07-18 Tobias Burnus <burnus@net-b.de> * resolve.c (resolve_transfer): Mention defined I/O in the diagnostic for alloc_comp/pointer_comp. From-SVN: r176386
2011-07-16expr.c (gfc_ref_this_image): New function.Tobias Burnus1-8/+3
2011-07-16 Tobias Burnus <burnus@net-b.de> * expr.c (gfc_ref_this_image): New function. (gfc_is_coindexed): Use it. * gfortran.h (gfc_ref_this_image): New prototype. * resolve.c (resolve_deallocate_expr, resolve_allocate_expr): Support alloc scalar coarrays. * trans-array.c (gfc_conv_array_ref, gfc_array_init_size, gfc_conv_descriptor_cosize, gfc_array_allocate, gfc_trans_deferred_array): Ditto. * trans-expr.c (gfc_conv_variable) Ditto.: * trans-stmt.c (gfc_trans_deallocate): Ditto. * trans-types.c (gfc_get_element_type, gfc_get_array_type_bounds gfc_get_array_descr_info): Ditto. * trans-decl.c (gfc_get_symbol_decl): Ditto. 2011-07-16 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_14.f90: Remove dg-error "sorry not * implemented". * gfortran.dg/coarray_7.f90: Ditto. * gfortran.dg/coarray/scalar_alloc_1.f90: New. * gfortran.dg/coarray/scalar_alloc_2.f90: New. From-SVN: r176358
2011-07-07re PR fortran/49648 (ICE(segfault) with MATMUL and function-result actual ↵Mikael Morin1-0/+2
argument) 2011-07-07 Mikael Morin <mikael.morin@sfr.fr> PR fortran/49648 * resolve.c (resolve_symbol): Force resolution of function result's array specification. From-SVN: r176011
2011-06-30re PR fortran/49540 (Memory-hog with large DATA stmt)Jakub Jelinek1-3/+4
PR fortran/49540 * gfortran.h (gfc_constructor): Add repeat field. * trans-array.c (gfc_conv_array_initializer): Handle repeat > 1. * array.c (current_expand): Add repeat field. (expand_constructor): Copy repeat. * constructor.c (node_free, node_copy, gfc_constructor_get, gfc_constructor_lookup): Handle repeat field. (gfc_constructor_lookup_next, gfc_constructor_remove): New functions. * data.h (gfc_assign_data_value): Add mpz_t * argument. (gfc_assign_data_value_range): Removed. * constructor.h (gfc_constructor_advance): Removed. (gfc_constructor_lookup_next, gfc_constructor_remove): New prototypes. * data.c (gfc_assign_data_value): Add REPEAT argument, handle it and also handle overwriting a range with a single entry. (gfc_assign_data_value_range): Removed. * resolve.c (check_data_variable): Adjust gfc_assign_data_value call. Use gfc_assign_data_value instead of gfc_assign_data_value_expr. * gfortran.dg/pr49540-1.f90: New test. * gfortran.dg/pr49540-2.f90: New test. From-SVN: r175693
2011-06-20re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-19/+73
2011-06-20 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.h (gfc_check_vardef_context): Update prototype. (iso_fortran_env_symbol): Handle derived types. (symbol_attribute): Add lock_comp. * expr.c (gfc_check_vardef_context): Add LOCK_TYPE check. * interface.c (compare_parameter, gfc_procedure_use): Handle LOCK_TYPE. (compare_actual_formal): Update gfc_check_vardef_context call. * check.c (gfc_check_atomic_def, gfc_check_atomic_ref): Ditto. * intrinsic.c (check_arglist): Ditto. * io.c (resolve_tag, gfc_resolve_dt, gfc_resolve_inquire): * Ditto. * iso-fortran-env.def (ISOFORTRAN_LOCK_TYPE): Add. * intrinsic.texi (ISO_FORTRAN_ENV): Document LOCK_TYPE. * module.c (mio_symbol_attribute): Handle lock_comp. (create_derived_type): New function. (use_iso_fortran_env_module): Call it to handle LOCK_TYPE. * parse.c (parse_derived): Add constraint check for LOCK_TYPE. * resolve.c (resolve_symbol, resolve_lock_unlock): Add * constraint checks for LOCK_TYPE. (gfc_resolve_iterator, resolve_deallocate_expr, resolve_allocate_expr, resolve_code, resolve_transfer): Update gfc_check_vardef_context call. * trans-stmt.h (gfc_trans_lock_unlock): New prototype. * trans-stmt.c (gfc_trans_lock_unlock): New function. * trans.c (trans_code): Handle LOCK and UNLOCK. 2011-06-20 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_lock_1.f90: Update dg-error. * gfortran.dg/coarray_lock_3.f90: New. * gfortran.dg/coarray/lock_1.f90: New. From-SVN: r175228
2011-06-16re PR fortran/49417 ([OOP] ICE on invalid CLASS component declaration)Janus Weil1-4/+6
2011-06-16 Janus Weil <janus@gcc.gnu.org> PR fortran/49417 * module.c (mio_component): Make sure the 'class_ok' attribute is set for use-associated CLASS components. * parse.c (parse_derived): Check for 'class_ok' attribute. * resolve.c (resolve_fl_derived): Ditto. 2011-06-16 Janus Weil <janus@gcc.gnu.org> PR fortran/49417 * gfortran.dg/class_43.f03: New. From-SVN: r175101
2011-06-08re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-0/+39
2011-06-08 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.h (gfc_statement): Add ST_LOCK and ST_UNLOCK. (gfc_exec_op): Add EXEC_LOCK and EXEC_UNLOCK. (gfc_code): Add expr4. * match.h (gfc_match_lock, gfc_match_unlock): New prototypes. * match.c (gfc_match_lock, gfc_match_unlock, lock_unlock_statement): New functions. (sync_statement): Bug fix, avoiding double freeing. (gfc_match_if): Handle LOCK/UNLOCK statement. * parse.c (decode_statement, next_statement, gfc_ascii_statement): Ditto. * st.c (gfc_free_statement): Handle LOCK and UNLOCK. * resolve.c (resolve_lock_unlock): New function. (resolve_code): Call it. * dump-parse-tree.c (show_code_node): Handle LOCK/UNLOCK. * frontend-passes.c (gfc_code_walker): Optimize gfc_code's expr4. 2011-06-08 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_lock_1.f90: New. * gfortran.dg/coarray_lock_2.f90: New. From-SVN: r174796
2011-05-31re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-1/+9
2011-05-31 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * resolve.c (resolve_fl_variable): Handle static coarrays with non-constant cobounds. (resolve_symbol): Handle SAVE statement without arguments for coarrays. * trans-array.c (gfc_trans_array_cobounds): New function. (gfc_trans_array_bounds): Place code by call to it. * trans-array.h (gfc_trans_array_cobounds): New prototype. * trans-decl.c (gfc_get_symbol_decl, gfc_trans_deferred_vars): Handle static coarrays with nonconstant cobounds. 2011-05-31 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray/save_1.f90: New. * gfortran.dg/coarray_4.f90: Update dg-error. From-SVN: r174503
2011-05-27re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-0/+7
2011-05-27 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * check.c (gfc_check_associated, gfc_check_null): Add coindexed * check. * match.c (gfc_match_nullify): Ditto. * resolve.c (resolve_deallocate_expr): Ditto. * trans-types.c (gfc_get_nodesc_array_type): Don't set * restricted for nonpointers. 2011-05-27 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_22.f90: New. From-SVN: r174364
2011-05-12re PR fortran/48972 (OPEN with Unicode file name)Tobias Burnus1-0/+4
2011-05-12 Tobias Burnus <burnus@net-b.de> PR fortran/48972 * resolve.c (resolve_intrinsic): Don't resolve module intrinsics multiple times. 2011-05-12 Tobias Burnus <burnus@net-b.de> PR fortran/48972 * gfortran.dg/iso_c_binding_compiler_3.f90: New. From-SVN: r173708
2011-04-29re PR fortran/48810 ([OOP] TPB rejected because module procedure is private)Tobias Burnus1-3/+8
2011-04-29 Tobias Burnus <burnus@net-b.de> PR fortran/48810 * resolve.c (resolve_typebound_generic_call): Don't check access flags of the specific function. PR fortran/48800 * resolve.c (resolve_formal_arglist): Don't change AS_DEFERRED to AS_ASSUMED_SHAPE for function results. (resolve_fl_var_and_proc): Print also for function results with AS_DEFERRED an error, if they are not a pointer or allocatable. (resolve_types): Make sure arguments of procedures in interface blocks are resolved. 2011-04-29 Tobias Burnus <burnus@net-b.de> PR fortran/48810 * gfortran.dg/typebound_proc_22.f90: New. PR fortran/48800 * gfortran.dg/interface_36.f90: New. From-SVN: r173175
2011-04-28re PR fortran/48112 (generic interface to external function in module)Tobias Burnus1-5/+5
2011-04-28 Tobias Burnus <burnus@net-b.de> PR fortran/48112 * resolve.c (resolve_fl_var_and_proc): Print diagnostic of function results only once. (resolve_symbol): Always resolve function results. PR fortran/48279 * expr.c (gfc_check_vardef_context): Fix handling of generic EXPR_FUNCTION. * interface.c (check_interface0): Reject internal functions in generic interfaces, unless -std=gnu. 2011-04-28 Tobias Burnus <burnus@net-b.de> PR fortran/48112 PR fortran/48279 * gfortran.dg/interface_35.f90: New. * gfortran.dg/erfc_scaled_1.f90: Don't compile with -pedantic. * gfortran.dg/func_result_6.f90: Add dg-warning. * gfortran.dg/bessel_1.f90: Ditto. * gfortran.dg/hypot_1.f90: Ditto. * gfortran.dg/proc_ptr_comp_20.f90: Ditto. * gfortran.dg/proc_ptr_comp_21.f90: Ditto. * gfortran.dg/interface_assignment_4.f90: Ditto. From-SVN: r173059
2011-04-27re PR fortran/48788 (ICE: SIGSEGV in resolve_global_procedure ↵Tobias Burnus1-1/+1
(resolve.c:2190) on invalid (?) fortran code) 2011-04-27 Tobias Burnus <burnus@net-b.de> PR fortran/48788 * resolve.c (resolve_global_procedure): Error recovery - avoid segfault for (non)character-returning functions. 2011-04-27 Tobias Burnus <burnus@net-b.de> PR fortran/48788 * gfortran.dg/whole_file_34.f90: New. From-SVN: r173048
2011-04-23re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-1/+16
2011-04-23 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * module.c (mio_array_spec): Set as->cotype on reading. * resolve.c (resolve_allocate_expr): Fix allocating coarray components. 2011-04-23 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_19.f90: New. From-SVN: r172897
2011-04-19Replace gfc_getmem with XCNEW, XCNEWVEC or xcallocJanne Blomqvist1-1/+1
From-SVN: r172728
2011-04-18convert each use of gfc_free (p) to free (p)Jim Meyering1-4/+4
Do that by running this command: perl -pi -e 's/\bgfc_free ?\(/free (/' \ $(git grep -El '\bgfc_free ?\(') which also corrects the few uses that lacked a space between the function name and the open parenthesis. Manually undo the change to the function definition itself and its prototype. They'll be removed next. * array.c (gfc_free_array_spec, gfc_set_array_spec): s/gfc_free/free/ * constructor.c (node_free): Likewise. * cpp.c (dump_queued_macros): Likewise. * data.c (gfc_assign_data_value): Likewise. * decl.c (free_variable, free_value, gfc_free_data): Likewise. (gfc_free_data_all, match_old_style_init): Likewise. (gfc_set_constant_character_len, gfc_free_enum_history, NUM_DECL): Likewise. (gfc_match_modproc): Likewise. * dependency.c (check_section_vs_section): Likewise. * error.c (gfc_pop_error, gfc_free_error): Likewise. * expr.c (free_expr0, gfc_free_expr, gfc_free_actual_arglist): Likewise. (gfc_free_ref_list, gfc_replace_expr, gfc_copy_ref): Likewise. (find_substring_ref, gfc_simplify_expr, gfc_check_assign_symbol): Likewise. * frontend-passes.c (gfc_run_passes, cfe_expr_0): Likewise. (strip_function_call, optimize_comparison): Likewise. * interface.c (gfc_free_interface, arginfo, check_interface0): Likewise. (CHECK_OS_COMPARISON, gfc_extend_assign, gfc_free_formal_arglist): Likewise. * intrinsic.c (gfc_intrinsic_done_1, gfc_convert_type_warn): Likewise. (gfc_convert_chartype): Likewise. * io.c (gfc_free_open, compare_to_allowed_values, gfc_free_close): Likewise. (gfc_free_filepos, gfc_free_dt, gfc_free_inquire): Likewise. * match.c (gfc_free_iterator, gfc_match_associate): Likewise. (gfc_free_alloc_list, gfc_free_namelist, gfc_free_equiv_until): Likewise. (free_case, gfc_free_forall_iterator): Likewise. * misc.c: Likewise. * module.c (free_pi_tree, resolve_fixups, free_rename): Likewise. (free_true_name, peek_atom, mio_allocated_wide_string): Likewise. (mio_pool_string, mio_internal_string, mio_gmp_integer): Likewise. (mio_gmp_real, mio_expr, mio_typebound_proc): Likewise. (mio_full_typebound_tree, skip_list, load_equiv): Likewise. (free_written_common, gfc_use_module, gfc_free_use_stmts): Likewise. * openmp.c (gfc_free_omp_clauses): Likewise. * options.c (gfc_post_options): Likewise. * parse.c (select_type_pop, parse_omp_structured_block): Likewise. * primary.c (gfc_free_structure_ctor_component): Likewise. * resolve.c (resolve_structure_cons, check_host_association): Likewise. (gfc_resolve_forall, resolve_equivalence): Likewise. * scanner.c (gfc_scanner_done_1, gfc_release_include_path): Likewise. (gfc_define_undef_line, preprocessor_line, include_line): Likewise. (load_file, gfc_read_orig_filename): Likewise. * simplify.c (simplify_transformation_to_array): Likewise. (gfc_simplify_ibits, simplify_shift, gfc_simplify_ishftc, STRING): Likewise. (gfc_simplify_compiler_options): Likewise. * st.c (gfc_free_statement, gfc_free_statements): Likewise. (gfc_free_association_list): Likewise. * symbol.c (free_components, gfc_free_st_label, free_st_labels): Likewise. (gfc_delete_symtree, gfc_free_symbol, gfc_undo_symbols): Likewise. (free_old_symbol, gfc_commit_symbols, free_tb_tree): Likewise. (free_common_tree, free_uop_tree, free_sym_tree): Likewise. (gfc_free_dt_list, gfc_free_equiv_infos, gfc_free_equiv_lists): Likewise. (gfc_free_finalizer, gfc_free_charlen, free_entry_list): Likewise. (gfc_free_namespace): Likewise. * trans-array.c (gfc_free_ss, gfc_trans_array_bound_check): Likewise. (gfc_conv_array_ref, gfc_conv_ss_startstride): Likewise. (gfc_trans_dummy_array_bias, gfc_conv_array_parameter): Likewise. * trans-common.c (get_init_field, create_common): Likewise. * trans-const.c (gfc_build_wide_string_const): Likewise. (gfc_conv_string_init): Likewise. * trans-decl.c (gfc_generate_function_code): Likewise. * trans-expr.c (gfc_conv_substring, gfc_free_interface_mapping): Likewise. (SCALAR_POINTER, gfc_conv_statement_function): Likewise. (gfc_trans_subarray_assign): Likewise. * trans-intrinsic.c (conv_generic_with_optional_char_arg): Likewise. * trans-io.c (gfc_trans_io_runtime_check, set_string): Likewise. (transfer_namelist_element, transfer_array_component): Likewise. * trans-openmp.c (gfc_trans_omp_array_reduction): Likewise. * trans-stmt.c (cleanup_forall_symtrees, gfc_trans_forall_1): Likewise. * trans.c (trans_runtime_error_vararg, gfc_restore_backend_locus): Likewise. From-SVN: r172666
2011-04-04re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-14/+27
2011-04-04 Tobias Burnus <burnus@net-b.de> Mikael Morin <mikael.morin@sfr.fr> PR fortran/18918 * check.c (is_coarray): Update - because of DIMEN_THIS_IMAGE. * expr.c (gfc_is_coindexed): Ditto. * gfortran.h (gfc_array_ref_dimen_type): Add DIMEN_THIS_IMAGE. * interface.c (compare_parameter): Use gfc_expr_attr and gfc_is_coindexed. * resolve.c (check_dimension, compare_spec_to_ref, resolve_allocate_expr, check_data_variable): Update for DIMEN_THIS_IMAGE. * simplify.c (gfc_simplify_lcobound, gfc_simplify_this_image, gfc_simplify_ucobound): Allow non-constant bounds. * trans-array.c (gfc_set_loop_bounds_from_array_spec, gfc_trans_create_temp_array, gfc_trans_constant_array_constructor, gfc_set_vector_loop_bounds, gfc_conv_array_index_offset, gfc_start_scalarized_body, gfc_trans_scalarizing_loops, gfc_trans_scalarized_loop_boundary, gfc_conv_section_startstride, gfc_conv_ss_startstride, gfc_conv_loop_setup, gfc_trans_array_bounds, gfc_conv_expr_descriptor, gfc_walk_variable_expr): Handle codimen. * trans-decl.c (gfc_build_qualified_array): Save cobounds. * trans-intrinsic.c (gfc_conv_intrinsic_bound): Use arg2. (conv_intrinsic_cobound): New function. (gfc_conv_intrinsic_function): Call it. (gfc_walk_intrinsic_function, gfc_add_intrinsic_ss_code): Handle ucobound, lcobound, this_image. * fortran/trans-types.c (gfc_build_array_type): Save cobounds. (gfc_get_dtype): Honour corank. (gfc_get_nodesc_array_type): Save corank and codimensions. (gfc_get_array_type_bounds): Save cobound. * fortran/trans.h (gfc_ss_info,gfc_loopinfo): Add codimen item. (gfc_array_kind): Add corank item. (GFC_TYPE_ARRAY_CORANK): New macro. 2011-04-04 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_10.f90: Add coarray descriptor diagnostic check. * gfortran.dg/coarray_13.f90: Add checks for run-time cobounds. * gfortran.dg/coarray_15.f90: New. Co-Authored-By: Mikael Morin <mikael.morin@sfr.fr> From-SVN: r171949
2011-02-18re PR fortran/47768 (ICE: printing a derived-type variable with proc-pointer ↵Janus Weil1-0/+8
components) 2011-02-18 Janus Weil <janus@gcc.gnu.org> PR fortran/47768 * resolve.c (resolve_transfer): Reject variables with procedure pointer components. 2011-02-18 Janus Weil <janus@gcc.gnu.org> PR fortran/47768 * gfortran.dg/proc_ptr_comp_30.f90: New. From-SVN: r170271
2011-02-18re PR fortran/47767 ([OOP] SELECT TYPE fails to execute correct TYPE IS block)Janus Weil1-24/+14
2011-02-18 Janus Weil <janus@gcc.gnu.org> PR fortran/47767 * gfortran.h (gfc_check_access): Removed prototype. (gfc_check_symbol_access): Added prototype. * module.c (gfc_check_access): Renamed to 'check_access', made static. (gfc_check_symbol_access): New function, basically a shortcut for 'check_access'. (write_dt_extensions,write_symbol0,write_generic,write_symtree): Use 'gfc_check_symbol_access'. (write_operator,write_module): Renamed 'gfc_check_access'. * resolve.c (resolve_fl_procedure,resolve_fl_derived, resolve_fl_namelist,resolve_symbol,resolve_fntype): Use 'gfc_check_symbol_access'. 2011-02-18 Janus Weil <janus@gcc.gnu.org> PR fortran/47767 * gfortran.dg/class_40.f03: New. From-SVN: r170269
2011-02-11re PR fortran/47550 (PURE with VALUE and w/o INTENT: add gfc_notify_std ↵Tobias Burnus1-8/+22
(GFC_STD_F2008 ?) 2011-02-11 Tobias Burnus <burnus@net-b.de> PR fortran/47550 * resolve.c (resolve_formal_arglist): PURE with VALUE and no INTENT: Add -std= diagnostics. 2011-02-11 Tobias Burnus <burnus@net-b.de> PR fortran/47550 * gfortran.dg/pure_formal_2.f90: New. From-SVN: r170060
2011-02-09re PR fortran/47352 ([F03] ICE with proc-pointers in generic procedures)Janus Weil1-1/+4
2011-02-09 Janus Weil <janus@gcc.gnu.org> PR fortran/47352 * resolve.c (resolve_procedure_interface): If interface has a result variable, copy the typespec and set result pointer to self. 2011-02-09 Janus Weil <janus@gcc.gnu.org> PR fortran/47352 * gfortran.dg/proc_decl_25.f90: New. From-SVN: r169987
2011-02-09re PR fortran/47463 ([OOP] ICE in gfc_add_component_ref)Janus Weil1-1/+0
2011-02-09 Janus Weil <janus@gcc.gnu.org> PR fortran/47463 * resolve.c (resolve_typebound_subroutine): Remove erroneous line. 2011-02-09 Janus Weil <janus@gcc.gnu.org> PR fortran/47463 * gfortran.dg/typebound_assignment_2.f03: New. From-SVN: r169985
2011-02-02re PR fortran/47572 ([OOP] Invalid: Allocatable polymorphic with init ↵Janus Weil1-1/+2
expression.) 2011-02-02 Janus Weil <janus@gcc.gnu.org> PR fortran/47572 * resolve.c (resolve_fl_variable): Handle polymorphic allocatables. 2011-02-02 Janus Weil <janus@gcc.gnu.org> PR fortran/47572 * gfortran.dg/class_36.f03: New. From-SVN: r169520
2011-01-31re PR fortran/47463 ([OOP] ICE in gfc_add_component_ref)Janus Weil1-4/+3
2011-01-31 Janus Weil <janus@gcc.gnu.org> PR fortran/47463 * resolve.c (resolve_typebound_subroutine): Bug fix for the case of an argument of a typebound assignment being a component. 2011-01-31 Janus Weil <janus@gcc.gnu.org> PR fortran/47463 * gfortran.dg/typebound_assignment_1.f03: New. From-SVN: r169443
2011-01-30re PR fortran/47042 (ICE with character pointer in function)Tobias Burnus1-0/+8
2011-01-31 Tobias Burnus <burnus@net-b.de> PR fortran/47042 * resolve.c (resolve_fl_procedure): Reject stmt functions with pointer/allocatable attribute. 2011-01-31 Tobias Burnus <burnus@net-b.de> PR fortran/47042 * gfortran.dg/stmt_func_1.f90: New. From-SVN: r169415
2011-01-28re PR fortran/47507 (PURE functions with VALUE arguments invalidly rejectd)Tobias Burnus1-5/+7
2011-01-28 Tobias Burnus <burnus@net-b.de> PR fortran/47507 * resolve.c (resolve_formal_arglist): Allow arguments with VALUE attribute also without INTENT. 2011-01-28 Tobias Burnus <burnus@net-b.de> PR fortran/47507 * gfortran.dg/pure_formal_1.f90: New. From-SVN: r169372
2011-01-28re PR fortran/45170 ([F2003] allocatable character lengths)Paul Thomas1-10/+18
2011-01-28 Paul Thomas <pault@gcc.gnu.org> Tobias Burnus <burnus@gcc.gnu.org> PR fortran/45170 PR fortran/35810 PR fortran/47350 * interface.c (compare_actual_formal): An allocatable or pointer deferred length actual is only allowed if the formal argument is also deferred length. Clean up whitespace. * trans-expr.c (gfc_conv_procedure_call): Pass string length for deferred character length formal arguments by reference. Do the same for function results. (gfc_trans_pointer_assignment): Do not do runtime check of lhs and rhs character lengths, if deferred length lhs. In this case set the lhs character length to that of the rhs. (gfc_conv_string_parameter): Remove assert that string length is an integer type. (is_scalar_reallocatable_lhs): New function. (alloc_scalar_allocatable_for_assignment): New function. (gfc_trans_assignment_1): Call above new function. If the rhs is a deferred character length itself, makes ure that the function is called before reallocation, so that the length is available. (gfc_trans_asssignment): Remove error about assignment to deferred length character variables. * gfortran.texi : Update entry about (re)allocation on assignment. * trans-stmt.c (gfc_trans_allocate): Add code to handle deferred length character variables. * module.c (mio_typespec): Transfer deferred characteristic. * trans-types.c (gfc_get_function_type): New code to generate hidden typelist, so that those character lengths that are passed by reference get the right type. * resolve.c (resolve_contained_fntype): Supress error for deferred character length functions. (resolve_function, resolve_fl_procedure) The same. (check_symbols): Remove the error that support for entity with deferred type parameter is not yet implemented. (resolve_fl_derived): The same. match.c (alloc_opt_list): Allow MOLD for deferred length object. * trans-decl.c (gfc_get_symbol_decl): For deferred character length dummies, generate a local variable for string length. (create_function_arglist): Hidden length can be a pointer. (gfc_trans_deferred_vars): For deferred character length results and dummies, assign the string length to the local variable from the hidden argument on entry and the other way round on exit, as appropriate. 2011-01-28 Paul Thomas <pault@gcc.gnu.org> Tobias Burnus <burnus@gcc.gnu.org> PR fortran/45170 PR fortran/35810 PR fortran/47350 * gfortran.dg/realloc_on_assign_3.f03: New test. * gfortran.dg/realloc_on_assign_4.f03: New test. * gfortran.dg/realloc_on_assign_5.f90: New test. * gfortran.dg/allocatable_function_5.f90: New test. * gfortran.dg/allocate_deferred_char_scalar_1.f90: New test. * gfortran.dg/deferred_type_param_2.f90: Remove two "not yet implemented" dg-errors. Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org> From-SVN: r169356
2011-01-26re PR fortran/47339 (Fortran 2003/2008: Valid NAMELIST rejected; Fortran 95: ↵Tobias Burnus1-23/+47
Invalid namelist objects accepted) 2011-01-26 Tobias Burnus <burnus@net-b.de> PR fortran/47339 PR fortran/43062 * match.c (gfc_match_namelist): Allow assumed-length characters. * resolve.c (resolve_fl_namelist): Adapt and add error messages. * symbol.c (check_conflict): Allow allocatables in NML for * F2003. * trans-io.c (nml_get_addr_expr,transfer_namelist_element): Changes due to that change. 2011-01-26 Tobias Burnus <burnus@net-b.de> PR fortran/47339 PR fortran/43062 * fortran.dg/namelist_69.f90: New test. * fortran.dg/namelist_70.f90: New test. * fortran.dg/namelist_assumed_char.f90: Modify dg-error, augment * test. * fortran.dg/namelist_3.f90: Adapt test. * fortran.dg/namelist_34.f90: Ditto. * fortran.dg/namelist_35.f90: Ditto. * fortran.dg/namelist_5.f90: Ditto. * fortran.dg/namelist_63.f90: Ditto. * gfortran.dg/alloc_comp_constraint_1.f90: Ditto. From-SVN: r169282
2011-01-22re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going ↵Thomas Koenig1-0/+42
through expr->ref) 2011-01-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/38536 * resolve.c (gfc_iso_c_func_interface): For C_LOC, check for array sections followed by component references which are illegal. Also check for coindexed arguments. 2011-01-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/38536 * gfortran.dg/c_loc_tests_16.f90: New test. From-SVN: r169130
2011-01-18re PR fortran/47240 ([F03] segfault with procedure pointer component)Janus Weil1-0/+4
2011-01-18 Janus Weil <janus@gcc.gnu.org> PR fortran/47240 * resolve.c (expression_rank): Fix rank of procedure poiner components. * trans-expr.c (gfc_conv_procedure_call): Take care of procedure pointer components as actual arguments. 2011-01-18 Janus Weil <janus@gcc.gnu.org> PR fortran/47240 * gfortran.dg/proc_ptr_comp_29.f90: New. From-SVN: r168973
2011-01-17re PR fortran/47331 (ICE in make_decl_rtl, at varasm.c:1133 (with -fopenmp))Jakub Jelinek1-0/+5
PR fortran/47331 * gfortran.h (struct gfc_omp_saved_state): New type. (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New prototypes. * resolve.c (resolve_global_procedure): Call it around gfc_resolve call. * openmp.c (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New functions. * gfortran.dg/gomp/pr47331.f90: New test. From-SVN: r168935
2011-01-13re PR fortran/45848 ([OOP] ICE on invalid code in fortran/symbol.c:2410)Tobias Burnus1-22/+23
2011-01-13 Tobias Burnus <burnus@net-b.de> Mikael Morin <mikael@gcc.gnu.org> PR fortran/45848 PR fortran/47204 * gfortran.h (gfc_code): Move union ext's case_list into the struct block. * dump-parse-tree.c (show_code_node): Adapt by prefixing * case_list by "block.". * frontend-passes.c (gfc_code_walker): Ditto. * match.c (gfc_match_goto, gfc_match_call, gfc_match_case, gfc_match_type_is, gfc_match_class_is): Ditto. * resolve.c (resolve_select, resolve_select_type): Ditto. * st.c (gfc_free_statement): Ditto. * trans-stmt.c (gfc_trans_integer_select, * gfc_trans_logical_select, gfc_trans_character_select): Ditto. * parse.c (resolve_all_program_units): For error recovery, avoid segfault is proc_name is NULL. 2011-01-13 Tobias Burnus <burnus@net-b.de> Mikael Morin <mikael@gcc.gnu.org> PR fortran/45848 PR fortran/47204 * gfortran.dg/select_type_20.f90: New. * gfortran.dg/select_type_21.f90: New. Co-Authored-By: Mikael Morin <mikael@gcc.gnu.org> From-SVN: r168753
2011-01-09re PR fortran/47224 ([F03] ICE with procedure pointer component)Janus Weil1-15/+0
2011-01-09 Janus Weil <janus@gcc.gnu.org> PR fortran/47224 * resolve.c (resolve_actual_arglist): Remove unneeded and buggy piece of code. 2011-01-09 Janus Weil <janus@gcc.gnu.org> PR fortran/47224 * gfortran.dg/proc_ptr_comp_28.f90: New. From-SVN: r168618
2011-01-09re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going ↵Thomas Koenig1-15/+6
through expr->ref) 2011-01-09 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/38536 * resolve.c (is_scalar_expr_ptr): For a substring reference, use gfc_dep_compare_expr to compare start and end expession. Add FIXME for using gfc_deb_compare_expr elsewhere. 2011-01-09 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/38536 * gfortran.dg/iso_c_binding_c_loc_char_1.f03: New test. From-SVN: r168614
2011-01-08re PR fortran/46896 (Wrong code with transpose(a) passed to subroutine)Paul Thomas1-1/+72
2011-01-08 Paul Thomas <pault@gcc.gnu.org> PR fortran/46896 * trans-expr.c (gfc_conv_procedure_call): With a non-copying procedure argument (eg TRANSPOSE) use a temporary if there is any chance of aliasing due to host or use association. (arrayfunc_assign_needs_temporary): Correct logic for function results and do not use a temporary for implicitly PURE variables. Use a temporary for Cray pointees. * symbol.c (gfc_add_save): Explicit SAVE not compatible with implicit pureness of containing procedure. * decl.c (match_old_style_init, gfc_match_data): Where decl would fail in PURE procedure, set implicit_pure to zero. * gfortran.h : Add implicit_pure to structure symbol_attr and add prototype for function gfc_implicit_pure. * expr.c (gfc_check_pointer_assign, gfc_check_vardef_context): Where decl would fail in PURE procedure, reset implicit_pure. * io.c (match_vtag, gfc_match_open, gfc_match_close, gfc_match_print, gfc_match_inquire, gfc_match_wait): The same. * match.c (gfc_match_critical, gfc_match_stopcode, sync_statement, gfc_match_allocate, gfc_match_deallocate): The same. * parse.c (decode_omp_directive): The same. (parse_contained): If not PURE, set implicit pure attribute. * resolve.c (resolve_formal_arglist, resolve_structure_cons, resolve_function, resolve_ordinary_assign) : The same. (gfc_implicit_pure): New function. * module.c (mio_symbol_attribute): Introduce AB_IMPLICIT_PURE to ab_attribute enum and use it in this function. 2011-01-08 Paul Thomas <pault@gcc.gnu.org> PR fortran/46896 * gfortran.dg/transpose_optimization_2.f90 : New test. From-SVN: r168600
2011-01-07re PR fortran/47189 ([OOP] calling STORAGE_SIZE on a NULL-initialized class ↵Janus Weil1-6/+0
pointer) 2011-01-07 Janus Weil <janus@gcc.gnu.org> PR fortran/47189 PR fortran/47194 * gfortran.h (gfc_lval_expr_from_sym): Moved prototype. * class.c (gfc_class_null_initializer): Initialize _vptr to declared type. * expr.c (gfc_lval_expr_from_sym): Moved here from symbol.c. * resolve.c (resolve_deallocate_expr): _data component will be added at translation stage. * symbol.c (gfc_lval_expr_from_sym): Moved to expr.c. * trans-stmt.c (gfc_trans_deallocate): Reset _vptr to declared type. 2011-01-07 Janus Weil <janus@gcc.gnu.org> PR fortran/47189 PR fortran/47194 * gfortran.dg/storage_size_3.f08: Extended. From-SVN: r168565
2011-01-05re PR fortran/46017 (Reject ALLOCATE(a, a%b) as "a%b" depends on the ↵Thomas Koenig1-9/+58
allocation status of "a") 2011-01-05 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/46017 * resolve.c (resolve_allocate_deallocate): Follow references to check for duplicate occurence of allocation/deallocation objects. 2011-01-05 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/46017 * gfortran.dg/allocate_error_2.f90: New test. From-SVN: r168506
2010-12-31re PR fortran/45338 (Failure on interfacing a function passed as an argument ↵Thomas Koenig1-3/+6
as a custom operator) 2010-12-31 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45338 * resolve.c (resolve_operator): Mark function for user-defined operator as referenced. 2010-12-31 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45338 * gfortran.dg/userdef_operator_2.f90: New test case. From-SVN: r168366
2010-12-17re PR fortran/46849 ([OOP] MODULE PROCEDURE resolution does not work in ↵Janus Weil1-1/+3
BLOCK or SELECT TYPE) 2010-12-17 Janus Weil <janus@gcc.gnu.org> Tobias Burnus <burnus@gcc.gnu.org> PR fortran/46849 * resolve.c (resolve_symbol): Remove symbols that wrongly ended up in a local BLOCK namespace. 2010-12-17 Janus Weil <janus@gcc.gnu.org> PR fortran/46849 * gfortran.dg/block_9.f08: New. Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org> From-SVN: r167978
2010-12-12re PR fortran/46809 ([OOP] ICE with -fcheck=pointer for CLASS IS)Janus Weil1-0/+1
2010-12-12 Janus Weil <janus@gcc.gnu.org> PR fortran/46809 * resolve.c (resolve_select_type): Set the location of the first argument when generating the EXTENDS_TYPE_OF call. 2010-12-12 Janus Weil <janus@gcc.gnu.org> PR fortran/46809 * gfortran.dg/pointer_check_8.f90: New. From-SVN: r167731
2010-12-11re PR fortran/46370 ([Coarray] [OOP] ALLOCATE: Error allocating CLASS coarrays)Tobias Burnus1-7/+8
2010-12-11 Tobias Burnus <burnus@net-b.de> PR fortran/46370 * primary.c (gfc_match_varspec): Pass information about * codimension to gfc_match_array_ref also for BT_CLASS. * resolve.c (resolve_procedure): Correct check for C612. 2010-12-11 Tobias Burnus <burnus@net-b.de> PR fortran/46370 * gfortran.dg/coarray_14.f90: New. From-SVN: r167715
2010-11-28re PR fortran/46662 ([OOP] gfortran accepts "CALL ↵Janus Weil1-2/+13
polymorphic%abstract_type%ppc()") 2010-11-28 Janus Weil <janus@gcc.gnu.org> PR fortran/46662 * resolve.c (update_ppc_arglist): Add check for abstract passed object. 2010-11-28 Janus Weil <janus@gcc.gnu.org> PR fortran/46662 * gfortran.dg/proc_ptr_comp_pass_7.f90: New. From-SVN: r167225
2010-11-12re PR fortran/46413 ([OOP] ICE when printing a polymorphic type)Tobias Burnus1-2/+12
2010-11-11 Tobias Burnus <burnus@net-b.de> PR fortran/46413 * resolve.c (resolve_transfer): Reject I/O transfer of polymorphic type. PR fortran/46205 * resolve.c (resolve_code): Reject nonscalar FORALL masks. 2010-11-11 Tobias Burnus <burnus@net-b.de> PR fortran/46413 * gfortran.dg/class_31.f90: New. PR fortran/46205 * gfortran.dg/forall_14.f90: New. From-SVN: r166631
2010-11-11resolve.c (resolve_procedure_interface): Copy 'is_bind_c' attribute.Janus Weil1-0/+1
2010-11-11 Janus Weil <janus@gcc.gnu.org> * resolve.c (resolve_procedure_interface): Copy 'is_bind_c' attribute. 2010-11-11 Janus Weil <janus@gcc.gnu.org> * gfortran.dg/proc_decl_24.f90: New. From-SVN: r166623
2010-11-10re PR fortran/46244 (gfc_compare_derived_types is buggy)Tobias Burnus1-0/+7
2010-11-10 Tobias Burnus <burnus@net-b.de> PR fortran/46244 * resolve.c (resolve_fl_derived): Don't allow CLASS in sequence/BIND(C) types. 2010-11-10 Tobias Burnus <burnus@net-b.de> PR fortran/46244 * gfortran.dg/class_30.f90: New. From-SVN: r166547
2010-11-09re PR fortran/46313 ([OOP] class container naming collisions)Janus Weil1-20/+20
2010-11-09 Janus Weil <janus@gcc.gnu.org> PR fortran/46313 * gfortran.h (gfc_add_data_component,gfc_add_vptr_component, gfc_add_hash_component,gfc_add_size_component, gfc_add_def_init_component): New macros. * class.c (gfc_add_component_ref): Renamed data component. (get_unique_type_string): New function. (gfc_build_class_symbol): Use 'get_unique_type_string' to construct uniques names for the class containers. Rename components. (gfc_find_derived_vtab): Use 'get_unique_type_string' to construct uniques names for the vtab symbols. Rename components. * decl.c (attr_decl1): Renamed class container components. * iresolve.c (gfc_resolve_extends_type_of): Ditto. * match.c (select_type_set_tmp): Renamed temporaries. * module.c (read_module): Renamed vtab and vtype symbols. * resolve.c (resolve_structure_cons,resolve_typebound_function, resolve_typebound_subroutine,resolve_deallocate_expr, resolve_select_type,resolve_fl_derived): Renamed class container and vtab components. * trans-array.c (structure_alloc_comps): Ditto. * trans-decl.c (gfc_trans_deferred_vars): Ditto. * trans-expr.c (gfc_conv_derived_to_class,gfc_conv_structure, gfc_trans_class_init_assign,gfc_trans_class_assign): Ditto. * trans-intrinsic.c (gfc_conv_intrinsic_sizeof, gfc_conv_intrinsic_storage_size,gfc_conv_allocated,gfc_conv_associated, gfc_conv_same_type_as): Ditto. * trans-stmt.c (gfc_trans_allocate): Ditto. 2010-11-09 Janus Weil <janus@gcc.gnu.org> PR fortran/46313 * gfortran.dg/class_29.f03: New. From-SVN: r166480
2010-11-05re PR fortran/45451 ([OOP] Inconsistent status of ALLOCATABLE components ↵Janus Weil1-0/+3
inside CLASS variables.) 2010-11-05 Janus Weil <janus@gcc.gnu.org> PR fortran/45451 PR fortran/46174 * class.c (gfc_find_derived_vtab): Improved search for existing vtab. Add component '$copy' to vtype symbol for polymorphic deep copying. * expr.c (gfc_check_pointer_assign): Make sure the vtab is generated during resolution stage. * resolve.c (resolve_codes): Don't resolve code if namespace is already resolved. * trans-stmt.c (gfc_trans_allocate): Call '$copy' procedure for polymorphic ALLOCATE statements with SOURCE. 2010-11-05 Janus Weil <janus@gcc.gnu.org> PR fortran/45451 PR fortran/46174 * gfortran.dg/class_19.f03: Modified. * gfortran.dg/class_allocate_6.f03: New. From-SVN: r166368
2010-11-022010-11-02 Steven G.Steven G. Kargl1-1/+19
2010-11-02 Steven G. Kargl < kargl@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/45170 * array.c (gfc_match_array_constructor): Reject deferred type parameter (DTP) in type-spec. * decl.c (char_len_param_value, match_char_length, gfc_match_char_spec, build_sym, variable_decl, enumerator_decl): Support DTP. * expr.c (check_inquiry): Fix check due to support for DTP. * gfortran.h (gfc_typespec): Add Boolean 'deferred'. * misc.c (gfc_clear_ts): Set it to false. * match.c (gfc_match_allocate): Support DTP. * resolve.c (resolve_allocate_expr): Not-implemented error for * DTP. (resolve_fl_variable): Add DTP constraint check. * trans-decl.c (gfc_trans_deferred_vars): Add not-implemented error for DTP. 2010-11-02 Steven G. Kargl < kargl@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/45170 * gfortran.dg/deferred_type_param_1.f90: New. * gfortran.dg/deferred_type_param_2.f90: New. * gfortran.dg/initialization_1.f90: Update dg-errors. * gfortran.dg/initialization_9.f90: Update dg-errors. Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r166205
2010-10-10re PR fortran/45961 ([OOP] Problem with polymorphic type-bound operators)Janus Weil1-1/+1
2010-10-10 Janus Weil <janus@gcc.gnu.org> PR fortran/45961 * resolve.c (resolve_typebound_function): Bugfix for type-bound operators. 2010-10-10 Janus Weil <janus@gcc.gnu.org> PR fortran/45961 * gfortran.dg/typebound_operator_6.f03: New. From-SVN: r165263