aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
AgeCommit message (Collapse)AuthorFilesLines
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
2010-10-07re PR fortran/45933 ([OOP] ICE in gfc_add_component_ref, at fortran/class.c:77)Janus Weil1-3/+2
2010-10-07 Janus Weil <janus@gcc.gnu.org> PR fortran/45933 * resolve.c (resolve_typebound_function): Use correct declared type for type-bound operators. 2010-10-07 Janus Weil <janus@gcc.gnu.org> PR fortran/45933 * gfortran.dg/typebound_operator_5.f03: New. From-SVN: r165126
2010-10-06re PR fortran/45889 (Regression with I/O of element of allocatable array in ↵Jerry DeLisle1-1/+1
derived type) 2010-10-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/45889 * resolve.c (resolve_transfer): Use expression inside parenthesis to find acutal component to be transgferred. From-SVN: r165068
2010-10-06resolve.c (add_dt_to_dt_list): Remove unneeded if.Mikael Morin1-8/+5
2010-10-06 Mikael Morin <mikael@gcc.gnu.org> * resolve.c (add_dt_to_dt_list): Remove unneeded if. From-SVN: r165035
2010-10-06resolve.c (check_typebound_baseobject): Free local expr before returning.Mikael Morin1-4/+9
2010-10-06 Mikael Morin <mikael@gcc.gnu.org> * resolve.c (check_typebound_baseobject): Free local expr before returning. From-SVN: r165034
2010-10-02re PR fortran/45748 (-fimplicit-none failures when using intrinsic MAX)Janus Weil1-5/+3
2010-10-02 Janus Weil <janus@gcc.gnu.org> PR fortran/45748 * resolve.c (resolve_formal_arglist): Avoid setting default type for formal arguments of intrinsic procedures. 2010-10-02 Janus Weil <janus@gcc.gnu.org> PR fortran/45748 * gfortran.dg/intrinsic_6.f90: New. From-SVN: r164901
2010-09-30re PR fortran/45828 (No default initialization of derived type members?)Janus Weil1-2/+2
2010-09-30 Janus Weil <janus@gcc.gnu.org> PR fortran/45828 * resolve.c (resolve_allocate_expr): Do not use 'gfc_has_default_initializer'. 2010-09-30 Janus Weil <janus@gcc.gnu.org> PR fortran/45828 * gfortran.dg/allocate_derived_5.f90: New. From-SVN: r164765
2010-09-27re PR fortran/40569 (F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION())Tobias Burnus1-2/+7
2010-09-27 Tobias Burnus <burnus@net-b.de> PR fortran/40569 PR fortran/40568 * intrinsic.h (gfc_simplify_compiler_options, gfc_simplify_compiler_version): New prototypes. * intrinsic.c (gfc_intrinsic_function_by_id, make_from_module): New functions. (gfc_find_function, gfc_find_subroutine, gfc_generic_intrinsic, gfc_specific_intrinsic): Don't return module intrinsics. (add_functions): Add compiler_options, compiler_version. (gfc_intrinsic_func_interface): Also lookup symbol by ISYM ID. * symbol.c (std_for_isocbinding_symbol): Add version check for NAMED_FUNCTIONS. * iso-fortran-env.def: Add compiler_options, compiler_version. * iso-c-binding.def: Add c_sizeof. * gfortran.h (gfc_intrinsic_sym): Add from_module:1. (iso_c_binding_symbol, iso_fortran_env_symbol): Add NAMED_FUNCTIONS. (gfc_intrinsic_function_by_id): New prototype. * module.c (create_intrinsic_function): New function. (import_iso_c_binding_module, use_iso_fortran_env_module): Use it. * trans-types.c (init_c_interop_kinds): Add NAMED_FUNCTIONS. * resolve.c (resolve_intrinsic): Try also to resolve intrinsics by ISYM ID. * simplify.c (gfc_simplify_compiler_options, gfc_simplify_compiler_version): New functions. 2010-09-27 Tobias Burnus <burnus@net-b.de> PR fortran/40569 PR fortran/40568 * gfortran.dg/storage_size_2.f08: Fix test. * gfortran.dg/c_sizeof_1.f90: Fix test. * gfortran.dg/c_sizeof_2.f90: Update dg-error. * gfortran.dg/c_sizeof_3.f90: New. * gfortran.dg/c_sizeof_4.f90: New. * gfortran.dg/iso_c_binding_compiler_1.f90: New. * gfortran.dg/iso_c_binding_compiler_2.f90: New. From-SVN: r164639
2010-09-26re PR fortran/45783 (ICE in gfc_add_component_ref, at fortran/class.c:77)Daniel Kraft1-3/+7
2010-09-26 Daniel Kraft <d@domob.eu> PR fortran/45783 PR fortran/45795 * resolve.c (resolve_select_type): Clarify code. (resolve_assoc_var): Only set typespec if it is currently unknown. 2010-09-26 Daniel Kraft <d@domob.eu> PR fortran/45783 PR fortran/45795 * gfortran.dg/select_type_18.f03: New test. From-SVN: r164638
2010-09-25re PR fortran/45776 (Full implementation of variable definition contexts ↵Daniel Kraft1-0/+7
(and related checks)) 2010-09-25 Daniel Kraft <d@domob.eu> PR fortran/45776 * gfortran.h (struct gfc_dt): New member `dt_io_kind'. * io.c (resolve_tag): F2008 check for NEWUNIT and variable definition checks for NEWUNIT, IOSTAT, SIZE and IOMSG. (gfc_free_dt): Correctly handle freeing of `dt_io_kind' and `extra_comma' with changed semantics. (gfc_resolve_dt): Check variable definitions. (match_io_element): Remove INTENT and PURE checks here and initialize code->ext.dt member. (match_io): Set dt->dt_io_kind. (gfc_resolve_inquire): Check variable definition for all tags except UNIT, FILE and ID. * resolve.c (resolve_transfer): Variable definition check. 2010-09-25 Daniel Kraft <d@domob.eu> PR fortran/45776 * gfortran.dg/io_constraints_6.f03: New test. * gfortran.dg/io_constraints_7.f03: New test. * gfortran.dg/newunit_2.f90: New test. From-SVN: r164619
2010-09-23re PR fortran/38936 ([F03] ASSOCIATE construct / improved SELECT TYPE (a=>expr))Daniel Kraft1-90/+91
2010-09-23 Daniel Kraft <d@domob.eu> PR fortran/38936 PR fortran/44044 PR fortran/45474 * gfortran.h (gfc_check_vardef_context): New method. (struct symbol_attribute): New flag `select_type_temporary'. * primary.c (gfc_variable_attr): Clarify initialization of ref. (match_variable): Remove PROTECTED check and assignment check for PARAMETERs (this is now done later). * match.c (gfc_match_iterator): Remove INTENT(IN) check. (gfc_match_associate): Defer initialization of newAssoc->variable. (gfc_match_nullify): Remove PURE definability check. (select_type_set_tmp): Set new `select_type_temporary' flag. * expr.c (gfc_check_assign): Remove INTENT(IN) check here. (gfc_check_pointer_assign): Ditto (and other checks removed). (gfc_check_vardef_context): New method. * interface.c (compare_parameter_protected): Removed. (compare_actual_formal): Use `gfc_check_vardef_context' for checks related to INTENT([IN]OUT) arguments. * intrinsic.c (check_arglist): Check INTENT for intrinsics. * resolve.c (gfc_resolve_iterator): Use `gfc_check_vardef_context'. (remove_last_array_ref): New method. (resolve_deallocate_expr), (resolve_allocate_expr): Ditto. (resolve_allocate_deallocate): Ditto (for STAT and ERRMSG). (resolve_assoc_var): Remove checks for definability here. (resolve_select_type): Handle resolving of code->block here. (resolve_ordinary_assign): Remove PURE check. (resolve_code): Do not resolve code->blocks for SELECT TYPE here. Use `gfc_check_vardef_context' for assignments and pointer-assignments. 2010-09-23 Daniel Kraft <d@domob.eu> PR fortran/38936 PR fortran/44044 PR fortran/45474 * gfortran.dg/intrinsic_intent_1.f03: New test. * gfortran.dg/select_type_17.f03: New test. * gfortran.dg/associate_5.f03: More definability tests. * gfortran.dg/enum_2.f90: Check definability. * gfortran.dg/allocatable_dummy_2.f90: Change expected error message. * gfortran.dg/allocate_alloc_opt_2.f90: Ditto. * gfortran.dg/char_expr_2.f90: Ditto. * gfortran.dg/deallocate_alloc_opt_2.f90: Ditto. * gfortran.dg/enum_5.f90: Ditto. * gfortran.dg/equiv_constraint_8.f90: Ditto. * gfortran.dg/impure_assignment_2.f90: Ditto. * gfortran.dg/impure_assignment_3.f90: Ditto. * gfortran.dg/intent_out_1.f90: Ditto. * gfortran.dg/intent_out_3.f90: Ditto. * gfortran.dg/pointer_assign_7.f90: Ditto. * gfortran.dg/pointer_intent_3.f90: Ditto. * gfortran.dg/pr19936_1.f90: Ditto. * gfortran.dg/proc_ptr_comp_3.f90: Ditto. * gfortran.dg/simpleif_2.f90: Ditto. * gfortran.dg/protected_5.f90: Ditto. * gfortran.dg/protected_4.f90: Ditto and remove invalid error check. * gfortran.dg/protected_6.f90: Ditto. * gfortran.dg/protected_7.f90: Ditto. From-SVN: r164550
2010-09-15re PR fortran/45577 (Bogus(?) "... type incompatible with source-expr ..." ↵Janus Weil1-4/+10
error) 2010-09-15 Janus Weil <janus@gcc.gnu.org> PR fortran/45577 * resolve.c (resolve_allocate_expr): Do default initialization via EXEC_INIT_ASSIGN. 2010-09-15 Janus Weil <janus@gcc.gnu.org> PR fortran/45577 * gfortran.dg/allocate_derived_4.f90: New. From-SVN: r164305
2010-09-10gfortran.h (gfc_expr): Remove inline_noncopying_intrinsic attribute.Mikael Morin1-30/+0
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-04re PR fortran/45530 (gfortran internal compiler error)Tobias Burnus1-40/+40
2010-09-04 Tobias Burnus <burnus@net-b.de> PR fortran/45530 * resolve.c (resolve_fl_namelist): Change constraint checking order to prevent endless loop. 2010-09-04 Tobias Burnus <burnus@net-b.de> PR fortran/45530 * gfortran.dg/namelist_63.f90: New. From-SVN: r163862
2010-09-04re PR fortran/45507 (Bogus Error: Can't convert TYPE(c_ptr) to INTEGER(4))Janus Weil1-0/+28
2010-09-04 Janus Weil <janus@gcc.gnu.org> PR fortran/45507 * resolve.c (resolve_allocate_expr): Generate default initializers already at this point, resolve them and put them into expr3, ... * trans-stmt.c (gfc_trans_allocate): ... instead of waiting until translation stage. 2010-09-04 Janus Weil <janus@gcc.gnu.org> PR fortran/45507 * gfortran.dg/allocate_alloc_opt_12.f90: New. From-SVN: r163856
2010-09-03re PR fortran/34162 (F2008: Allow internal procedures as actual argument)Daniel Kraft1-2/+5
2010-09-03 Daniel Kraft <d@domob.eu> PR fortran/34162 * resolve.c (resolve_actual_arglist): Allow internal procedure as actual argument with Fortran 2008. 2010-09-03 Daniel Kraft <d@domob.eu> PR fortran/34162 * gfortran.dg/internal_dummy_1.f90: Add -std=f2003. * gfortran.dg/internal_dummy_2.f08: New test. * gfortran.dg/internal_dummy_3.f08: New test. * gfortran.dg/internal_dummy_4.f08: New test. From-SVN: r163813
2010-09-03re PR fortran/44602 ([F2008] EXIT: Jump to end of construct)Daniel Kraft1-1/+4
2010-09-03 Daniel Kraft <d@domob.eu> PR fortran/44602 * gfortran.h (struct gfc_code): Renamed `whichloop' to `which_construct' as this is no longer restricted to loops. * parse.h (struct gfc_state_data): New field `construct'. * match.c (match_exit_cycle): Handle EXIT from non-loops. * parse.c (push_state): Set `construct' field. * resolve.c (resolve_select_type): Extend comment. * trans-stmt.c (gfc_trans_if): Add exit label. (gfc_trans_block_construct), (gfc_trans_select): Ditto. (gfc_trans_simple_do): Store exit/cycle labels on the gfc_code itself. (gfc_trans_do), (gfc_trans_do_while): Ditto. (gfc_trans_exit): Use new name `which_construct' instead of `whichloop'. (gfc_trans_cycle): Ditto. (gfc_trans_if_1): Use fold_build3_loc instead of fold_build3. 2010-09-03 Daniel Kraft <d@domob.eu> PR fortran/44602 * gfortran.dg/exit_2.f08; Adapt error messages. * gfortran.dg/exit_3.f08: New test. * gfortran.dg/exit_4.f08: New test. * gfortran.dg/exit_5.f03: New test. From-SVN: r163798
2010-09-02re PR fortran/44541 ([OOP] wrong code for polymorphic variable with ↵Janus Weil1-1/+2
INTENT(OUT)/Alloc w/ MOLD) 2010-09-02 Janus Weil <janus@gcc.gnu.org> PR fortran/44541 * resolve.c (resolve_symbol): Correct check for attributes of CLASS variable. From-SVN: r163773
2010-09-02re PR fortran/45489 (Default initialization of derived-type function result ↵Tobias Burnus1-5/+3
missing) 2010-09-02 Tobias Burnus <burnus@net-b.de> PR fortran/45489 * resolve.c (apply_default_init): Mark symbol as referenced, if it is initialized. (resolve_symbol): Change intialized check for BT_DERIVED such that also function results get initialized; remove now obsolete gfc_set_sym_referenced for BT_CLASS. 2010-09-02 Tobias Burnus <burnus@net-b.de> PR fortran/45489 * gfortran.dg/initialization_27.f90: New. From-SVN: r163767
2010-09-01re PR fortran/44541 ([OOP] wrong code for polymorphic variable with ↵Janus Weil1-35/+12
INTENT(OUT)/Alloc w/ MOLD) 2010-09-01 Janus Weil <janus@gcc.gnu.org> PR fortran/44541 * class.c (gfc_find_derived_vtab): Add component '$def_init'. * resolve.c (resolve_allocate_expr): Defer handling of default initialization to 'gfc_trans_allocate'. (apply_default_init,resolve_symbol): Handle polymorphic dummies. (resolve_fl_derived): Suppress error messages for vtypes. * trans-stmt.c (gfc_trans_allocate): Handle initialization via polymorphic MOLD expression. * trans-expr.c (gfc_trans_class_init_assign): Now only used for dummy initialization. 2010-09-01 Janus Weil <janus@gcc.gnu.org> PR fortran/44541 * gfortran.dg/allocate_alloc_opt_10.f90: Extended. * gfortran.dg/class_dummy_1.f03: New. From-SVN: r163744
2010-08-30re PR fortran/45456 ([OOP] Bogus pointer initialization error on ↵Janus Weil1-1/+2
pointer-valued TBP) 2010-08-30 Janus Weil <janus@gcc.gnu.org> PR fortran/45456 * resolve.c (resolve_structure_cons): Handle pointer-valued PPCs. 2010-08-30 Janus Weil <janus@gcc.gnu.org> PR fortran/45456 * gfortran.dg/typebound_proc_18.f03: New. From-SVN: r163661
2010-08-29re PR fortran/42769 ([OOP] ICE in resolve_typebound_procedure)Janus Weil1-0/+8
2010-08-29 Janus Weil <janus@gcc.gnu.org> PR fortran/42769 * resolve.c (resolve_structure_cons): For derived types, make sure the type has been resolved. (resolve_typebound_procedures): Make sure the vtab has been generated. 2010-08-29 Janus Weil <janus@gcc.gnu.org> PR fortran/42769 * gfortran.dg/dynamic_dispatch_11.f03: New. From-SVN: r163631
2010-08-26re PR fortran/38936 ([F03] ASSOCIATE construct / improved SELECT TYPE (a=>expr))Daniel Kraft1-100/+135
2010-08-26 Daniel Kraft <d@domob.eu> PR fortran/38936 PR fortran/44047 PR fortran/45384 * gfortran.h (struct gfc_association_list): New flag `dangling'. (gfc_build_block_ns): Declared here... * parse.h (gfc_build_block_ns): ...instead of here. * trans.h (gfc_process_block_locals): Expect additionally the gfc_association_list of BLOCK (if present). * match.c (select_type_set_tmp): Create sym->assoc for temporary. * resolve.c (resolve_variable): Only check for invalid *array* references on associate-names. (resolve_assoc_var): New method with code previously in resolve_symbol. (resolve_select_type): Use association to give the selector and temporaries their values instead of ordinary assignment. (resolve_fl_var_and_proc): Allow CLASS associate-names. (resolve_symbol): Use new `resolve_assoc_var' instead of inlining here. * trans-stmt.c (gfc_trans_block_construct): Pass association-list to `gfc_process_block_locals' to match new interface. * trans-decl.c (gfc_get_symbol_decl): Don't defer associate-names here automatically. (gfc_process_block_locals): Defer them rather here when linked to from the BLOCK's association list. 2010-08-26 Daniel Kraft <d@domob.eu> PR fortran/38936 PR fortran/44047 PR fortran/45384 * gfortran.dg/associate_8.f03: New test. * gfortran.dg/select_type_13.f03: New test. * gfortran.dg/select_type_14.f03: New test. From-SVN: r163572
2010-08-23re PR fortran/45366 (Problem with procedure pointer dummy in PURE function)Janus Weil1-76/+90
2010-08-23 Janus Weil <janus@gcc.gnu.org> PR fortran/45366 * resolve.c (resolve_procedure_interface): New function split off from 'resolve_symbol'. (resolve_formal_arglist): Call it here ... (resolve_symbol): ... and here. 2010-08-23 Janus Weil <janus@gcc.gnu.org> PR fortran/45366 * gfortran.dg/proc_ptr_29.f90: New. From-SVN: r163468
2010-08-19re PR fortran/41859 (ICE on invalid expression involving DT with pointer ↵Jerry DeLisle1-1/+6
components in I/O) 2010-08-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/41859 * resolve.c (resolve_transfer): Traverse operands and set expression to be checked to a non EXPR_OP type. From-SVN: r163363
2010-08-19re PR fortran/45290 ([F08] pointer initialization)Janus Weil1-6/+33
2010-08-19 Janus Weil <janus@gcc.gnu.org> PR fortran/45290 * gfortran.h (gfc_add_save): Modified prototype. * decl.c (add_init_expr_to_sym): Defer checking of proc pointer init. (match_pointer_init): New function to match F08 pointer initialization. (variable_decl,match_procedure_decl,match_ppc_decl): Use 'match_pointer_init'. (match_attr_spec): Module variables are implicitly SAVE. (gfc_match_save): Modified call to 'gfc_add_save'. * expr.c (gfc_check_assign_symbol): Extra checks for pointer initialization. * primary.c (gfc_variable_attr): Handle SAVE attribute. * resolve.c (resolve_structure_cons): Add new argument and do pointer initialization checks. (gfc_resolve_expr): Modified call to 'resolve_structure_cons'. (resolve_values): Call 'resolve_structure_cons' directly with init arg. (resolve_fl_variable): Handle SAVE_IMPLICIT. * symbol.c (gfc_add_save,gfc_copy_attr,save_symbol): Handle SAVE_IMPLICIT. * trans-decl.c (gfc_create_module_variable): Module variables with TARGET can already exist. * trans-expr.c (gfc_conv_variable): Check for 'current_function_decl'. (gfc_conv_initializer): Implement non-NULL pointer initialization. 2010-08-19 Janus Weil <janus@gcc.gnu.org> PR fortran/45290 * gfortran.dg/proc_ptr_comp_3.f90: Modified. * gfortran.dg/pointer_init_2.f90: New. * gfortran.dg/pointer_init_3.f90: New. * gfortran.dg/pointer_init_4.f90: New. From-SVN: r163356
2010-08-17re PR fortran/38936 ([F03] ASSOCIATE construct / improved SELECT TYPE (a=>expr))Daniel Kraft1-68/+46
2010-08-17 Daniel Kraft <d@domob.eu> PR fortran/38936 * gfortran.h (struct gfc_association_list): New member `where'. (gfc_is_associate_pointer) New method. * match.c (gfc_match_associate): Remember locus for each associate name matched and do not try to set variable flag. * parse.c (parse_associate): Use remembered locus for symbols. * primary.c (match_variable): Instead of variable-flag check for associate names set it for all such names used. * symbol.c (gfc_is_associate_pointer): New method. * resolve.c (resolve_block_construct): Don't generate assignments to give associate-names their values. (resolve_fl_var_and_proc): Allow associate-names to be deferred-shape. (resolve_symbol): Set some more attributes for associate variables, set variable flag here and check it and don't try to build an explicitely shaped array-spec for array associate variables. * trans-expr.c (gfc_conv_variable): Dereference in case of association to scalar variable. * trans-types.c (gfc_is_nodesc_array): Handle array association symbols. (gfc_sym_type): Return pointer type for association to scalar vars. * trans-decl.c (gfc_get_symbol_decl): Defer association symbols. (trans_associate_var): New method. (gfc_trans_deferred_vars): Handle association symbols. 2010-08-17 Daniel Kraft <d@domob.eu> PR fortran/38936 * gfortran.dg/associate_1.f03: Extended to test newly supported features like association to variables. * gfortran.dg/associate_3.f03: Removed check for illegal change of associate-name here... * gfortran.dg/associate_5.f03: ...and added it here. * gfortran.dg/associate_6.f03: No longer XFAIL'ed. * gfortran.dg/associate_7.f03: New test. From-SVN: r163295
2010-08-15re PR fortran/38936 ([F03] ASSOCIATE construct / improved SELECT TYPE (a=>expr))Daniel Kraft1-5/+100
2010-08-15 Daniel Kraft <d@domob.eu> PR fortran/38936 * gfortran.h (gfc_find_proc_namespace): New method. * expr.c (gfc_build_intrinsic_call): No need to build symtree messing around with namespace. * symbol.c (gfc_find_proc_namespace): New method. * trans-decl.c (gfc_build_qualified_array): Use it for correct value of nest. * primary.c (gfc_match_varspec): Handle associate-names as arrays. * parse.c (parse_associate): Removed assignment-generation here... * resolve.c (resolve_block_construct): ...and added it here. (resolve_variable): Handle names that are arrays but were not parsed as such because of association. (resolve_code): Fix BLOCK resolution. (resolve_symbol): Generate array-spec for associate-names. 2010-08-15 Daniel Kraft <d@domob.eu> PR fortran/38936 * gfortran.dg/associate_1.f03: Enable test for array expressions. * gfortran.dg/associate_3.f03: Clarify comment. * gfortran.dg/associate_5.f03: New test. * gfortran.dg/associate_6.f03: New test. From-SVN: r163268
2010-08-15re PR fortran/45197 ([F2008] Allow IMPURE elemental procedures)Daniel Kraft1-2/+18
2010-08-15 Daniel Kraft <d@domob.eu> PR fortran/45197 * decl.c (gfc_match_prefix): Match IMPURE prefix and mark ELEMENTAL routines not IMPURE also as PURE. * intrinsic.c (enum klass): New class `CLASS_PURE' and renamed `NO_CLASS' in `CLASS_IMPURE'. (add_sym): Set symbol-attributes `pure' and `elemental' correctly. (add_sym_0s): Renamed `NO_CLASS' in `CLASS_IMPURE'. (add_functions): Ditto. (add_subroutines): Ditto and mark `MOVE_ALLOC' as CLASS_PURE. * resolve.c (gfc_pure): Do not treat ELEMENTAL as automatically PURE. (resolve_formal_arglist): Check that arguments to ELEMENTAL procedures are not ALLOCATABLE and have their INTENT specified. 2010-08-15 Daniel Kraft <d@domob.eu> PR fortran/45197 * gfortran.dg/elemental_args_check_3.f90: New test. * gfortran.dg/impure_1.f08: New test. * gfortran.dg/impure_2.f08: New test. * gfortran.dg/impure_3.f90: New test. * gfortran.dg/typebound_proc_6.f03: Changed expected error message. From-SVN: r163261
2010-08-13gfortran.h (array_type): New type `AS_IMPLIED_SHAPE'.Daniel Kraft1-12/+16
2010-08-13 Daniel Kraft <d@domob.eu> * gfortran.h (array_type): New type `AS_IMPLIED_SHAPE'. * array.c (gfc_match_array_spec): Match implied-shape specification and handle AS_IMPLIED_SHAPE correctly otherwise. * decl.c (add_init_expr_to_sym): Set upper bounds for implied-shape. (variable_decl): Some checks for implied-shape declaration. * resolve.c (resolve_symbol): Assert that array-spec is no longer AS_IMPLIED_SHAPE in any case. 2010-08-13 Daniel Kraft <d@domob.eu> * gfortran.dg/implied_shape_1.f08: New test. * gfortran.dg/implied_shape_2.f90: New test. * gfortran.dg/implied_shape_3.f08: New test. From-SVN: r163221
2010-08-09re PR fortran/44235 (array temporary with high upper bound)Thomas Koenig1-0/+32
2010-08-09 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/44235 * array.c (gfc_ref_dimen_size): Add end argument. If end is non-NULL, calculate it. (ref_size): Adjust call to gfc_ref_dimen_size. (gfc_array_dimen_size): Likewise. (gfc_array_res_shape): Likewise. * gfortran.h: Adjust prototype for gfc_ref_dimen_size. * resolve.c (resolve_array_ref): For stride not equal to -1, fill in the lowest possible end. 2010-08-09 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/44235 * gfortran.dg/dependency_32.f90: New test. From-SVN: r163041
2010-08-04re PR fortran/42207 ([OOP] Compile-time errors on typed allocation and ↵Janus Weil1-0/+12
pointer function result assignment) 2010-08-04 Janus Weil <janus@gcc.gnu.org> PR fortran/42207 PR fortran/44064 PR fortran/44065 * class.c (gfc_find_derived_vtab): Do not generate vtabs for class container types. Do not artificially increase refs. Commit symbols one by one. * interface.c (compare_parameter): Make sure vtabs are present before generating module variables. * resolve.c (resolve_allocate_expr): Ditto. 2010-08-04 Janus Weil <janus@gcc.gnu.org> PR fortran/42207 PR fortran/44064 PR fortran/44065 * gfortran.dg/class_25.f03: New. * gfortran.dg/class_26.f03: New. From-SVN: r162879
2010-08-04re PR fortran/45183 (FAIL: gfortran.dg/derived_constructor_char_1.f90)Tobias Burnus1-3/+18
2010-08-04 Tobias Burnus <burnus@net-b.de> PR fortran/45183 PR fortran/44857 * resolve.c (resolve_structure_cons): Fix freeing of charlen. From-SVN: r162871
2010-08-04re PR fortran/44857 (ICE in output_constructor_regular_field, at varasm.c:4996)Tobias Burnus1-0/+46
2010-08-04 Tobias Burnus <burnus@net-b.de> PR fortran/44857 * resolve.c (resolve_structure_cons): Fix handling of initialization structcture constructors with character elements of the wrong length. * array.c (gfc_check_iter_variable): Add NULL check. (gfc_resolve_character_array_constructor): Also truncate character length. 2010-08-04 Tobias Burnus <burnus@net-b.de> PR fortran/44857 * gfortran.dg/derived_constructor_char_1.f90: New. * gfortran.dg/derived_constructor_char_2.f90: New. From-SVN: r162863
2010-08-03re PR fortran/44584 (Invalid memory access with ↵Janus Weil1-1/+1
gfortran.dg/typebound_proc_15.f03) 2010-08-03 Janus Weil <janus@gcc.gnu.org> PR fortran/44584 PR fortran/45161 * class.c (add_procs_to_declared_vtab1): Don't add erroneous procedures. * resolve.c (resolve_tb_generic_targets): Check for errors. 2010-08-03 Janus Weil <janus@gcc.gnu.org> PR fortran/44584 PR fortran/45161 * gfortran.dg/typebound_call_9.f03: Modified. * gfortran.dg/typebound_generic_1.f03: Modified. From-SVN: r162840
2010-07-30gfortran.h (gfc_release_symbol): New prototype.Mikael Morin1-3/+1
2010-07-30 Mikael Morin <mikael@gcc.gnu.org> * gfortran.h (gfc_release_symbol): New prototype. * symbol.c (gfc_release_symbol): New. Code taken from free_sym_tree. (gfc_undo_symbols, free_sym_tree, gfc_free_finalizer): Use gfc_release_symbol. * parse.c (gfc_fixup_sibling_symbols): Ditto. * resolve.c (resolve_symbol): Ditto. From-SVN: r162719
2010-07-29re PR fortran/44962 ([OOP] ICE with specification expression SIZE(<CLASS>))Janus Weil1-20/+4
2010-07-29 Janus Weil <janus@gcc.gnu.org> PR fortran/44962 * resolve.c (resolve_fl_derived): Call gfc_resolve_array_spec. 2010-07-29 Janus Weil <janus@gcc.gnu.org> PR fortran/44962 * gfortran.dg/typebound_proc_17.f03: New. From-SVN: r162695
2010-07-27re PR fortran/40873 (-fwhole-file -fwhole-program: Wrong decls cause too ↵Tobias Burnus1-8/+15
much to be optimized away) 2010-07-26 Tobias Burnus <burnus@net-b.de> PR fortran/40873 * trans-decl.c (gfc_get_extern_function_decl): Fix generation for functions which are later in the same file. (gfc_create_function_decl, build_function_decl, build_entry_thunks): Add global argument. * trans.c (gfc_generate_module_code): Update gfc_create_function_decl call. * trans.h (gfc_create_function_decl): Update prototype. * resolve.c (resolve_global_procedure): Also resolve for IFSRC_IFBODY. 2010-07-26 Tobias Burnus <burnus@net-b.de> PR fortran/40873 * gfortran.dg/whole_file_22.f90: New test. * gfortran.dg/whole_file_23.f90: New test. From-SVN: r162557
2010-07-25re PR fortran/40628 (Assignment using "= trim(string)": Optimize "trim" away)Thomas Koenig1-0/+2
2010-07-25 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/40628 * Make-lang.in: Add fortran/frontend-passes.o. * gfortran.h: Add prototype for gfc_run_passes. * resolve.c (gfc_resolve): Call gfc_run_passes. * frontend-passes.c: New file. 2010-07-25 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/40628 * trim_optimize_1.f90: New test. * character_comparision_1.f90: New test. From-SVN: r162519
2010-07-23re PR fortran/45030 (-fwhole-file: Bogus error message with ENTRY and ↵Tobias Burnus1-15/+28
different result types) 2010-07-23 Tobias Burnus <burnus@net-b.de> PR fortran/45030 * resolve.c (resolve_global_procedure): Properly handle ENTRY. From-SVN: r162486