summaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
AgeCommit message (Collapse)Author
2014-02-212014-02-21 Janus Weil <janus@gcc.gnu.org>janus
PR fortran/60302 * check.c (gfc_check_c_f_pointer): Only clear 'size' if 'gfc_array_size' is successful. 2014-02-21 Janus Weil <janus@gcc.gnu.org> PR fortran/60302 * gfortran.dg/c_f_pointer_shape_tests_6.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208033 138bc75d-0d04-0410-961f-82ee72b054a4
2014-01-02Update copyright years in gcc/rsandifo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206289 138bc75d-0d04-0410-961f-82ee72b054a4
2013-12-182013-12-18 Janus Weil <janus@gcc.gnu.org>janus
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206101 138bc75d-0d04-0410-961f-82ee72b054a4
2013-11-052013-11-05 Steven G. Kargl <kargl@gcc.gnu.org>kargl
PR fortran/58989 * check.c (gfc_check_reshape): ensure that shape is a constant expression. 2013-11-05 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/58989 * gfortran.dg/reshape_6.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204419 138bc75d-0d04-0410-961f-82ee72b054a4
2013-07-272013-07-27 Janus Weil <janus@gcc.gnu.org>janus
PR fortran/57285 * check.c (dim_rank_check): Re-enable this check for CLASS arrays. 2013-07-27 Janus Weil <janus@gcc.gnu.org> PR fortran/57285 * gfortran.dg/class_array_19.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201284 138bc75d-0d04-0410-961f-82ee72b054a4
2013-07-212013-07-21 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/57894 * check.c (min_max_args): Add keyword= check. 2013-07-21 Tobias Burnus <burnus@net-b.de> PR fortran/57894 * gfortran.dg/min_max_conformance_2.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201092 138bc75d-0d04-0410-961f-82ee72b054a4
2013-07-082013-07-08 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/57834 * check.c (is_c_interoperable): Add special case for * c_f_pointer. (explicit-size, gfc_check_c_f_pointer, gfc_check_c_loc): Update call. 2013-07-08 Tobias Burnus <burnus@net-b.de> PR fortran/57834 * gfortran.dg/c_f_pointer_tests_8.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200794 138bc75d-0d04-0410-961f-82ee72b054a4
2013-04-222013-04-22 Janus Weil <janus@gcc.gnu.org>janus
PR fortran/53685 PR fortran/57022 * check.c (gfc_calculate_transfer_sizes): Fix for array-valued SOURCE expressions. * simplify.c (gfc_simplify_sizeof,gfc_simplify_storage_size): Get rid of special treatment for EXPR_ARRAY. * target-memory.h (gfc_element_size): New prototype. * target-memory.c (size_array): Remove. (gfc_element_size): New function. (gfc_target_expr_size): Modified to always return the full size of the expression. 2013-04-22 Janus Weil <janus@gcc.gnu.org> PR fortran/53685 PR fortran/57022 * gfortran.dg/transfer_check_4.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198155 138bc75d-0d04-0410-961f-82ee72b054a4
2013-04-10Replace enum gfc_try with bool type.jb
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197682 138bc75d-0d04-0410-961f-82ee72b054a4
2013-04-042013-04-04 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/50269 * gcc/fortran/check.c (is_c_interoperable, gfc_check_c_loc): Correct c_loc array checking for Fortran 2003 and Fortran 2008. 2013-04-04 Tobias Burnus <burnus@net-b.de> PR fortran/50269 * gfortran.dg/c_loc_test_21.f90: New. * gfortran.dg/c_loc_test_19.f90: Update dg-error. * gfortran.dg/c_loc_tests_10.f03: Update dg-error. * gfortran.dg/c_loc_tests_11.f03: Update dg-error. * gfortran.dg/c_loc_tests_4.f03: Update dg-error. * gfortran.dg/c_loc_tests_16.f90: Update dg-error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197468 138bc75d-0d04-0410-961f-82ee72b054a4
2013-03-272013-03-27 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/56650 PR fortran/36437 * check.c (gfc_check_sizeof, gfc_check_c_sizeof, gfc_check_storage_size): Update checks. * intrinsic.texi (SIZEOF): Correct class. * intrinsic.h (gfc_simplify_sizeof, gfc_simplify_storage_size): New prototypes. * intrinsic.c (add_functions): Use them. * simplify.c (gfc_simplify_sizeof, gfc_simplify_storage_size): New functions. 2013-03-27 Tobias Burnus <burnus@net-b.de> PR fortran/56650 PR fortran/36437 * gfortran.dg/sizeof_2.f90: New. * gfortran.dg/sizeof_3.f90: New. * gfortran.dg/sizeof_proc.f90: Update dg-error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197159 138bc75d-0d04-0410-961f-82ee72b054a4
2013-03-252013-03-25 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/38536 PR fortran/38813 PR fortran/38894 PR fortran/39288 PR fortran/40963 PR fortran/45824 PR fortran/47023 PR fortran/47034 PR fortran/49023 PR fortran/50269 PR fortran/50612 PR fortran/52426 PR fortran/54263 PR fortran/55343 PR fortran/55444 PR fortran/55574 PR fortran/56079 PR fortran/56378 * check.c (gfc_var_strlen): Properly handle 0-sized string. (gfc_check_c_sizeof): Use is_c_interoperable, add checks. (is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer, gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New functions. * expr.c (check_inquiry): Add c_sizeof, compiler_version and compiler_options. (gfc_check_pointer_assign): Refine function result check. gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED, GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC, GFC_ISYM_C_LOC. (iso_fortran_env_symbol, iso_c_binding_symbol): Handle NAMED_SUBROUTINE. (generate_isocbinding_symbol): Update prototype. (get_iso_c_sym): Remove. (gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes. * intrinsic.c (gfc_intrinsic_subroutine_by_id): New function. (gfc_intrinsic_sub_interface): Use it. (add_functions, add_subroutines): Add missing C-binding intrinsics. (gfc_intrinsic_func_interface): Add special case for c_loc. gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions. (gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them. * intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer, gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc, gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes. * iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New functions. * iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and NAMED_FUNCTION. * iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness. * module.c (create_intrinsic_function): Support subroutines and derived-type results. (use_iso_fortran_env_module): Update calls. (import_iso_c_binding_module): Ditto; update calls to generate_isocbinding_symbol. * resolve.c (find_arglists): Skip for intrinsic symbols. (gfc_resolve_intrinsic): Find intrinsic subs via id. (is_scalar_expr_ptr, gfc_iso_c_func_interface, set_name_and_label, gfc_iso_c_sub_interface): Remove. (resolve_function, resolve_specific_s0): Remove calls to those. (resolve_structure_cons): Fix handling. * symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr generation. (gen_cptr_param, gen_fptr_param, gen_shape_param, build_formal_args, get_iso_c_sym): Remove. (std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE. (generate_isocbinding_symbol): Support hidden symbols and using c_ptr/c_funptr symtrees for nullptr defs. * target-memory.c (gfc_target_encode_expr): Fix handling of c_ptr/c_funptr. * trans-expr.c (conv_isocbinding_procedure): Remove. (gfc_conv_procedure_call): Remove call to it. (gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling of c_ptr/c_funptr. * trans-intrinsic.c (conv_isocbinding_function, conv_isocbinding_subroutine): New. (gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine): Call them. * trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr. * trans-types.c (gfc_typenode_for_spec, gfc_get_derived_type): Ditto. (gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE. 2013-03-25 Tobias Burnus <burnus@net-b.de> PR fortran/38536 PR fortran/38813 PR fortran/38894 PR fortran/39288 PR fortran/40963 PR fortran/45824 PR fortran/47023 PR fortran/47034 PR fortran/49023 PR fortran/50269 PR fortran/50612 PR fortran/52426 PR fortran/54263 PR fortran/55343 PR fortran/55444 PR fortran/55574 PR fortran/56079 PR fortran/56378 * gfortran.dg/c_assoc_2.f03: Update dg-error wording. * gfortran.dg/c_f_pointer_shape_test.f90: Ditto. * gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto. * gfortran.dg/c_f_pointer_tests_5.f90: Ditto. * gfortran.dg/c_funloc_tests_2.f03: Ditto. * gfortran.dg/c_funloc_tests_5.f03: Ditto. * gfortran.dg/c_funloc_tests_6.f90: Ditto. * gfortran.dg/c_loc_tests_10.f03: Add -std=f2008. * gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error. * gfortran.dg/c_loc_tests_16.f90: Ditto. * gfortran.dg/c_loc_tests_4.f03: Ditto. * gfortran.dg/c_loc_tests_15.f90: Update dg-error wording. * gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5. * gfortran.dg/c_loc_tests_8.f03: Ditto. * gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times. * gfortran.dg/c_ptr_tests_15.f90: Ditto. * gfortran.dg/c_sizeof_1.f90: Fix invalid code. * gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording. * gfortran.dg/pr32601_1.f03: Ditto. * gfortran.dg/storage_size_2.f08: Remove dg-error. * gfortran.dg/blockdata_7.f90: New. * gfortran.dg/c_assoc_4.f90: New. * gfortran.dg/c_f_pointer_tests_6.f90: New. * gfortran.dg/c_f_pointer_tests_7.f90: New. * gfortran.dg/c_funloc_tests_8.f90: New. * gfortran.dg/c_loc_test_17.f90: New. * gfortran.dg/c_loc_test_18.f90: New. * gfortran.dg/c_loc_test_19.f90: New. * gfortran.dg/c_loc_test_20.f90: New. * gfortran.dg/c_sizeof_5.f90: New. * gfortran.dg/iso_c_binding_rename_3.f90: New. * gfortran.dg/transfer_resolve_2.f90: New. * gfortran.dg/transfer_resolve_3.f90: New. * gfortran.dg/transfer_resolve_4.f90: New. * gfortran.dg/pr32601.f03: Update dg-error. * gfortran.dg/c_ptr_tests_13.f03: Update dg-error. * gfortran.dg/c_ptr_tests_9.f03: Fix test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197053 138bc75d-0d04-0410-961f-82ee72b054a4
2013-02-092013-02-09 Paul Thomas <pault@gcc.gnu.org>pault
PR fortran/55362 * check.c (array_check): It is an error if a procedure is passed. 2013-02-09 Paul Thomas <pault@gcc.gnu.org> PR fortran/55362 * gfortran.dg/intrinsic_size_4.f90 : New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195915 138bc75d-0d04-0410-961f-82ee72b054a4
2013-01-272013-01-27 Paul Thomas <pault@gcc.gnu.org>pault
PR fortran/55789 PR fortran/56047 * gfortran.h : Add associate_var to symbol_attr. * resolve.c (resolve_assoc_var): Set associate_var attribute. If the target class_ok is set, set it for the associate variable. * check.c (allocatable_check): Associate variables should not have the allocatable attribute even if their symbols do. * class.c (gfc_build_class_symbol): Symbols with associate_var set will always have a good class container. 2013-01-27 Paul Thomas <pault@gcc.gnu.org> PR fortran/55789 * gfortran.dg/associate_14.f90: New test. PR fortran/56047 * gfortran.dg/associate_13.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195492 138bc75d-0d04-0410-961f-82ee72b054a4
2013-01-10Update copyright years in gcc/rsandifo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195098 138bc75d-0d04-0410-961f-82ee72b054a4
2012-12-282012-12-28 Janus Weil <janus@gcc.gnu.org>janus
PR fortran/55692 * check.c (gfc_check_associated): Remove a "gcc_assert (0)". 2012-12-28 Janus Weil <janus@gcc.gnu.org> PR fortran/55692 * gfortran.dg/associated_7.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194744 138bc75d-0d04-0410-961f-82ee72b054a4
2012-12-282012-12-28 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/55763 * check.c (gfc_check_move_alloc): Handle unlimited polymorphic. * trans-intrinsic.c (conv_intrinsic_move_alloc): Ditto. 2012-12-28 Tobias Burnus <burnus@net-b.de> PR fortran/55763 * gfortran.dg/unlimited_polymorphic_5.f90 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194743 138bc75d-0d04-0410-961f-82ee72b054a4
2012-12-202012-12-19 Paul Thomas <pault@gcc.gnu.org>pault
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194622 138bc75d-0d04-0410-961f-82ee72b054a4
2012-10-282012-10-28 Tobias Burnus <burnus@net-b.de>burnus
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192896 138bc75d-0d04-0410-961f-82ee72b054a4
2012-09-152012-09-15 Tobias Burnus <burnus@net-b.de>burnus
* arith.c (arith_power): Call gfc_free_expr in case of error. * array.c (gfc_match_array_constructor): Initialize variable. (gfc_resolve_character_array_constructor): Remove superfluous check. (gfc_array_dimen_size): Add assert. * check.c (numeric_check): Fix implicit typing. * class.c (gfc_build_class_symbol): Add assert. (finalize_component): Free memory. * dump-parse-tree.c (show_namespace): Add assert. * trans-io.c (transfer_namelist_element, transfer_expr): Avoid memory leakage. (gfc_trans_transfer): Add assert. * trans.c (gfc_trans_runtime_check): Call va_end git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191344 138bc75d-0d04-0410-961f-82ee72b054a4
2012-08-142012-08-14 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/54234 * check.c (gfc_check_cmplx): Add -Wconversion warning when converting higher-precision REAL to default-precision CMPLX without kind= parameter. 2012-08-14 Tobias Burnus <burnus@net-b.de> PR fortran/54234 * gfortran.dg/warn_conversion_4.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190378 138bc75d-0d04-0410-961f-82ee72b054a4
2012-07-202012-07-20 Tobias Burnus <burnus@net-b.de>burnus
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189700 138bc75d-0d04-0410-961f-82ee72b054a4
2012-07-172012-07-17 Janus Weil <janus@gcc.gnu.org>janus
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189589 138bc75d-0d04-0410-961f-82ee72b054a4
2012-07-08 * gfortran.h: Do not include coretypes.h here.steven
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189357 138bc75d-0d04-0410-961f-82ee72b054a4
2012-06-182012-06-18 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/53526 * check.c (gfc_check_move_alloc): Reject coindexed actual * arguments and those with different corank. 2012-06-18 Tobias Burnus <burnus@net-b.de> PR fortran/53526 * gfortran.dg/coarray_27.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188747 138bc75d-0d04-0410-961f-82ee72b054a4
2012-06-172012-06-17 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/53691 PR fortran/53685 * check.c (gfc_calculate_transfer_sizes): Return if SIZE= is not constant or source-size cannot be determined. 2012-06-17 Tobias Burnus <burnus@net-b.de> PR fortran/53691 PR fortran/53685 * gfortran.dg/transfer_check_3.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188708 138bc75d-0d04-0410-961f-82ee72b054a4
2012-06-032012-06-03 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>burnus
Tobias Burnus <burnus@net-b.de> PR fortran/48831 * gfortran.h (gfc_check_init_expr): Add prototype declaration of function. * check.c (kind_check): Change if condition to use to gfc_check_init_expr. * expr.c (check_init_expr): Remove forward declaration and static keyword. Change name in gfc_check_init_expr. 2012-06-03 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com> PR fortran/48831 * gfortran.dg/parameter_array_element_2.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188152 138bc75d-0d04-0410-961f-82ee72b054a4
2012-02-172012-02-17 Tobias Burnus <burnus@net-b.de>burnus
Roland Stigge <stigge@antcom.de> PR translation/52232 PR translation/52234 PR translation/52245 PR translation/52246 PR translation/52262 PR translation/52273 * io.c (gfc_match_open): Fix typo. * interface.c (compare_actual_formal): Ditto. * lang.opt (freal-4-real-8, freal-4-real-16, freal-8-real-16): * Ditto. * match.c (alloc_opt_list, gfc_match_nullify): Ditto. * check.c (gfc_check_associated, gfc_check_null): Ditto. 2012-02-17 Tobias Burnus <burnus@net-b.de> PR translation/52232 PR translation/52234 PR translation/52245 PR translation/52246 PR translation/52262 PR translation/52273 * gfortran.dg/coarray_22.f90: Update dg-error. * gfortran.dg/allocate_alloc_opt_4.f90: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184331 138bc75d-0d04-0410-961f-82ee72b054a4
2012-01-232012-01-23 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/51948 * check.c (variable_check): Fix checking for result variables and deeply nested BLOCKs. 2012-01-23 Tobias Burnus <burnus@net-b.de> PR fortran/51948 * gfortran.dg/move_alloc_12.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183453 138bc75d-0d04-0410-961f-82ee72b054a4
2011-12-192011-12-19 Tobias Burnus <burnus@net-b.de>burnus
* check.c (coarray_check): Add class ref if needed. * resolve.c (resolve_fl_var_and_proc, resolve_fl_derived0, resolve_symbol): Fix checking for BT_CLASS. 2011-12-19 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_poly_3.f90: New. * coarray/poly_run_1.f90: Enable some previously commented code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182471 138bc75d-0d04-0410-961f-82ee72b054a4
2011-12-112011-12-11 Paul Thomas <pault@gcc.gnu.org>pault
Tobias Burnus <burnus@gcc.gnu.org> PR fortran/41539 PR fortran/43214 PR fortran/43969 PR fortran/44568 PR fortran/46356 PR fortran/46990 PR fortran/49074 * interface.c(symbol_rank): Return the rank of the _data component of class objects. (compare_parameter): Also compare the derived type of the class _data component for type mismatch. Similarly, return 1 if the formal and _data ranks match. (compare_actual_formal): Do not compare storage sizes for class expressions. It is an error if an actual class array, passed to a formal class array is not full. * trans-expr.c (gfc_class_data_get, gfc_class_vptr_get, gfc_vtable_field_get, gfc_vtable_hash_get, gfc_vtable_size_get, gfc_vtable_extends_get, gfc_vtable_def_init_get, gfc_vtable_copy_get): New functions for class API. (gfc_conv_derived_to_class): For an array reference in an elemental procedure call retain the ss to provide the scalarized array reference. Moved in file. (gfc_conv_class_to_class): New function. (gfc_conv_subref_array_arg): Use the type of the class _data component as a basetype. (gfc_conv_procedure_call): Ensure that class array expressions have both the _data reference and an array reference. Use gfc_conv_class_to_class to handle class arrays for elemental functions in scalarized loops, class array elements and full class arrays. Use a call to gfc_conv_subref_array_arg in order that the copy-in/copy-out for passing class arrays to derived type arrays occurs correctly. (gfc_conv_expr): If it is missing, add the _data component between a class object or component and an array reference. (gfc_trans_class_array_init_assign): New function. (gfc_trans_class_init_assign): Call it for array expressions. * trans-array.c (gfc_add_loop_ss_code): Do not use a temp for class scalars since their size will depend on the dynamic type. (build_class_array_ref): New function. (gfc_conv_scalarized_array_ref): Call build_class_array_ref. (gfc_array_init_size): Add extra argument, expr3, that represents the SOURCE argument. If present,use this for the element size. (gfc_array_allocate): Also add argument expr3 and use it when calling gfc_array_init_size. (structure_alloc_comps): Enable class arrays. * class.c (gfc_add_component_ref): Carry over the derived type of the _data component. (gfc_add_class_array_ref): New function. (class_array_ref_detected): New static function. (gfc_is_class_array_ref): New function that calls previous. (gfc_is_class_scalar_expr): New function. (gfc_build_class_symbol): Throw not implemented error for assumed size class arrays. Remove error that prevents CLASS arrays. (gfc_build_class_symbol): Prevent pointer/allocatable conflict. Also unset codimension. (gfc_find_derived_vtab): Make 'copy' elemental and set the intent of the arguments accordingly.: * trans-array.h : Update prototype for gfc_array_allocate. * array.c (gfc_array_dimen_size): Return failure if class expr. (gfc_array_size): Likewise. * gfortran.h : New prototypes for gfc_add_class_array_ref, gfc_is_class_array_ref and gfc_is_class_scalar_expr. * trans-stmt.c (trans_associate_var): Exclude class targets from test. Move the allocation of the _vptr to an earlier time for class objects. (trans_associate_var): Assign the descriptor directly for class arrays. (gfc_trans_allocate): Add expr3 to gfc_array_allocate arguments. Convert array element references into sections. Do not invoke gfc_conv_procedure_call, use gfc_trans_call instead. * expr.c (gfc_get_corank): Fix for BT_CLASS. (gfc_is_simply_contiguous): Exclude class from test. * trans.c (gfc_build_array_ref): Include class array refs. * trans.h : Include prototypes for class API functions that are new in trans-expr. Define GFC_DECL_CLASS(node). * resolve.c (check_typebound_baseobject ): Remove error for non-scalar base object. (resolve_allocate_expr): Ensure that class _data component is present. If array, call gfc_expr_to_intialize. (resolve_select): Remove scalar error for SELECT statement as a temporary measure. (resolve_assoc_var): Update 'target' (aka 'selector') as needed. Ensure that the target expression has the right rank. (resolve_select_type): Ensure that target expressions have a valid locus. (resolve_allocate_expr, resolve_fl_derived0): Fix for BT_CLASS. * trans-decl.c (gfc_get_symbol_decl): Set GFC_DECL_CLASS, where appropriate. (gfc_trans_deferred_vars): Get class arrays right. * match.c(select_type_set_tmp): Add array spec to temporary. (gfc_match_select_type): Allow class arrays. * check.c (array_check): Ensure that class arrays have refs. (dim_corank_check, dim_rank_check): Retrun success if class. * primary.c (gfc_match_varspec): Fix for class arrays and co-arrays. Make sure that class _data is present. (gfc_match_rvalue): Handle class arrays. *trans-intrinsic.c (gfc_conv_intrinsic_size): Add class array reference. (gfc_conv_allocated): Add _data component to class expressions. (gfc_add_intrinsic_ss_code): ditto. * simplify.c (simplify_cobound): Fix for BT_CLASS. (simplify_bound): Return NULL for class arrays. (simplify_cobound): Obtain correct array_spec. Use cotype as appropriate. Use arrayspec for bounds. 2011-12-11 Paul Thomas <pault@gcc.gnu.org> Tobias Burnus <burnus@gcc.gnu.org> PR fortran/41539 PR fortran/43214 PR fortran/43969 PR fortran/44568 PR fortran/46356 PR fortran/46990 PR fortran/49074 * gfortran.dg/class_array_1.f03: New. * gfortran.dg/class_array_2.f03: New. * gfortran.dg/class_array_3.f03: New. * gfortran.dg/class_array_4.f03: New. * gfortran.dg/class_array_5.f03: New. * gfortran.dg/class_array_6.f03: New. * gfortran.dg/class_array_7.f03: New. * gfortran.dg/class_array_8.f03: New. * gfortran.dg/coarray_poly_1.f90: New. * gfortran.dg/coarray_poly_2.f90: New. * gfortran.dg/coarray/poly_run_1.f90: New. * gfortran.dg/coarray/poly_run_2.f90: New. * gfortran.dg/class_to_type_1.f03: New. * gfortran.dg/type_to_class_1.f03: New. * gfortran.dg/typebound_assignment_3.f03: Remove the error. * gfortran.dg/auto_dealloc_2.f90: Occurences of __builtin_free now 2. * gfortran.dg/class_19.f03: Occurences of __builtin_free now 8. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182210 138bc75d-0d04-0410-961f-82ee72b054a4
2011-12-032011-12-03 Tobias Burnus <burnus@net-b.de> ↵burnus
PR fortran/50684 * check.c (variable_check): Fix intent(in) check. 2011-12-03 Tobias Burnus <burnus@net-b.de> PR fortran/50684 * gfortran.dg/move_alloc_8.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181967 138bc75d-0d04-0410-961f-82ee72b054a4
2011-12-032011-12-03 Tobias Burnus <burnus@net-b.de>burnus
* check.c (gfc_check_move_alloc): Allow nonpolymorphic FROM with polymorphic TO. * trans-intrinsic.c (conv_intrinsic_move_alloc): Handle nonpolymorphic FROM with polymorphic TO. 2011-12-03 Tobias Burnus <burnus@net-b.de> * gfortran.dg/select_type_23.f03: Revert Rev. 181801, i.e. remove the dg-error line. * gfortran.dg/move_alloc_5.f90: Ditto and change back to dg-do run. * gfortran.dg/move_alloc_9.f90: New. * gfortran.dg/move_alloc_10.f90: New git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181966 138bc75d-0d04-0410-961f-82ee72b054a4
2011-11-292011-11-29 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/51306 PR fortran/48700 * check.c (gfc_check_move_alloc): Make sure that from/to are both polymorphic or neither. * trans-intrinsic.c (conv_intrinsic_move_alloc): Cleanup, generate inline code. 2011-11-29 Tobias Burnus <burnus@net-b.de> PR fortran/51306 PR fortran/48700 * gfortran.dg/move_alloc_5.f90: Add dg-error. * gfortran.dg/select_type_23.f03: Add dg-error. * gfortran.dg/move_alloc_6.f90: New. * gfortran.dg/move_alloc_7.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181801 138bc75d-0d04-0410-961f-82ee72b054a4
2011-10-302011-10-30 Steven G. Kargl <kargl@gcc.gnu.org>kargl
PR fortran/50573 * check.c (gfc_check_dshift): Update argument checking for BOZ. Update checking SHIFT against BITSIZE of I or J. * intrinsic.texi: Update docs for DSHIFTL and DSHIFTR. 2011-10-30 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/50573 * gfortran.dg/dshift_3.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180686 138bc75d-0d04-0410-961f-82ee72b054a4
2011-10-282011-10-28 Steven G. Kargl <kargl@gcc.gnu.org>kargl
* check.c (gfc_check_atan_2): Typo in comment. (gfc_check_nearest): If 's' is constant, check that it is not 0. * simplify.c (simplify_dshift, gfc_simplify_ibclr, gfc_simplify_ibits, gfc_simplify_ibset, simplify_shift, gfc_simplify_ishftc, gfc_simplify_nearest): Remove dead code. 2011-10-28 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.dg/nearest_5.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180618 138bc75d-0d04-0410-961f-82ee72b054a4
2011-10-212011-10-20 Steven G. Kargl <kargl@gcc.gnu.org>kargl
PR fortran/50821 * check.c (gfc_check_ishftc): Check args are constant before extracting the integer. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180316 138bc75d-0d04-0410-961f-82ee72b054a4
2011-10-202011-10-20 Steven G. Kargl <kargl@gcc.gnu.org>kargl
* gfortran.dg/ishft_3.f90: Update test. 2011-10-20 Steven G. Kargl <kargl@gcc.gnu.org> * check.c (less_than_bitsize1): Check |shift| <= bit_size(i). (gfc_check_ishftc): Check |shift| <= bit_size(i) and check that size is positive. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180264 138bc75d-0d04-0410-961f-82ee72b054a4
2011-10-192011-10-19 Janus Weil <janus@gcc.gnu.org>janus
PR fortran/47023 * check.c (gfc_check_sizeof): Reject procedures as argument of SIZEOF. * intrinsinc.texi (SIZEOF): Document it. (STORAGE_SIZE): Fix special characters. Fix line breaks. 2011-10-19 Janus Weil <janus@gcc.gnu.org> PR fortran/47023 * gfortran.dg/sizeof_proc.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180210 138bc75d-0d04-0410-961f-82ee72b054a4
2011-10-18 PR fortran/50420mikael
* check.c (dim_corank_check): Use gfc_get_corank to get corank. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180148 138bc75d-0d04-0410-961f-82ee72b054a4
2011-10-182011-10-18 Janus Weil <janus@gcc.gnu.org>janus
PR fortran/47023 * decl.c (verify_c_interop_param): Renamed to 'gfc_verify_c_interop_param'. Add error message for polymorphic arguments. (verify_c_interop): Renamed to 'gfc_verify_c_interop'. Reject polymorphic variables. (verify_bind_c_sym): Renamed 'verify_c_interop'. * gfortran.h (verify_c_interop,verify_c_interop_param): Renamed. * check.c (gfc_check_sizeof): Ditto. * resolve.c (gfc_iso_c_func_interface,resolve_fl_procedure): Ditto. * symbol.c (verify_bind_c_derived_type): Ditto. 2011-10-18 Janus Weil <janus@gcc.gnu.org> PR fortran/47023 * gfortran.dg/iso_c_binding_class.f03: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180130 138bc75d-0d04-0410-961f-82ee72b054a4
2011-10-07 * check.c (is_coarray): Remove.mikael
(coarray_check): Use gfc_is_coarray. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179671 138bc75d-0d04-0410-961f-82ee72b054a4
2011-09-202011-09-20 Steven G. Kargl <kargl@gcc.gnu.org>kargl
* check.c (gfc_check_c_sizeof): Remove redundant word. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179009 138bc75d-0d04-0410-961f-82ee72b054a4
2011-09-142011-09-14 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/34547 PR fortran/50375 * check.c (gfc_check_null): Allow allocatables as MOLD to NULL. * resolve.c (resolve_transfer): Reject NULL without MOLD. * interface.c (gfc_procedure_use): Reject NULL without MOLD if no explicit interface is known. (gfc_search_interface): Reject NULL without MOLD if it would lead to ambiguity. 2011-09-14 Tobias Burnus <burnus@net-b.de> PR fortran/34547 PR fortran/50375 * gfortran.dg/null_5.f90: New. * gfortran.dg/null_6.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178841 138bc75d-0d04-0410-961f-82ee72b054a4
2011-08-052011-08-05 Thomas Koenig <tkoenig@gcc.gnu.org>tkoenig
PR fortran/37221 * gfortran.h (gfc_calculate_transfer_sizes): Add prototype. * target-memory.h (gfc_target_interpret_expr): Add boolean argument wether to convert wide characters. * target-memory.c (gfc_target_expr_size): Also return length of characters for non-constant expressions if these can be determined from the cl. (interpret_array): Add argument for gfc_target_interpret_expr. (gfc_interpret_derived): Likewise. (gfc_target_interpret_expr): Likewise. * check.c: Include target-memory.h. (gfc_calculate_transfer_sizes): New function. (gfc_check_transfer): When -Wsurprising is in force, calculate sizes and warn if result is larger than size (check moved from gfc_simplify_transfer). * simplify.c (gfc_simplify_transfer): Use gfc_calculate_transfer_sizes. Remove warning. 2011-08-05 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/37221 * gfortran.dg/transfer_check_2.f90: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177486 138bc75d-0d04-0410-961f-82ee72b054a4
2011-07-212011-07-21 Tobias Burnus <burnus@net-b.de>burnus
* check.c (gfc_check_present): Allow coarrays. * trans-array.c (gfc_conv_array_ref): Avoid casting when a pointer is wanted. * trans-decl.c (create_function_arglist): For -fcoarray=lib, handle hidden token and offset arguments for nondescriptor coarrays. * trans-expr.c (get_tree_for_caf_expr): New function. (gfc_conv_procedure_call): For -fcoarray=lib pass the token and offset for nondescriptor coarray dummies. * trans.h (lang_type): Add caf_offset tree. (GFC_TYPE_ARRAY_CAF_OFFSET): New macro. 2011-07-21 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_lib_token_1.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176562 138bc75d-0d04-0410-961f-82ee72b054a4
2011-06-202011-06-20 Tobias Burnus <burnus@net-b.de>burnus
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175228 138bc75d-0d04-0410-961f-82ee72b054a4
2011-06-172011-06-17 Janus Weil <janus@gcc.gnu.org>janus
PR fortran/48699 * check.c (gfc_check_move_alloc): If 'TO' argument is polymorphic, make sure the vtab is present. 2011-06-17 Janus Weil <janus@gcc.gnu.org> PR fortran/48699 * gfortran.dg/move_alloc_5.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175151 138bc75d-0d04-0410-961f-82ee72b054a4
2011-05-312011-05-31 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/18918 * intrinsic.c (klass): Add CLASS_ATOMIC. (add_subroutines): Add atomic_ref/atomic_define. * intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document. * intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref, gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes. * gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF and GFC_ISYM_ATOMIC_REF. (gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars. * iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref): * New functions. * check.c (gfc_check_atomic, gfc_check_atomic_def, gfc_check_atomic_ref): New functions. * iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND, ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value. * trans-intrinsic.c (conv_intrinsic_atomic_def, conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New functions. (conv_intrinsic_move_alloc) Renamed from gfc_conv_intrinsic_move_alloc - and made static. * trans.h (gfc_conv_intrinsic_move_alloc): Remove. (gfc_conv_intrinsic_subroutine) Add prototype. * trans.c (trans_code): Call gfc_conv_intrinsic_subroutine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174510 138bc75d-0d04-0410-961f-82ee72b054a4
2011-05-272011-05-27 Tobias Burnus <burnus@net-b.de>burnus
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174364 138bc75d-0d04-0410-961f-82ee72b054a4