summaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
AgeCommit message (Collapse)Author
2014-10-06libgfortran.h (GFC_STD_F2015): Add.Tobias Burnus
2014-10-06 Tobias Burnus <burnus@net-b.de> gcc/fortran/ * libgfortran.h (GFC_STD_F2015): Add. * decl.c (gfc_match_implicit_none): Handle spec list. (gfc_match_implicit): Move double intrinsic warning here. * gfortran.h (gfc_namespace): Add has_implicit_none_export:1. (gfc_set_implicit_none): Update interface. * interface.c (gfc_procedure_use): Add implicit-none external error check. * parse.c (accept_statement): Remove call. (verify_st_order): Permit that external-implict-none follows implicit statement. * symbol.c (gfc_set_implicit_none): Handle external/type implicit none. gcc/testsuite/ * gfortran.dg/implicit_14.f90: New. * gfortran.dg/implicit_15.f90: New. * gfortran.dg/implicit_4.f90: Update dg-error. From-SVN: r215914
2014-09-02re PR fortran/62270 (-Wlogical-not-parentheses warnings)Marek Polacek
PR fortran/62270 * interface.c (compare_parameter): Fix condition. * trans-expr.c (gfc_conv_procedure_call): Likewise. * gfortran.dg/pointer_intent_7.f90: Adjust dg-error. From-SVN: r214827
2014-06-25interface.c (check_intents): Fix diagnostic with coindexed coarrays.Tobias Burnus
gcc/fortran/ 2014-06-25 Tobias Burnus <burnus@net-b.de> * interface.c (check_intents): Fix diagnostic with coindexed coarrays. gcc/testsuite/ 2014-06-25 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_33.f90: New. From-SVN: r211994
2014-01-02Update copyright years in gcc/Richard Sandiford
From-SVN: r206289
2013-12-18re PR fortran/59493 ([OOP] ICE: Segfault on Class(*) pointer association)Janus Weil
2013-12-18 Janus Weil <janus@gcc.gnu.org> PR fortran/59493 * gfortran.h (gfc_find_intrinsic_vtab): Removed prototype. (gfc_find_vtab): New prototype. * class.c (gfc_find_intrinsic_vtab): Rename to 'find_intrinsic_vtab' and make static. Minor modifications. (gfc_find_vtab): New function. (gfc_class_initializer): Use new function 'gfc_find_vtab'. * check.c (gfc_check_move_alloc): Ditto. * expr.c (gfc_check_pointer_assign): Ditto. * interface.c (compare_actual_formal): Ditto. * resolve.c (resolve_allocate_expr, resolve_select_type): Ditto. * trans-expr.c (gfc_conv_intrinsic_to_class, gfc_trans_class_assign): Ditto. * trans-intrinsic.c (conv_intrinsic_move_alloc): Ditto. * trans-stmt.c (gfc_trans_allocate): Ditto. From-SVN: r206101
2013-12-10re PR fortran/35831 ([F95] Shape mismatch check missing for dummy procedure ↵Janus Weil
argument) 2013-12-10 Janus Weil <janus@gcc.gnu.org> PR fortran/35831 * interface.c (check_dummy_characteristics): Add checks for several attributes. 2013-12-10 Janus Weil <janus@gcc.gnu.org> PR fortran/35831 * gfortran.dg/c_by_val_5.f90: Modified. * gfortran.dg/dummy_procedure_10.f90: New. From-SVN: r205873
2013-11-25re PR fortran/59143 ([OOP] Bogus warning with array-valued type-bound procedure)Janus Weil
2013-11-25 Janus Weil <janus@gcc.gnu.org> PR fortran/59143 * interface.c (get_expr_storage_size): Handle array-valued type-bound procedures. 2013-11-25 Janus Weil <janus@gcc.gnu.org> PR fortran/59143 * gfortran.dg/typebound_proc_30.f90: New. From-SVN: r205345
2013-11-23re PR fortran/59228 (ICE-on-invalid with assumed type and ASYNCHRONOUS)Janus Weil
2013-11-23 Janus Weil <janus@gcc.gnu.org> PR fortran/59228 * interface.c (compare_parameter): Check for array spec. 2013-11-23 Janus Weil <janus@gcc.gnu.org> PR fortran/59228 * gfortran.dg/asynchronous_4.f90: New. From-SVN: r205304
2013-10-23re PR fortran/58793 (Wrong value for _vtab for intrinsic types with ↵Tobias Burnus
CLASS(*): storage_size of class(*) gives wrong result) 2013-10-23 Tobias Burnus <burnus@net-b.de> PR fortran/58793 * interface.c (compare_parameter): Reject passing TYPE(*) to CLASS(*). 2013-10-23 Tobias Burnus <burnus@net-b.de> PR fortran/58793 * gfortran.dg/assumed_type_8.f90: New. From-SVN: r203945
2013-10-16re PR fortran/58652 (ICE with move_alloc and unlimited polymorphic)Tobias Burnus
2013-10-16 Tobias Burnus <burnus@net-b.de> PR fortran/58652 * interface.c (compare_parameter): Accept passing CLASS(*) to CLASS(*). 2013-10-16 Tobias Burnus <burnus@net-b.de> PR fortran/58652 * gfortran.dg/unlimited_polymorphic_12.f90: New. From-SVN: r203720
2013-09-20re PR fortran/58099 ([F03] over-zealous procedure-pointer error checking)Janus Weil
2013-09-20 Janus Weil <janus@gcc.gnu.org> PR fortran/58099 * expr.c (gfc_check_pointer_assign): Remove second call to 'gfc_compare_interfaces' with swapped arguments. * interface.c (gfc_compare_interfaces): Symmetrize the call to 'check_result_characteristics' by calling it with swapped arguments. 2013-09-20 Janus Weil <janus@gcc.gnu.org> PR fortran/58099 * gfortran.dg/proc_ptr_43.f90: New. From-SVN: r202766
2013-08-23re PR fortran/57843 ([OOP] Type-bound assignment is resolved to ↵Janus Weil
non-polymorphic procedure call) 2013-08-23 Janus Weil <janus@gcc.gnu.org> PR fortran/57843 * interface.c (gfc_extend_assign): Look for type-bound assignment procedures before non-typebound. 2013-08-23 Janus Weil <janus@gcc.gnu.org> PR fortran/57843 * gfortran.dg/typebound_assignment_7.f90: New. From-SVN: r201946
2013-07-30re PR fortran/57530 ([OOP] Wrongly rejects type_pointer => class_target ↵Tobias Burnus
(which have identical declared type)) 2013-07-30 Tobias Burnus <burnus@net-b.de> PR fortran/57530 * symbol.c (gfc_type_compatible): A type is type compatible with a class if both have the same declared type. * interface.c (compare_type): Reject CLASS/TYPE even if they are type compatible. From-SVN: r201329
2013-07-27re PR fortran/57991 (Enhance "Same actual argument associated" warning ↵Tobias Burnus
(-Waliasing)) 2013-07-27 Tobias Burnus <burnus@net-b.de> PR fortran/57991 * interface.c (check_some_aliasing): Also warn for intent * OUT/OUT. 2013-07-27 Tobias Burnus <burnus@net-b.de> PR fortran/57991 * gfortran.dg/warn_alias.f90: New. From-SVN: r201286
2013-07-25re PR fortran/57639 ([OOP] ICE with polymorphism (and illegal code))Janus Weil
2013-07-25 Janus Weil <janus@gcc.gnu.org> PR fortran/57639 * interface.c (compare_parameter): Check for class_ok. * simplify.c (gfc_simplify_same_type_as): Ditto. 2013-07-25 Janus Weil <janus@gcc.gnu.org> PR fortran/57639 * gfortran.dg/unlimited_polymorphic_9.f90: New. From-SVN: r201239
2013-07-23decl.c: Fix comment typos.Ondřej Bílka
2013-07-23 Ondřej Bílka <neleai@seznam.cz> * decl.c: Fix comment typos. * interface.c: Likewise. * trans-array.c: Likewise. * trans.c: Likewise. From-SVN: r201162
2013-05-31re PR fortran/54190 (TYPE(*)/assumed-rank: Type/rank check too relaxed for ↵Janus Weil
dummy procedure) 2013-05-31 Janus Weil <janus@gcc.gnu.org> PR fortran/54190 PR fortran/57217 * gfortran.h (gfc_terminal_width): Remove prototype. * error.c (get_terminal_width): Moved here from misc.c. Renamed. Try to determine terminal width from environment variable. * interface.c (compare_type, compare_rank): New functions. Fix assumed type/rank handling. (compare_type_rank, check_dummy_characteristics, check_result_characteristics, gfc_compare_interfaces): Use them. (symbol_rank): Slightly modified and moved. * misc.c (gfc_terminal_width): Moved to error.c. 2013-05-31 Janus Weil <janus@gcc.gnu.org> PR fortran/54190 PR fortran/57217 * gfortran.dg/dummy_procedure_5.f90: Modified error message. * gfortran.dg/interface_26.f90: Ditto. * gfortran.dg/proc_ptr_11.f90: Ditto. * gfortran.dg/proc_ptr_15.f90: Ditto. * gfortran.dg/proc_ptr_comp_20.f90: Ditto. * gfortran.dg/proc_ptr_comp_33.f90: Ditto. * gfortran.dg/proc_ptr_result_5.f90: Ditto. * gfortran.dg/typebound_override_1.f90: Ditto. * gfortran.dg/typebound_override_4.f90: Ditto. * gfortran.dg/typebound_proc_6.f03: Ditto. * gfortran.dg/assumed_type_7.f90: New test. * gfortran.dg/typebound_override_5.f90: New test. * gfortran.dg/typebound_override_6.f90: New test. * gfortran.dg/typebound_override_7.f90: New test. From-SVN: r199475
2013-05-30re PR fortran/57458 (TS29113: Wrongly rejects noncontiguous argument to ↵Tobias Burnus
assumed-rank when both are volatile/asynchronous) 2013-05-30 Tobias Burnus <burnus@net-b.de> PR fortran/57458 * interface.c (compare_parameter): Update C1239/C1240 constraint check for assumed-rank/TS29113. 2013-05-30 Tobias Burnus <burnus@net-b.de> PR fortran/57458 * gfortran.dg/assumed_rank_13.f90: New. From-SVN: r199437
2013-05-28re PR fortran/57217 ([OOP] Accepts invalid TBP overriding - lacking ↵Janus Weil
arguments check) 2013-05-28 Janus Weil <janus@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/57217 * interface.c (check_dummy_characteristics): Symmetrize type check. 2013-05-28 Janus Weil <janus@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/57217 * gfortran.dg/typebound_override_4.f90: New. Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r199375
2013-04-17re PR fortran/56814 (Bogus Interface mismatch in dummy procedure)Janus Weil
2013-04-17 Janus Weil <janus@gcc.gnu.org> PR fortran/56814 * interface.c (check_result_characteristics): Get result from interface if present. 2013-04-17 Janus Weil <janus@gcc.gnu.org> PR fortran/56814 * gfortran.dg/proc_ptr_42.f90: New. From-SVN: r198032
2013-04-16re PR fortran/39505 (Consider a 'no arg check' directive)Tobias Burnus
2013-04-12 Tobias Burnus <burnus@net-b.de> PR fortran/39505 * decl.c (ext_attr_list): Add EXT_ATTR_NO_ARG_CHECK. * gfortran.h (ext_attr_id_t): Ditto. * gfortran.texi (GNU Fortran Compiler Directives): Document it. * interface.c (compare_type_rank): Ignore rank for NO_ARG_CHECK. (compare_parameter): Ditto - and regard as unlimited polymorphic. * resolve.c (resolve_symbol, resolve_variable): Add same * constraint checks as for TYPE(*); turn dummy to TYPE(*),dimension(*). (gfc_explicit_interface_required): Require explicit interface for NO_ARG_CHECK. 2013-04-12 Tobias Burnus <burnus@net-b.de> PR fortran/39505 * gfortran.dg/no_arg_check_1.f90: New. * gfortran.dg/no_arg_check_2.f90: New. * gfortran.dg/no_arg_check_3.f90: New. From-SVN: r198011
2013-04-12re PR fortran/56261 ([OOP] seg fault call procedure pointer on polymorphic ↵Janus Weil
array) 2013-04-12 Janus Weil <janus@gcc.gnu.org> PR fortran/56261 * gfortran.h (gfc_explicit_interface_required): New prototype. * expr.c (gfc_check_pointer_assign): Check if an explicit interface is required in a proc-ptr assignment. * interface.c (check_result_characteristics): Extra check. * resolve.c (gfc_explicit_interface_required): New function. (resolve_global_procedure): Use new function 'gfc_explicit_interface_required'. Do a full interface check. 2013-04-12 Janus Weil <janus@gcc.gnu.org> PR fortran/56261 * gfortran.dg/auto_char_len_4.f90: Add -pedantic. Changed error. * gfortran.dg/assumed_rank_4.f90: Modified error wording. * gfortran.dg/block_11.f90: Fix invalid test case. * gfortran.dg/function_types_3.f90: Add new error message. * gfortran.dg/global_references_1.f90: Ditto. * gfortran.dg/import2.f90: Remove unneeded parts. * gfortran.dg/import6.f90: Fix invalid test case. * gfortran.dg/proc_decl_2.f90: Ditto. * gfortran.dg/proc_decl_9.f90: Ditto. * gfortran.dg/proc_decl_18.f90: Ditto. * gfortran.dg/proc_ptr_40.f90: New. * gfortran.dg/whole_file_7.f90: Modified error wording. * gfortran.dg/whole_file_16.f90: Ditto. * gfortran.dg/whole_file_17.f90: Add -pedantic. * gfortran.dg/whole_file_18.f90: Modified error wording. * gfortran.dg/whole_file_20.f03: Ditto. * gfortran.fortran-torture/execute/intrinsic_associated.f90: Fix invalid test case. From-SVN: r197922
2013-04-11Replace enum gfc_try with bool type.Janne Blomqvist
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-04-03re PR fortran/56284 ([OOP] ICE with alternate return in type-bound procedure)Janus Weil
2013-04-03 Janus Weil <janus@gcc.gnu.org> PR fortran/56284 PR fortran/40881 * decl.c (gfc_match_formal_arglist): Warn about alternate-return arguments. * interface.c (check_dummy_characteristics): Return if symbols are NULL. 2013-04-03 Janus Weil <janus@gcc.gnu.org> PR fortran/56284 PR fortran/40881 * gfortran.dg/altreturn_8.f90: New. * gfortran.dg/altreturn_2.f90: Add -std=legacy. * gfortran.dg/intrinsic_actual_3.f90: Ditto. * gfortran.dg/invalid_interface_assignment.f90: Ditto. From-SVN: r197389
2013-01-29re PR fortran/54107 ([F03] Memory hog with abstract interface)Janus Weil
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 Sandiford
From-SVN: r195098
2012-12-23re PR fortran/54884 (Externally used PRIVATE module procedure wrongly marked ↵Tobias Burnus
as TREE_PUBLIC()=0) 2012-12-23 Tobias Burnus <burnus@net-b.de> PR fortran/54884 * module.c (write_symbol1_recursion): Set attr.public_use. * interface.c (check_sym_interfaces, check_uop_interfaces, gfc_check_interfaces): Remove attr.public_use code. * resolve.c (resolve_function, resolve_variable, resolve_typebound_procedure): Ditto. 2012-12-23 Tobias Burnus <burnus@net-b.de> PR fortran/54884 * gfortran.dg/public_private_module_8.f90: New. From-SVN: r194706
2012-12-20array.c (resolve_array_list): Apply C4106.Paul Thomas
2012-12-19 Paul Thomas <pault@gcc.gnu.org> * array.c (resolve_array_list): Apply C4106. * check.c (gfc_check_same_type_as): Exclude polymorphic entities from check for extensible types. Improved error for disallowed argument types to name the offending type. * class.c : Update copyright date. (gfc_class_null_initializer): Add argument for initialization expression and deal with unlimited polymorphic typespecs. (get_unique_type_string): Give unlimited polymorphic entities a type string. (gfc_intrinsic_hash_value): New function. (gfc_build_class_symbol): Incorporate unlimited polymorphic entities. (gfc_find_derived_vtab): Deal with unlimited polymorphic entities. (gfc_find_intrinsic_vtab): New function. * decl.c (gfc_match_decl_type_spec): Match typespec for unlimited polymorphic type. (gfc_match_data_decl): Skip to 'ok' if unlimited polymorphic. expr.c (gfc_check_pointer_assign): Apply C717. If unlimited polymorphic lvalue, find rvalue vtable for all typespecs, except unlimited polymorphic expressions. (gfc_check_vardef_context): Handle unlimited polymorphic entities. * gfortran.h : Add unlimited polymorphic attribute. Add second arg to gfc_class_null_initializer primitive and primitive for gfc_find_intrinsic_vtab. Add UNLIMITED_POLY to detect unlimited polymorphic expressions. * interface.c (gfc_compare_types): If expr1 is unlimited polymorphic, always return 1. If expr2 is unlimited polymorphic enforce C717. (gfc_compare_interfaces): Skip past conditions that do not apply for unlimited polymorphic entities. (compare_parameter): Make sure that an unlimited polymorphic, allocatable or pointer, formal argument is matched by an unlimited polymorphic actual argument. (compare_actual_formal): Ensure that an intrinsic vtable exists to match an unlimited polymorphic formal argument. * match.c (gfc_match_allocate): Type kind parameter does not need to match an unlimited polymorphic allocate-object. (alloc_opt_list): An unlimited polymorphic allocate-object requires a typespec or a SOURCE tag. (select_intrinsic_set_tmp): New function. (select_type_set_tmp): Call new function. If it returns NULL, build a derived type or class temporary instead. (gfc_match_type_is): Remove restriction to derived types only. Bind(C) or sequence derived types not permitted. * misc (gfc_typename): Printed CLASS(*) for unlimited polymorphism. * module.c : Add AB_UNLIMITED_POLY to pass unlimited polymorphic attribute to and from modules. * resolve.c (resolve_common_vars): Unlimited polymorphic entities cannot appear in common blocks. (resolve_deallocate_expr): Deallocate unlimited polymorphic enities. (resolve_allocate_expr): Likewise for allocation. Make sure vtable exists. (gfc_type_is_extensible): Unlimited polymorphic entities are not extensible. (resolve_select_type): Handle unlimited polymorphic selectors. Ensure that length type parameters are assumed and that names for intrinsic types are generated. (resolve_fl_var_and_proc): Exclude select type temporaries from test of extensibility of type. (resolve_fl_variable): Likewise for test that assumed character length must be a dummy or a parameter. (resolve_fl_derived0): Return SUCCESS unconditionally for unlimited polymorphic entities. Also, allow unlimited polymorphic components. (resolve_fl_derived): Return SUCCESS unconditionally for unlimited polymorphic entities. (resolve_symbol): Return early with unlimited polymorphic entities. * simplifiy.c : Update copyright year. (gfc_simplify_extends_type_of): No simplification possible for unlimited polymorphic arguments. * symbol.c (gfc_use_derived): Nothing to do for unlimited polymorphic "derived type". (gfc_type_compatible): Return unity if ts1 is unlimited polymorphic. * trans-decl.c (create_function_arglist) Formal arguments without a character length should be treated in the same way as passed lengths. (gfc_trans_deferred_vars): Nullify the vptr of unlimited polymorphic pointers. Avoid unlimited polymorphic entities triggering gcc_unreachable. * trans-expr.c (gfc_conv_intrinsic_to_class): New function. (gfc_trans_class_init_assign): Make indirect reference of src.expr. (gfc_trans_class_assign): Expression NULL of unknown type should set NULL vptr on lhs. Treat C717 cases where lhs is a derived type and the rhs is unlimited polymorphic. (gfc_conv_procedure_call): Handle the conversion of a non-class actual argument to match an unlimited polymorphic formal argument. Suppress the passing of a character string length in this case. Make sure that calls to the character __copy function have two character string length arguments. (gfc_conv_initializer): Pass the initialization expression to gfc_class_null_initializer. (gfc_trans_subcomponent_assign): Ditto. (gfc_conv_structure): Move handling of _size component. trans-intrinsic.c: (gfc_conv_same_type_as): Handle conditions where unlimited polymorphic arguments have null vptr. * trans-stmt.c (trans_associate_var): Correctly treat array temporaries associated with unlimited polymorphic selectors. Recover the overwritten dtype for the descriptor. Use the _size field of the vptr for character string lengths. (gfc_trans_allocate): Cope with unlimited polymorphic allocate objects; especially with character source tags. (reset_vptr): New function. (gfc_trans_deallocate): Call it. * trans-types.c (gfc_get_derived_type): Detect unlimited polymorphic types and deal with cases where the derived type of components is null. * trans.c : Update copyright year. (trans_code): Call gfc_trans_class_assign for C717 cases where the lhs is not unlimited polymorphic. 2012-12-19 Paul Thomas <pault@gcc.gnu.org> * intrinsics/extends_type_of.c : Return correct results for null vptrs. 2012-12-19 Paul Thomas <pault@gcc.gnu.org> * gfortran.dg/unlimited_polymorphic_1.f03: New test. * gfortran.dg/unlimited_polymorphic_2.f03: New test. * gfortran.dg/unlimited_polymorphic_3.f03: New test. * gfortran.dg/same_type_as.f03: Correct for improved message. From-SVN: r194622
2012-10-28re PR fortran/54958 (Wrongly rejects ac-implied-DO variables which also ↵Tobias Burnus
occur with INTENT(IN)) 2012-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/54958 * gfortran.h (gfc_resolve_iterator_expr, gfc_check_vardef_context): Update prototype. * expr.c (gfc_check_vardef_context): Add own_scope argument and honour it. * resolve.c (gfc_resolve_iterator_expr): Add own_scope argument and honour it. (resolve_deallocate_expr, resolve_allocate_expr, resolve_data_variables, resolve_transfer resolve_lock_unlock, resolve_code): Update calls. * array.c (resolve_array_list): Ditto. * check.c (gfc_check_atomic_def, gfc_check_atomic_ref): Ditto. * interface.c (compare_actual_formal): Ditto. * intrinsic.c (check_arglist): Ditto. * io.c (resolve_tag, gfc_resolve_dt, gfc_resolve_inquire): * Ditto. 2012-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/54958 * gfortran.dg/do_check_6.f90: New. From-SVN: r192896
2012-10-12re PR fortran/40453 ([F95] Enhanced (recursive) argument checking)Janus Weil
2012-10-12 Janus Weil <janus@gcc.gnu.org> PR fortran/40453 * interface.c (check_dummy_characteristics): Recursively check dummy procedures. 2012-10-12 Janus Weil <janus@gcc.gnu.org> PR fortran/40453 * gfortran.dg/dummy_procedure_9.f90: New. From-SVN: r192391
2012-10-06re PR fortran/45521 ([F08] GENERIC resolution with ALLOCATABLE/POINTER and ↵Janus Weil
PROCEDURE) 2012-10-06 Janus Weil <janus@gcc.gnu.org> PR fortran/45521 * interface.c (generic_correspondence): Implement additional distinguishability criteria of F08. (compare_actual_formal): Reject data object as actual argument for procedure formal argument. 2012-10-06 Janus Weil <janus@gcc.gnu.org> PR fortran/45521 * gfortran.dg/generic_25.f90: New. * gfortran.dg/generic_26.f90: New. * gfortran.dg/generic_27.f90: New. From-SVN: r192157
2012-10-04expr.c (scalarize_intrinsic_call): Plug memory leak.Tobias Burnus
2012-10-04 Tobias Burnus <burnus@net-b.de> * expr.c (scalarize_intrinsic_call): Plug memory leak. * frontend-passes.c (gcc_assert): Extend assert. * interface.c (gfc_compare_derived_types): Fix comparison. (gfc_check_operator_interface): Move up to make this error message reachable. (get_sym_storage_size): Remove always-true checks. * io.c (format_lex): Add comment. (gfc_free_wait): Free memory. * match.c (gfc_match_select_type): Ditto. * matchexpr.c (match_level_3): Ditto. * primary.c (match_string_constant): Ditto. (match_actual_arg): Check return value. * resolve.c (gfc_resolve_substring_charlen, resolve_typebound_generic_call, resolve_typebound_function, resolve_typebound_subroutine): Free memory. * trans-types.c (gfc_get_derived_type): Remove always-true * check. From-SVN: r192094
2012-10-02re PR fortran/54778 ([OOP] an ICE on invalid OO code)Janus Weil
2012-10-02 Janus Weil <janus@gcc.gnu.org> PR fortran/54778 * interface.c (matching_typebound_op): Check for 'class_ok' attribute. 2012-10-02 Janus Weil <janus@gcc.gnu.org> PR fortran/54778 * gfortran.dg/class_53.f90: New. From-SVN: r192005
2012-09-17error.c (error_print): Move increment out of the assert.Tobias Burnus
2012-09-17 Tobias Burnus <burnus@net-b.de> * error.c (error_print): Move increment out of the assert. * interface.c (gfc_compare_derived_types): Add assert. (get_expr_storage_size): Remove always-true logical condition. * resolve.c (resolve_allocate_expr): Fix looping logic. * target-memory.c (gfc_target_expr_size): Add assert. From-SVN: r191381
2012-09-16re PR fortran/54594 ([OOP] Type-bound ASSIGNMENTs (elemental + array ↵Janus Weil
version) rejected as ambiguous) 2012-09-16 Janus Weil <janus@gcc.gnu.org> PR fortran/54594 * interface.c (compare_type_rank): Handle CLASS arrays. 2012-09-16 Janus Weil <janus@gcc.gnu.org> PR fortran/54594 * gfortran.dg/typebound_generic_14.f03: New. From-SVN: r191365
2012-08-14gfortran.h (gfc_get_proc_ptr_comp): New prototype.Mikael Morin
fortran/ * gfortran.h (gfc_get_proc_ptr_comp): New prototype. (gfc_is_proc_ptr_comp): Update prototype. * expr.c (gfc_get_proc_ptr_comp): New function based on the old gfc_is_proc_ptr_comp. (gfc_is_proc_ptr_comp): Call gfc_get_proc_ptr_comp. (gfc_specification_expr, gfc_check_pointer_assign): Use gfc_get_proc_ptr_comp. * trans-array.c (gfc_walk_function_expr): Likewise. * resolve.c (resolve_structure_cons, update_ppc_arglist, resolve_ppc_call, resolve_expr_ppc): Likewise. (resolve_function): Update call to gfc_is_proc_ptr_comp. * dump-parse-tree.c (show_expr): Likewise. * interface.c (compare_actual_formal): Likewise. * match.c (gfc_match_pointer_assignment): Likewise. * primary.c (gfc_match_varspec): Likewise. * trans-io.c (gfc_trans_transfer): Likewise. * trans-expr.c (gfc_conv_variable, conv_function_val, conv_isocbinding_procedure, gfc_conv_procedure_call, gfc_trans_pointer_assignment): Likewise. (gfc_conv_procedure_call, gfc_trans_array_func_assign): Use gfc_get_proc_ptr_comp. From-SVN: r190391
2012-08-06re PR fortran/35831 ([F95] Shape mismatch check missing for dummy procedure ↵Janus Weil
argument) 2012-08-06 Janus Weil <janus@gcc.gnu.org> PR fortran/35831 * interface.c (check_result_characteristics): New function, which checks the characteristics of function results. (gfc_compare_interfaces,gfc_check_typebound_override): Call it. 2012-08-06 Janus Weil <janus@gcc.gnu.org> PR fortran/35831 * gfortran.dg/dummy_procedure_5.f90: Modified. * gfortran.dg/dummy_procedure_8.f90: New. * gfortran.dg/interface_26.f90: Modified. * gfortran.dg/proc_ptr_11.f90: Modified. * gfortran.dg/proc_ptr_15.f90: Modified. * gfortran.dg/proc_ptr_result_5.f90: Modified. * gfortran.dg/typebound_override_1.f90: Modified. * gfortran.dg/typebound_proc_6.f03: Modified. From-SVN: r190187
2012-07-31interface.c (gfc_procedure_use): Return gfc_try instead ofTobias Burnus
2012-07-31 Tobias Burnus <burnus@net-b.de> * interface.c (gfc_procedure_use): Return gfc_try instead of * void. * gfortran.h (gfc_procedure_use): Update prototype. * resolve.c (gfc_iso_c_func_interface): Allow noninteroperable procedures for c_funloc for TS29113. * (gfc_iso_c_sub_interface): Ditto for c_f_procpointer. Add diagnostic for c_ptr vs. c_funptr for c_f_(proc)pointer. 2012-07-31 Tobias Burnus <burnus@net-b.de> * gfortran.dg/c_funloc_tests_6.f90: New. * gfortran.dg/c_funloc_tests_7.f90: New. * gfortran.dg/c_funloc_tests_5.f03: Compile with -std=f2003. From-SVN: r190003
2012-07-25trans-types.c (gfc_real16_is_float128): Fix spelling in a comment.Tobias Burnus
2012-07-25 Tobias Burnus <burnus@net-b.de> * trans-types.c (gfc_real16_is_float128): Fix spelling in a comment. * trans.h (struct gfc_array_info): Ditto. * gfortran.h (gfc_expr): Ditto. * simplify.c (gfc_count): Ditto. * trans-expr.c (gfc_copy_class_to_class, conv_parent_component_references, gfc_trans_pointer_assignment): Ditto. * expr.c (check_pointer_assign): Fix diagnostic spelling. * interface.c (compare_parameter): Ditto. * parse.c (use_modules, parse_associate): Ditto. * decl.c (match_char_length): Fix spelling of the an function argument. From-SVN: r189859
2012-07-20re PR fortran/48820 (TR 29113: Implement parts needed for MPI 3)Tobias Burnus
2012-07-20 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * array.c (match_array_element_spec, gfc_match_array_spec, spec_size, gfc_array_dimen_size): Add support for assumed-rank arrays. * check.c (dim_rank_check): Ditto. * class.c (gfc_add_component_ref): Ditto. (gfc_build_class_symbol): Regard assumed-rank arrays as having GFC_MAX_DIMENSIONS. And build extra class container for a scalar pointer class. * decl.c (merge_array_spec): Add assert. * dump-parse-tree.c (show_array_spec): Add support for assumed-rank arrays. * expr.c (gfc_is_simply_contiguous): Ditto. * gfortran.h (array_type): Ditto. (gfc_array_spec, gfc_expr): Add comment to "rank" field. * interface.c (compare_type_rank, argument_rank_mismatch, compare_parameter, gfc_procedure_use): Ditto. (compare_actual_formal): Fix NULL() to optional-dummy handling for polymorphic dummies. * module.c (mio_typespec): Add support for assumed-rank arrays. * resolve.c (resolve_formal_arglist, resolve_actual_arglist, resolve_elemental_actual, resolve_global_procedure, expression_shape, resolve_variable, update_ppc_arglist, check_typebound_baseobject, gfc_resolve_expr, resolve_fl_var_and_proc, gfc_resolve_finalizers, resolve_typebound_procedure, resolve_symbol): Ditto. (assumed_type_expr_allowed): Remove static variable. (actual_arg, first_actual_arg): New static variables. * simplify.c (simplify_bound, gfc_simplify_range): Add support for assumed-rank arrays. * trans-array.c (gfc_conv_array_parameter): Ditto. (gfc_get_descriptor_dimension): New function, which returns the descriptor. (gfc_conv_descriptor_dimension): Use it. (gfc_conv_descriptor_stride_get, gfc_conv_array_parameter): Handle GFC_ARRAY_ASSUMED_RANK_CONT and AS_ASSUMED_RANK. * trans-array.h (gfc_get_descriptor_dimension): New prototype. * trans-decl. (gfc_build_dummy_array_decl, gfc_trans_deferred_vars, add_argument_checking): Add support for assumed-rank arrays. * trans-expr.c (gfc_conv_expr_present, gfc_conv_variable, gfc_conv_procedure_call): Ditto. (get_scalar_to_descriptor_type, class_array_data_assign, conv_scalar_to_descriptor): New static functions. (gfc_conv_derived_to_class, gfc_conv_class_to_class): Use them. * trans-intrinsic.c (get_rank_from_desc): New function. (gfc_conv_intrinsic_rank, gfc_conv_associated): Use it. * trans-types.c (gfc_array_descriptor_base_caf, gfc_array_descriptor_base): Make space for scalar array. (gfc_is_nodesc_array, gfc_is_nodesc_array, gfc_build_array_type, gfc_get_array_descriptor_base): Add support for assumed-rank arrays. * trans.h (gfc_array_kind): Add GFC_ARRAY_ASSUMED_RANK and GFC_ARRAY_ASSUMED_RANK_CONT. 2012-07-20 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * gfortran.dg/assumed_type_3.f90: Update dg-error. * gfortran.dg/assumed_rank_1.f90: New. * gfortran.dg/assumed_rank_1_c.c: New. * gfortran.dg/assumed_rank_2.f90: New. * gfortran.dg/assumed_rank_4.f90: New. * gfortran.dg/assumed_rank_5.f90: New. * gfortran.dg/assumed_rank_6.f90: New. * gfortran.dg/assumed_rank_7.f90: New. * gfortran.dg/assumed_rank_8.f90: New. * gfortran.dg/assumed_rank_8_c.c: New. * gfortran.dg/assumed_rank_9.f90: New. * gfortran.dg/assumed_rank_10.f90: New. * gfortran.dg/assumed_rank_12.f90: New. From-SVN: r189700
2012-07-19interface.c (compare_parameter, [...]): Fix handling of polymorphic arguments.Tobias Burnus
2012-07-19 Tobias Burnus <burnus@net-b.de> * interface.c (compare_parameter, compare_actual_formal): Fix handling of polymorphic arguments. From-SVN: r189669
2012-07-17re PR fortran/51081 ([F03] Proc-pointer assignment: Rejects valid internal proc)Janus Weil
2012-07-17 Janus Weil <janus@gcc.gnu.org> PR fortran/51081 * error.c (gfc_notify_std): Automatically print the relevant Fortran standard version. * arith.c (arith_power): Remove explicit standard reference string. * array.c (gfc_match_array_spec, gfc_match_array_constructor): Ditto. * check.c (gfc_check_a_p, gfc_check_besn, gfc_check_count, gfc_check_float, gfc_check_fn_rc2008, gfc_check_iand, gfc_check_ichar_iachar, gfc_check_ieor, gfc_check_index, gfc_check_ior, gfc_check_lbound, gfc_check_len_lentrim, check_rest, gfc_check_min_max, gfc_check_null, gfc_check_scan, gfc_check_selected_real_kind, gfc_check_shape, gfc_check_size, gfc_check_sngl, gfc_check_ubound, gfc_check_verify): Ditto. * data.c (gfc_assign_data_value): Ditto. * decl.c (var_element, char_len_param_value, match_char_length, gfc_verify_c_interop_param, match_pointer_init, variable_decl, gfc_match_decl_type_spec, gfc_match_import, match_attr_spec, gfc_match_prefix, gfc_match_suffix, match_ppc_decl, match_procedure_in_interface, gfc_match_procedure,gfc_match_entry, gfc_match_subroutine, gfc_match_end, gfc_match_codimension, gfc_match_protected, gfc_match_value, gfc_match_volatile, gfc_match_asynchronous, gfc_match_modproc, gfc_get_type_attr_spec, gfc_match_enum, match_procedure_in_type): Ditto. * expr.c (check_elemental, gfc_check_assign, gfc_check_pointer_assign): Ditto. * interface.c (gfc_match_abstract_interface, check_interface0): Ditto. * intrinsic.c (gfc_intrinsic_func_interface): Ditto. * io.c (format_lex, resolve_tag_format, resolve_tag, compare_to_allowed_values, gfc_match_open, gfc_match_rewind, gfc_resolve_dt, gfc_match_wait): Ditto. * match.c (match_arithmetic_if, gfc_match_if, gfc_match_critical, gfc_match_do, match_exit_cycle, gfc_match_pause, gfc_match_stop, gfc_match_lock, sync_statement, gfc_match_assign, gfc_match_goto, gfc_match_allocate, gfc_match_return, gfc_match_st_function): Ditto. * module.c (gfc_match_use, gfc_use_module): Ditto. * parse.c (parse_derived_contains, parse_block_construct, parse_associate, parse_contained): Ditto. * primary.c (match_hollerith_constant, match_boz_constant, match_real_constant, match_sym_complex_part, match_arg_list_function, build_actual_constructor, gfc_convert_to_structure_constructor): Ditto. * resolve.c (resolve_formal_arglist, resolve_entries, resolve_common_blocks, resolve_actual_arglist, gfc_resolve_index_1, gfc_resolve_iterator_expr, resolve_ordinary_assign, resolve_fl_var_and_proc, resolve_fl_variable_derived, resolve_fl_procedure, resolve_fl_derived0, resolve_fl_derived, resolve_fl_namelist, resolve_symbol, resolve_fntype): Ditto. * symbol.c (check_conflict, conflict, gfc_add_is_bind_c, gfc_add_extension, gfc_check_symbol_typed): Ditto. From-SVN: r189589
2012-07-08gfortran.h: Do not include coretypes.h here.Steven Bosscher
* 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
2012-06-27re PR fortran/41951 ([OOP] Not diagnosing ambiguous operators (TB vs. ↵Janus Weil
INTERFACE)) 2012-06-27 Janus Weil <janus@gcc.gnu.org> PR fortran/41951 PR fortran/49591 * interface.c (check_new_interface): Rename, add 'loc' argument, make non-static. (gfc_add_interface): Rename 'check_new_interface' * gfortran.h (gfc_check_new_interface): Add prototype. * resolve.c (resolve_typebound_intrinsic_op): Add typebound operator targets to non-typebound operator list. 2012-06-27 Janus Weil <janus@gcc.gnu.org> PR fortran/41951 PR fortran/49591 * gfortran.dg/typebound_operator_16.f03: New. From-SVN: r189022
2012-06-22re PR fortran/47710 ([OOP] Improve ambiguity check for GENERIC TBP w/ PASS ↵Janus Weil
and NOPASS) 2012-06-22 Janus Weil <janus@gcc.gnu.org> PR fortran/47710 PR fortran/53328 * interface.c (count_types_test, generic_correspondence, gfc_compare_interfaces): Ignore PASS arguments. (check_interface1, compare_parameter): Pass NULL arguments to gfc_compare_interfaces. * gfortran.h (gfc_compare_interfaces): Modified prototype. * expr.c (gfc_check_pointer_assign): Pass NULL arguments to gfc_compare_interfaces. * resolve.c (resolve_structure_cons): Ditto. (check_generic_tbp_ambiguity): Determine PASS arguments and pass them to gfc_compare_interfaces. 2012-06-22 Janus Weil <janus@gcc.gnu.org> PR fortran/47710 PR fortran/53328 * gfortran.dg/typebound_generic_12.f03: New. * gfortran.dg/typebound_generic_13.f03: New. From-SVN: r188902
2012-05-03re PR fortran/52864 (Assignment to pointer component for INTENT(IN) dummy ↵Tobias Burnus
argument) 2012-05-03 Tobias Burnus <burnus@net-b.de> PR fortran/52864 * interface.c (compare_parameter_intent): Remove. (check_intents): Remove call, handle CLASS pointer. (compare_actual_formal): Handle CLASS pointer. 2012-05-03 Tobias Burnus <burnus@net-b.de> PR fortran/52864 * gfortran.dg/pointer_intent_7.f90: New. * gfortran.dg/pure_formal_3.f90: New. From-SVN: r187076
2012-04-15re PR fortran/52916 (481.wrf in SPEC CPU 2006 failed to build)Tobias Burnus
2012-04-14 Tobias Burnus <burnus@net-b.de> PR fortran/52916 PR fortran/40973 * gfortran.h (symbol_attribute): Add public_used. * interface.c (check_sym_interfaces, check_uop_interfaces, gfc_check_interfaces): Set it. * resolve.c (resolve_typebound_procedure): Ditto. * trans-decl.c (build_function_decl): Use it. 2012-04-14 Tobias Burnus <burnus@net-b.de> PR fortran/52916 PR fortran/40973 * gfortran.dg/public_private_module_3.f90: New. * gfortran.dg/public_private_module_4.f90: New. From-SVN: r186464
2012-03-03re PR fortran/48820 (TR 29113: Implement parts needed for MPI 3)Tobias Burnus
2012-03-03 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * decl.c (gfc_match_decl_type_spec): Support type(*). (gfc_verify_c_interop): Allow type(*). * dump-parse-tree.c (show_typespec): Handle type(*). * expr.c (gfc_copy_expr): Ditto. * interface.c (compare_type_rank, compare_parameter, compare_actual_formal, gfc_procedure_use): Ditto. * libgfortran.h (bt): Add BT_ASSUMED. * misc.c (gfc_basic_typename, gfc_typename): Handle type(*). * module.c (bt_types): Ditto. * resolve.c (assumed_type_expr_allowed): New static variable. (resolve_actual_arglist, resolve_variable, resolve_symbol): Handle type(*). * trans-expr.c (gfc_conv_procedure_call): Ditto. * trans-types.c (gfc_typenode_for_spec, gfc_get_dtype): Ditto. 2012-03-03 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * gfortran.dg/assumed_type_1.f90: New. * gfortran.dg/assumed_type_2.f90: New. * gfortran.dg/assumed_type_3.f90: New. * gfortran.dg/assumed_type_4.f90: New. From-SVN: r184852
2012-03-02re PR fortran/52270 ([OOP] Polymorphic vars: wrong intent(in) check, passing ↵Tobias Burnus
nonptr variable to intent(in) ptr dummy) 2012-03-02 Tobias Burnus <burnus@net-b.de> PR fortran/52270 * expr.c (gfc_check_vardef_context): Fix check for intent-in polymorphic pointer . * interface.c (compare_parameter): Allow passing TYPE to intent-in polymorphic pointer. 2012-03-02 Tobias Burnus <burnus@net-b.de> PR fortran/52270 * gfortran.dg/class_51.f90: New. From-SVN: r184784
2012-02-18re PR fortran/52295 (Allow internal procedure in generic interfaces)Tobias Burnus
2012-02-18 Tobias Burnus <burnus@net-b.de> PR fortran/52295 * interface.c (check_interface0): Internal procs in generic interfaces are allowed in Fortran 2008. 2012-02-18 Tobias Burnus <burnus@net-b.de> PR fortran/52295 * gfortran.dg/interface_35.f90: Use -std=f2003. * gfortran.dg/proc_ptr_comp_20.f90: Remove dg-warning. * gfortran.dg/interface_assignment_4.f90: Ditto. * gfortran.dg/bessel_1.f90: Ditto. * gfortran.dg/func_result_6.f90: Ditto. * gfortran.dg/hypot_1.f90: Ditto. * gfortran.dg/proc_ptr_comp_21.f90: Ditto. From-SVN: r184372