Commit Graph

165 Commits

Author SHA1 Message Date
Janus Weil
03bd096b3b re PR fortran/37254 (Reject valid PROCEDURE statement with implicit interface)
2009-06-22  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/37254
	PR fortran/39850
	* interface.c (compare_parameter): Set implicit type for function
	actual arguments with BT_UNKNOWN.


2009-06-22  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/37254
	PR fortran/39850
	* gfortran.dg/interface_30.f90: Modified error message.
	* gfortran.dg/proc_decl_22.f90: New.

From-SVN: r148816
2009-06-22 23:02:19 +02:00
Paul Thomas
22a0a78022 re PR fortran/40443 (Elemental procedure in genericl interface incorrectly selected in preference to specific procedure)
2009-06-22  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/40443
	* interface.c (gfc_search_interface): Hold back a match to an
	elementary procedure until all other possibilities are
	exhausted.

2009-06-22  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/40443
	* gfortran.dg/generic_18.f90: New test.

From-SVN: r148776
2009-06-22 04:41:10 +00:00
Janus Weil
9b63f28250 re PR fortran/39850 (Too strict checking for procedures as actual argument)
2009-06-21  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39850
	* interface.c (gfc_compare_interfaces): Take care of implicit typing
	when checking the function attribute. Plus another bugfix.
	(compare_parameter): Set attr.function and attr.subroutine according
	to the usage of a procedure as actual argument.


2009-06-21  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39850
	* gfortran.dg/interface_19.f90: Add 'cleanup-modules'.
	* gfortran.dg/interface_20.f90: Ditto.
	* gfortran.dg/interface_21.f90: Ditto.
	* gfortran.dg/interface_22.f90: Ditto.
	* gfortran.dg/interface_30.f90: New.
	* gfortran.dg/proc_ptr_11.f90: Fix invalid test case.

From-SVN: r148767
2009-06-21 21:05:35 +02:00
Janus Weil
8ad15a0a8d re PR fortran/36947 (Attributes not fully checked comparing actual vs dummy procedure)
2009-06-16  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/36947
	PR fortran/40039
	* expr.c (gfc_check_pointer_assign): Call 'gfc_compare_interfaces' with
	error message.
	* gfortran.h (gfc_compare_interfaces): Additional argument.
	* interface.c (operator_correspondence): Removed.
	(gfc_compare_interfaces): Additional argument to return error message.
	Directly use the code from 'operator_correspondence' instead of calling
	the function. Check for OPTIONAL. Some rearrangements.
	(check_interface1): Call 'gfc_compare_interfaces' without error message.
	(compare_parameter): Call 'gfc_compare_interfaces' with error message.
	* resolve.c (check_generic_tbp_ambiguity): Call 'gfc_compare_interfaces'
	without error message.


2009-06-16  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/36947
	PR fortran/40039
	* gfortran.dg/dummy_procedure_1.f90: Extended test case.
	* gfortran.dg/interface_20.f90: Modified error messages.
	* gfortran.dg/interface_21.f90: Ditto.
	* gfortran.dg/interface_26.f90: Ditto.
	* gfortran.dg/interface_27.f90: Ditto.
	* gfortran.dg/interface_28.f90: Extended test case.
	* gfortran.dg/interface_29.f90: New.
	* gfortran.dg/proc_decl_7.f90: Modified error messages.
	* gfortran.dg/proc_decl_8.f90: Ditto.
	* gfortran.dg/proc_ptr_11.f90: Ditto.
	* gfortran.dg/proc_ptr_15.f90: Ditto.

From-SVN: r148519
2009-06-16 11:06:13 +02:00
Jakub Jelinek
e8d4f3fcb2 interface.c (fold_unary): Rename to...
* interface.c (fold_unary): Rename to...
	(fold_unary_intrinsic): ... this.
	(gfc_extend_expr): Adjust caller.
	(gfc_match_generic_spec): Likewise.  Initialize *op to INTRINSIC_NONE
	to avoid warnings.
	* expr.c (gfc_simplify_expr): Initialize start and end before calling
	gfc_extract_int.

From-SVN: r148366
2009-06-11 08:42:49 +02:00
Janus Weil
23e38561c5 re PR fortran/36947 (Attributes not fully checked comparing actual vs dummy procedure)
2009-05-18  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/36947
	PR fortran/40039
	* expr.c (gfc_check_pointer_assign): Check intents when comparing
	interfaces.
	* gfortran.h (typedef struct gfc_intrinsic_arg): Add 'intent' member.
	(gfc_compare_interfaces): Additional argument.
	* interface.c (operator_correspondence): Add check for equality of
	intents, and new argument 'intent_check'.
	(gfc_compare_interfaces): New argument 'intent_check', which is passed
	on to operator_correspondence.
	(check_interface1): Don't check intents when comparing interfaces.
	(compare_parameter): Do check intents when comparing interfaces.
	* intrinsic.c (add_sym): Add intents for arguments of intrinsic
	procedures.
	(add_sym_1,add_sym_1s,add_sym_1m,add_sym_2,add_sym_2s,add_sym_3,
	add_sym_3ml,add_sym_3red,add_sym_3s,add_sym_4): Use INTENT_IN by
	default.
	(add_sym_1_intent,add_sym_1s_intent,add_sym_2s_intent,add_sym_3s_intent)
	: New functions to add intrinsic symbols, specifying custom intents.
	(add_sym_4s,add_sym_5s): Add new arguments to specify intents.
	(add_functions,add_subroutines): Add intents for various intrinsics.
	* resolve.c (check_generic_tbp_ambiguity): Don't check intents when
	comparing interfaces.
	* symbol.c (gfc_copy_formal_args_intr): Copy intent.


2009-05-18  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/36947
	PR fortran/40039
	* gfortran.dg/interface_27.f90: New.
	* gfortran.dg/interface_28.f90: New.
	* gfortran.dg/proc_ptr_11.f90: Fixing invalid test case.
	* gfortran.dg/proc_ptr_result_1.f90: Ditto.

From-SVN: r147655
2009-05-18 11:19:20 +02:00
Ian Lance Taylor
09639a8397 passes.c (finish_optimization_passes): Change i to int.
./:	* passes.c (finish_optimization_passes): Change i to int.
	* plugin.c (plugins_active_p): Change event to int.
	(dump_active_plugins): Likewise.
	* reginfo.c (invalid_mode_change_p): Change to to unsigned int.
	Add cast.
	* tree.c (tree_range_check_failed): Change c to unsigned int.
	(omp_clause_range_check_failed): Likewise.
	(build_common_builtin_nodes): Change mode to int.  Add cast.
	* config/ia64/ia64.c (is_emitted): Change r to unsigned int.
	(ia64_hard_regno_rename_ok, ia64_eh_uses): Likewise.

	* c-typeck.c (build_unary_op): If -Wc++-compat, warn about using
	++ or -- with a variable of enum type.
cp/:
	* class.c (layout_class_type): Change itk to unsigned int.
	* decl.c (finish_enum): Change itk to unsigned int.
	* parser.c (cp_parser_check_decl_spec): Change ds to int.  Remove
	casts.
fortran/:
	* decl.c (match_attr_spec): Change d to unsigned int.
	* dump-parse-tree.c (show_namespace): Change op to int.  Add cast.
	* interface.c (gfc_check_interfaces): Change i to int.  Add casts.
	* module.c (read_module): Change i to int.  Add cast.
	(write_module): Change i to int.
	* symbol.c (gfc_get_namespace): Change in to int.
	(gfc_free_namespace): Change i to int.
	* trans-io.c (gfc_build_io_library_fndecls): Change ptype to
	unsigned int.  Add cast.
	* trans-types.c (gfc_init_kinds): Change mode to unsigned int.
	Add casts.
testsuite/:
	* gcc.dg/Wcxx-compat-9.c: New testcase.

From-SVN: r147544
2009-05-14 21:29:48 +00:00
Steven G. Kargl
a513927a5b gfortran.h (gfc_code): Rename struct member expr to expr1.
2009-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>

	* gfortran.h (gfc_code): Rename struct member expr to expr1.
	* openmp.c (resolve_omp_atomic): Update expr to expr1.
	* interface.c (gfc_extend_assign): Ditto.
	* trans-expr.c (gfc_conv_expr_reference, gfc_trans_assignment,
	gfc_trans_init_assign): Ditto.
	* dump-parse-tree.c (show_code_node): Ditto.
	* trans-openmp.c (gfc_trans_omp_atomic): Ditto.
	* trans-stmt.c ( gfc_trans_label_assign, gfc_trans_goto, gfc_trans_call,
	gfc_trans_return, gfc_trans_pause, gfc_trans_stop, gfc_trans_if_1,
	gfc_trans_arithmetic_if, gfc_trans_do_while, gfc_trans_integer_select,
	gfc_trans_logical_select, gfc_trans_character_select
	forall_make_variable_temp, check_forall_dependencies
	gfc_trans_forall_1, gfc_trans_where_2, gfc_trans_where_3
	gfc_trans_where, gfc_trans_allocate, gfc_trans_deallocate): Ditto.
	* io.c (match_io_element, gfc_match_inquire): Ditto.
	* resolve.c (resolve_typebound_call, resolve_ppc_call,
	resolve_allocate_expr, resolve_allocate_deallocate, resolve_select,
	resolve_transfer, resolve_where, gfc_resolve_assign_in_forall,
	gfc_resolve_blocks, resolve_code, build_init_assign): Ditto.
	* st.c (gfc_free_statement): Ditto.
	* match.c (gfc_match_assignment, gfc_match_pointer_assignment,
	match_arithmetic_if, gfc_match_if, gfc_match_elseif
	gfc_match_stopcode, gfc_match_assign, gfc_match_goto,
	gfc_match_nullify, match_typebound_call, gfc_match_call
	gfc_match_select, match_simple_where, gfc_match_where
	gfc_match_elsewhere, match_simple_forall, gfc_match_forall): Ditto.
	* trans-io.c (gfc_trans_transfer): Ditto.
	* parse.c (parse_where_block, parse_if_block): Ditto.

From-SVN: r147497
2009-05-13 20:49:13 +00:00
Janus Weil
713485cc67 re PR fortran/39630 ([F03] Procedure Pointer Components)
2009-05-06  Janus Weil  <janus@gcc.gnu.org>
	    Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/39630
	* decl.c (match_procedure_interface): New function to match the
	interface for a PROCEDURE statement.
	(match_procedure_decl): Call match_procedure_interface.
	(match_ppc_decl): New function to match the declaration of a
	procedure pointer component.
	(gfc_match_procedure):  Call match_ppc_decl.
	(match_binding_attributes): Add new argument 'ppc' and handle the
	POINTER attribute for procedure pointer components.
	(match_procedure_in_type,gfc_match_generic): Added new argument to
	match_binding_attributes.
	* dump-parse-tree.c (show_expr,show_components,show_code_node): Handle
	procedure pointer components.
	* expr.c (free_expr0,gfc_copy_expr,gfc_simplify_expr): Handle EXPR_PPC.
	(gfc_check_pointer_assign): Handle procedure pointer components, but no
	full checking yet.
	(is_proc_ptr_comp): New function to determine if an expression is a
	procedure pointer component.
	* gfortran.h (expr_t): Add EXPR_PPC.
	(symbol_attribute): Add new member 'proc_pointer_comp'.
	(gfc_component): Add new member 'formal'.
	(gfc_exec_op): Add EXEC_CALL_PPC.
	(gfc_get_default_type): Changed first argument.
	(is_proc_ptr_comp): Add prototype.
	(gfc_match_varspec): Add new argument.
	* interface.c (compare_actual_formal): Handle procedure pointer
	components.
	* match.c (gfc_match_pointer_assignment,match_typebound_call): Handle
	procedure pointer components.
	* module.c (mio_expr): Handle EXPR_PPC.
	* parse.c (parse_derived): Handle procedure pointer components.
	* primary.c (gfc_match_varspec): Add new argument 'ppc_arg' and handle
	procedure pointer components.
	(gfc_variable_attr): Handle procedure pointer components.
	(gfc_match_rvalue): Added new argument to gfc_match_varspec and changed
	first argument of gfc_get_default_type.
	(match_variable): Added new argument to gfc_match_varspec.
	* resolve.c (resolve_entries,set_type,resolve_fl_parameter): Changed
	first argument of gfc_get_default_type.
	(resolve_structure_cons,resolve_actual_arglist): Handle procedure
	pointer components.
	(resolve_ppc_call): New function to resolve a call to a procedure
	pointer component (subroutine).
	(resolve_expr_ppc): New function to resolve a call to a procedure
	pointer component (function).
	(gfc_resolve_expr): Handle EXPR_PPC.
	(resolve_code): Handle EXEC_CALL_PPC.
	(resolve_fl_derived): Copy the interface for a procedure pointer
	component.
	(resolve_symbol): Fix overlong line.
	* st.c (gfc_free_statement): Handle EXEC_CALL_PPC.
	* symbol.c (gfc_get_default_type): Changed first argument.
	(gfc_set_default_type): Changed first argument of gfc_get_default_type.
	(gfc_add_component): Initialize ts.type to BT_UNKNOWN.
	* trans.h (gfc_conv_function_call): Renamed.
	* trans.c (gfc_trans_code): Handle EXEC_CALL_PPC.
	* trans-expr.c (gfc_conv_component_ref): Ditto.
	(gfc_conv_function_val): Rename to 'conv_function_val', add new
	argument 'expr' and handle procedure pointer components.
	(gfc_conv_operator_assign): Renamed gfc_conv_function_val.
	(gfc_apply_interface_mapping_to_expr): Handle EXPR_PPC.
	(gfc_conv_function_call): Rename to 'gfc_conv_procedure_call', add new
	argument 'expr' and handle procedure pointer components.
	(gfc_get_proc_ptr_comp): New function to get the backend decl for a
	procedure pointer component.
	(gfc_conv_function_expr): Renamed gfc_conv_function_call.
	(gfc_conv_structure): Handle procedure pointer components.
	* trans-intrinsic.c (gfc_conv_intrinsic_funcall,
	conv_generic_with_optional_char_arg): Renamed gfc_conv_function_call.
	* trans-stmt.h (gfc_get_proc_ptr_comp): Add prototype.
	* trans-stmt.c (gfc_trans_call): Renamed gfc_conv_function_call.
	* trans-types.h (gfc_get_ppc_type): Add prototype.
	* trans-types.c (gfc_get_ppc_type): New function to build a tree node
	for a procedure pointer component.
	(gfc_get_derived_type): Handle procedure pointer components.


2009-05-06  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39630
	* gfortran.dg/proc_decl_1.f90: Modified.
	* gfortran.dg/proc_ptr_comp_1.f90: New.
	* gfortran.dg/proc_ptr_comp_2.f90: New.
	* gfortran.dg/proc_ptr_comp_3.f90: New.
	* gfortran.dg/proc_ptr_comp_4.f90: New.
	* gfortran.dg/proc_ptr_comp_5.f90: New.
	* gfortran.dg/proc_ptr_comp_6.f90: New.


Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>

From-SVN: r147206
2009-05-06 23:17:16 +02:00
Janus Weil
c73b647896 re PR fortran/39735 (procedure pointer assignments: return value is not checked)
2009-04-22  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39735
	* decl.c (add_hidden_procptr_result): Bugfix for procptr results.
	(match_procedure_decl): Set if_source.
	* expr.c (gfc_check_pointer_assign): Bugfix: Return after error.
	And: Check interface also for IFSRC_UNKNOWN (return type may be known).
	* gfortran.h (typedef enum ifsrc): Remove IFSRC_USAGE,
	add documentation. Rename copy_formal_args and copy_formal_args_intr.
	* interface.c (gfc_compare_interfaces): Check for return types,
	handle IFSRC_UNKNOWN.
	(compare_intr_interfaces,compare_actual_formal_intr): Obsolete, removed.
	(gfc_procedure_use): Modified handling of intrinsics.
	* intrinsic.c (add_functions): Bugfix for "dim".
	* resolve.c (resolve_intrinsic): New function to resolve intrinsics,
	which copies the interface from isym to sym.
	(resolve_procedure_expression,resolve_function): Use new function
	'resolve_intrinsic'.
	(resolve_symbol): Add function attribute for externals with return type
	and use new function 'resolve_intrinsic'.
	* symbol.c (ifsrc_types): Remove string for IFSRC_USAGE.
	(copy_formal_args): Renamed to gfc_copy_formal_args.
	(copy_formal_args_intr): Renamed to gfc_copy_formal_args_intr.
	* trans-const.c (gfc_conv_const_charlen): Handle cl==NULL.


2009-04-22  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39735
	* gfortran.dg/assumed_charlen_function_5.f90: Modified.
	* gfortran.dg/external_initializer.f90: Modified.
	* gfortran.dg/interface_26.f90: Modified.
	* gfortran.dg/intrinsic_subroutine.f90: Modified.
	* gfortran.dg/proc_ptr_3.f90: Modified.
	* gfortran.dg/proc_ptr_15.f90: New.
	* gfortran.dg/proc_ptr_result_1.f90: Modified.

From-SVN: r146554
2009-04-22 11:05:58 +02:00
Janus Weil
3afadac3ca re PR other/38920 (dw2 exceptions don't work.)
2009-04-07  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/38920
	* expr.c (gfc_check_pointer_assign): Enable interface check for
	procedure pointers.
	* gfortran.h: Add copy_formal_args_intr.
	* interface.c (gfc_compare_interfaces): Call gfc_compare_intr_interfaces
	if second argument is an intrinsic.
	(compare_intr_interfaces): Correctly set attr.function, attr.subroutine
	and ts.
	(compare_parameter): Call gfc_compare_interfaces also for intrinsics.
	* resolve.c (resolve_specific_f0,resolve_specific_s0): Don't resolve
	intrinsic interfaces here. Must happen earlier.
	(resolve_symbol): Resolution of intrinsic interfaces moved here from
	resolve_specific_..., and formal args are now copied from intrinsic
	interfaces.
	* symbol.c (copy_formal_args_intr): New function to copy the formal
	arguments from an intinsic procedure.


2009-04-07  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/38920
	* gfortran.dg/proc_decl_1.f90: Modified.
	* gfortran.dg/proc_ptr_11.f90: Extended.
	* gfortran.dg/proc_ptr_13.f90: Modified.

From-SVN: r145651
2009-04-07 09:24:37 +02:00
Paul Thomas
489ec4e3bd re PR fortran/39295 (Too strict interface conformance check)
2009-02-26  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/39295
	* interface.c (compare_type_rank_if): Return 1 if the symbols
	are the same and deal with external procedures where one is
	identified to be a function or subroutine by usage but the
	other is not.

2009-02-26  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/39295
	* gfortran.dg/interface_25.f90: New test.
	* gfortran.dg/interface_26.f90: New test.

From-SVN: r144449
2009-02-26 18:43:50 +00:00
Paul Thomas
8b791297bf check.c: Update copyright year.
2009-01-10  Paul Thomas  <pault@gcc.gnu.org>

	* check.c : Update copyright year.
	* dependency.c : Update copyright year.
	* interface.c : ditto.
	* intrinsic.c : ditto.
	* intrinsic.h : ditto.
	* module.c : ditto.
	* simplify.c : ditto.
	* symbol.c : ditto.
	* trans-stmt.c : ditto.
	* trans-types.c : ditto.

From-SVN: r143236
2009-01-09 23:47:55 +00:00
Thomas Koenig
a9c5fe7e72 re PR fortran/38220 (C_LOC intrinsic non-pure and without explicit interface)
2009-01-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/38220
	* interface.c (gfc_procedure_use):  Don't warn about functions
	from ISO_C_BINDING.
	* symbol.c (generate_isocbinding_symbol):  Mark c_loc and
	c_funloc as pure.

2009-01-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/38220
	* gfortran.dg/c_loc_pure_1.f90:  New test.

From-SVN: r143140
2009-01-06 23:03:18 +00:00
Paul Thomas
a1ab6660ae re PR fortran/38665 (ICE in check_host_association)
2009-01-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/38665
	* gfortran.h : Add bit to gfc_expr 'user_operator'
	* interface.c (gfc_extend_expr): Set the above if the operator
	is substituted by a function. 
	* resolve.c (check_host_association): Return if above is set.

2009-01-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/38665
	* gfortran.dg/host_assoc_function_5.f90: New test.

From-SVN: r143064
2009-01-04 23:17:37 +00:00
Daniel Kraft
f0ac18b799 re PR fortran/37588 (GENERIC type-bound procedure is not resolved)
2008-09-23  Daniel Kraft  <d@domob.eu>

	PR fortran/37588
	* gfortran.h (gfc_compare_actual_formal): Removed, made private.
	(gfc_arglist_matches_symbol): New method.
	* interface.c (compare_actual_formal): Made static.
	(gfc_procedure_use): Use new name of compare_actual_formal.
	(gfc_arglist_matches_symbol): New method.
	(gfc_search_interface): Moved code partially to new
	gfc_arglist_matches_symbol.
	* resolve.c (resolve_typebound_generic_call): Resolve actual arglist
	before checking against formal and use new gfc_arglist_matches_symbol
	for checking.
	(resolve_compcall): Set type-spec of generated expression.

2008-09-23  Daniel Kraft  <d@domob.eu>

	PR fortran/37588
	* gfortran.dg/typebound_generic_4.f03: New test.
	* gfortran.dg/typebound_generic_5.f03: New test.

From-SVN: r140594
2008-09-23 16:26:47 +02:00
Daniel Kraft
e157f73660 gfortran.h (enum gfc_statement): New entry `ST_GENERIC'.
2008-08-31  Daniel Kraft  <d@domob.eu>

	* gfortran.h (enum gfc_statement): New entry `ST_GENERIC'.
	(struct gfc_tbp_generic): New type.
	(struct gfc_typebound_proc): Removed `target' and added union with
	`specific' and `generic' members; new members `overridden',
	`subroutine', `function' and `is_generic'.
	(struct gfc_expr): New members `derived' and `name' in compcall union
	member and changed type of `tbp' to gfc_typebound_proc.
	(gfc_compare_interfaces), (gfc_compare_actual_formal): Made public.
	* match.h (gfc_typebound_default_access): New global.
	(gfc_match_generic): New method.
	* decl.c (gfc_match_generic): New method.
	(match_binding_attributes): New argument `generic' and handle it.
	(match_procedure_in_type): Mark matched binding as non-generic.
	* interface.c (gfc_compare_interfaces): Made public.
	(gfc_compare_actual_formal): Ditto.
	(check_interface_1), (compare_parameter): Use new public names.
	(gfc_procedure_use), (gfc_search_interface): Ditto.
	* match.c (match_typebound_call): Set base-symbol referenced.
	* module.c (binding_generic): New global array.
	(current_f2k_derived): New global.
	(mio_typebound_proc): Handle IO of GENERIC bindings.
	(mio_f2k_derived): Record current f2k-namespace in current_f2k_derived.
	* parse.c (decode_statement): Handle GENERIC statement.
	(gfc_ascii_statement): Ditto.
	(typebound_default_access), (set_typebound_default_access): Removed.
	(gfc_typebound_default_access): New global.
	(parse_derived_contains): New default-access implementation and handle
	GENERIC statements encountered.
	* primary.c (gfc_match_varspec): Adapted to new gfc_typebound_proc
	structure and removed check for SUBROUTINE/FUNCTION from here.
	* resolve.c (extract_compcall_passed_object): New method.
	(update_compcall_arglist): Use it.
	(resolve_typebound_static): Adapted to new gfc_typebound_proc structure.
	(resolve_typebound_generic_call): New method.
	(resolve_typebound_call): Check target is a SUBROUTINE and handle calls
	to GENERIC bindings.
	(resolve_compcall): Ditto (check for target being FUNCTION).
	(check_typebound_override): Handle GENERIC bindings.
	(check_generic_tbp_ambiguity), (resolve_typebound_generic): New methods.
	(resolve_typebound_procedure): Handle GENERIC bindings and set new
	attributes subroutine, function and overridden in gfc_typebound_proc.
	(resolve_fl_derived): Ensure extended type is resolved before the
	extending one is.
	* st.c (gfc_free_statement): Fix bug with free'ing EXEC_COMPCALL's.
	* symbol.c (gfc_find_typebound_proc): Adapt for GENERIC changes.

2008-08-31  Daniel Kraft  <d@domob.eu>

	* gfortran.dg/typebound_generic_1.f03: New test.
	* gfortran.dg/typebound_generic_2.f03: New test.
	* gfortran.dg/typebound_generic_3.f03: New test.

From-SVN: r139822
2008-08-31 12:00:30 +02:00
Janus Weil
d4b7d0f052 gfortran.h (gfc_component): Add field "symbol_attribute attr"...
2008-08-23  Janus Weil  <janus@gcc.gnu.org>

	* gfortran.h (gfc_component): Add field "symbol_attribute attr", remove
	fields "pointer", "allocatable", "dimension", "access".
	Remove functions "gfc_set_component_attr" and "gfc_get_component_attr".
	* interface.c (gfc_compare_derived_types): Ditto.
	* trans-array.c (gfc_array_allocate,structure_alloc_comps): Ditto.
	* trans-expr.c (gfc_conv_component_ref,gfc_trans_subcomponent_assign,
	gfc_conv_structure): Ditto.
	* symbol.c (gfc_find_component,free_components,gfc_set_component_attr,
	gfc_get_component_attr,verify_bind_c_derived_type,
	generate_isocbinding_symbol): Ditto.
	* decl.c (build_struct): Ditto.
	* dump-parse-tree.c (show_components): Ditto.
	* trans-stmt.c (gfc_trans_deallocate): Ditto.
	* expr.c (gfc_check_assign,gfc_check_pointer_assign,
	gfc_default_initializer): Ditto.
	* module.c (mio_component): Ditto.
	* trans-types.c (copy_dt_decls_ifequal,gfc_get_derived_type): Ditto.
	* resolve.c (has_default_initializer,resolve_structure_cons,
	gfc_iso_c_func_interface,find_array_spec,resolve_ref,
	resolve_deallocate_expr,resolve_allocate_expr,resolve_fl_derived,
	resolve_equivalence_derived): Ditto.
	* trans-io.c (transfer_expr): Ditto.
	* parse.c (parse_derived): Ditto.
	* dependency.c (gfc_check_dependency): Ditto.
	* primary.c (gfc_variable_attr): Ditto.

From-SVN: r139524
2008-08-23 23:04:01 +02:00
Daniel Kraft
f6fad28ea1 gfortran.h (gfc_finalizer): Replaced member procedure' by two new members proc_sym' and `proc_tree' to...
2008-08-08  Daniel Kraft  <d@domob.eu>

	* gfortran.h (gfc_finalizer):  Replaced member `procedure' by two
	new members `proc_sym' and `proc_tree' to store the symtree after
	resolution.
	(gfc_find_sym_in_symtree):  Made public.
	* decl.c (gfc_match_final_decl):  Adapted for new member name.
	* interface.c (gfc_find_sym_in_symtree):  Made public.
	(gfc_extend_expr), (gfc_extend_assign):  Changed call accordingly.
	* module.c (mio_finalizer), (mio_f2k_derived), (mio_full_f2k_derived):
	New methods for module-file IO of f2k_derived.
	(mio_symbol):  Do IO of f2k_derived namespace.
	* resolve.c (gfc_resolve_finalizers):  Adapted for new member name and
	finding the symtree for the symbol here.
	* symbol.c (gfc_free_finalizer):  Adapted for new members.

2008-08-08  Daniel Kraft  <d@domob.eu>

	* gfortran.dg/finalize_9.f03:  New test.
	* gfortran.dg/module_md5_1.f90:  Adapted MD5-sum for changed module
	file format.

From-SVN: r138884
2008-08-08 20:19:46 +02:00
Kaveh R. Ghazi
17b1d2a049 gfortran.h (try): Remove macro.
* gfortran.h (try): Remove macro.  Replace try with gfc_try
	throughout.
	* array.c: Likewise.
	* check.c: Likewise.
	* cpp.c: Likewise.
	* cpp.h: Likewise.
	* data.c: Likewise.
	* data.h: Likewise.
	* decl.c: Likewise.
	* error.c: Likewise.
	* expr.c: Likewise.
	* interface.c: Likewise.
	* intrinsic.c: Likewise.
	* intrinsic.h: Likewise.
	* io.c: Likewise.
	* match.h: Likewise.
	* parse.c: Likewise.
	* parse.h: Likewise.
	* resolve.c: Likewise.
	* scanner.c: Likewise.
	* simplify.c: Likewise.
	* symbol.c: Likewise.
	* trans-openmp.c: Likewise.
	* trans-types.c: Likewise.

From-SVN: r138226
2008-07-29 00:45:52 +00:00
Kaveh R. Ghazi
7b901ac47f gfortran.h (new): Remove macro.
* gfortran.h (new): Remove macro.
	* array.c (gfc_append_constructor, match_array_list,
	gfc_match_array_constructor): Likewise.
	* bbt.c (insert, gfc_insert_bbt): Likewise.
	* decl.c (var_element, top_var_list, top_val_list, gfc_match_data,
	get_proc_name): Likewise.
	* expr.c (gfc_copy_actual_arglist): Likewise.
	* interface.c (compare_actual_formal, check_new_interface,
	gfc_add_interface): Likewise.
	* intrinsic.c gfc_convert_type_warn, gfc_convert_chartype):
	Likewise.
	* io.c (match_io_iterator, match_io_list): Likewise.
	* match.c (match_forall_header): Likewise.
	* matchexp.c (build_node): Likewise.
	* module.c (gfc_match_use): Likewise.
	* scanner.c (load_file): Likewise.
	* st.c (gfc_append_code): Likewise.
	* symbol.c (save_symbol_data, gfc_get_sym_tree, gfc_undo_symbols,
	gfc_commit_symbols): Likewise.
	* trans-common.c (build_field): Likewise.
	* trans-decl.c (gfc_finish_var_decl): Likewise.
	* trans-expr.c (gfc_free_interface_mapping,
	gfc_get_interface_mapping_charlen, gfc_add_interface_mapping,
	gfc_finish_interface_mapping,
	gfc_apply_interface_mapping_to_expr): Likewise.
	* trans.h (gfc_interface_sym_mapping): Likewise.

From-SVN: r137982
2008-07-19 16:23:52 +00:00
Kaveh R. Ghazi
a1ee985fa3 gfortran.h (operator): Remove macro.
* gfortran.h (operator): Remove macro.
	(gfc_namespace, gfc_expr): Avoid C++ keywords.
	* arith.c (eval_intrinsic, eval_intrinsic_f2, eval_intrinsic_f3):
	Likewise.
	* decl.c (access_attr_decl): Likewise.
	* dependency.c (gfc_dep_compare_expr): Likewise.
	* dump-parse-tree.c (show_expr, show_uop, show_namespace):
	Likewise.
	* expr.c (gfc_copy_expr, gfc_type_convert_binary,
	simplify_intrinsic_op, check_intrinsic_op): Likewise.
	* interface.c (fold_unary, gfc_match_generic_spec,
	gfc_match_interface, gfc_match_end_interface,
	check_operator_interface, check_uop_interfaces,
	gfc_check_interfaces, gfc_extend_expr, gfc_extend_assign,
	gfc_add_interface, gfc_current_interface_head,
	gfc_set_current_interface_head): Likewise.
	* iresolve.c (gfc_resolve_dot_product, gfc_resolve_matmul):
	Likewise.
	* matchexp.c (gfc_get_parentheses, build_node): Likewise.
	* module.c (gfc_use_rename, gfc_match_use, find_use_name_n,
	number_use_names, mio_expr, load_operator_interfaces, read_module,
	write_operator, write_module): Likewise.
	* openmp.c (resolve_omp_atomic): Likewise.
	* resolve.c (resolve_operator, gfc_resolve_character_operator,
	gfc_resolve_uops): Likewise.
	* symbol.c (free_uop_tree, gfc_free_namespace): Likewise.
	* trans-expr.c (gfc_conv_expr_op): Likewise.
	* trans-openmp.c (gfc_trans_omp_atomic): Likewise.

From-SVN: r137981
2008-07-19 16:22:12 +00:00
Kaveh R. Ghazi
9aa433c294 gfortran.h (protected): Remove macro.
* gfortran.h (protected): Remove macro.
	* dump-parse-tree.c (show_attr): Avoid C++ keywords.
	* expr.c (gfc_check_pointer_assign): Likewise.
	* interface.c (compare_parameter_protected): Likewise.
	* intrinsic.c (enum class, add_sym, add_sym_0, add_sym_1,
	add_sym_1s, add_sym_1m, add_sym_2, add_sym_2s, add_sym_3,
	add_sym_3ml, add_sym_3red, add_sym_3s, add_sym_4, add_sym_4s,
	add_sym_5s): Likewise.
	* match.c (gfc_match_assignment, gfc_match_pointer_assignment):
	Likewise.
	* module.c (mio_symbol_attribute): Likewise.
	* primary.c (match_variable): Likewise.
	* resolve.c (resolve_equivalence): Likewise.
	* symbol.c (check_conflict, gfc_add_protected, gfc_copy_attr):
	Likewise.
	* trans-types.c (gfc_get_array_type_bounds): Likewise.

From-SVN: r137980
2008-07-19 16:19:27 +00:00
Janus Weil
8fb74da43b re PR fortran/32580 (iso_c_binding c_f_procpointer / procedure pointers)
2008-07-02  Janus Weil  <janus@gcc.gnu.org>
	    Tobias Burnus  <burnus@net-b.de>
	    Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/32580
	* gfortran.h (struct gfc_symbol): New member "proc_pointer".
	* check.c (gfc_check_associated,gfc_check_null): Implement
	procedure pointers.
	* decl.c (match_procedure_decl): Ditto.
	* expr.c (gfc_check_pointer_assign,gfc_check_assign_symbol): Ditto.
	* interface.c (compare_actual_formal): Ditto.
	* match.h: Ditto.
	* match.c (gfc_match_pointer_assignment): Ditto.
	* parse.c (parse_interface): Ditto.
	* primary.c (gfc_match_rvalue,match_variable): Ditto.
	* resolve.c (resolve_fl_procedure): Ditto.
	* symbol.c (check_conflict,gfc_add_external,gfc_add_pointer,
	gfc_copy_attr,gen_fptr_param,build_formal_args): Ditto.
	* trans-decl.c (get_proc_pointer_decl,gfc_get_extern_function_decl,
	create_function_arglist): Ditto.
	* trans-expr.c (gfc_conv_variable,gfc_conv_function_val,
	gfc_conv_function_call,gfc_trans_pointer_assignment): Ditto.


2008-07-02  Janus Weil  <janus@gcc.gnu.org>
	    Tobias Burnus  <burnus@net-b.de>

	PR fortran/32580
	* gfortran.dg/c_f_pointer_tests_3.f90: Updated.
	* gfortran.dg/proc_decl_1.f90: Updated.
	* gfortran.dg/proc_ptr_1.f90: New.
	* gfortran.dg/proc_ptr_2.f90: New.
	* gfortran.dg/proc_ptr_3.f90: New.
	* gfortran.dg/proc_ptr_4.f90: New.
	* gfortran.dg/proc_ptr_5.f90: New.
	* gfortran.dg/proc_ptr_6.f90: New.
	* gfortran.dg/proc_ptr_7.f90: New.
	* gfortran.dg/proc_ptr_8.f90: New.

Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>
Co-Authored-By: Tobias Burnus <burnus@net-b.de>

From-SVN: r137386
2008-07-02 21:53:37 +02:00
Paul Thomas
c4e3543d04 re PR fortran/36371 (Wrong locus for errors in DATA statement)
2008-06-24  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/34371
	* expr.c (gfc_check_assign):  Change message and locus for
	error when conform == 0.

2008-06-24  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/36371
	* gfortran.dg/data_array_5.f90: New test.

From-SVN: r137088
2008-06-24 21:44:28 +00:00
Kaveh R. Ghazi
ece3f6639d arith.c (hollerith2representation): Fix for -Wc++-compat.
* arith.c (hollerith2representation): Fix for -Wc++-compat.
	* array.c (gfc_get_constructor): Likewise.
	* decl.c (gfc_get_data_variable, gfc_get_data_value, gfc_get_data,
	create_enum_history, gfc_match_final_decl): Likewise.
	* error.c (error_char): Likewise.
	* expr.c (gfc_get_expr, gfc_copy_expr): Likewise.
	* gfortran.h (gfc_get_charlen, gfc_get_array_spec,
	gfc_get_component, gfc_get_formal_arglist, gfc_get_actual_arglist,
	gfc_get_namelist, gfc_get_omp_clauses, gfc_get_interface,
	gfc_get_common_head, gfc_get_dt_list, gfc_get_array_ref,
	gfc_get_ref, gfc_get_equiv, gfc_get_case, gfc_get_iterator,
	gfc_get_alloc, gfc_get_wide_string): Likewise.
	* interface.c (count_types_test): Likewise.
	* intrinsic.c (add_char_conversions, gfc_intrinsic_init_1):
	Likewise.
	* io.c (gfc_match_open, gfc_match_close, match_filepos, match_io,
	gfc_match_inquire, gfc_match_wait): Likewise.
	* match.c (gfc_match, match_forall_iterator): Likewise.
	* module.c (gfc_get_pointer_info, gfc_get_use_rename, add_fixup,
	add_true_name, parse_string, write_atom, quote_string,
	mio_symtree_ref, mio_gmp_real, write_common_0): Likewise.
	* options.c (gfc_post_options): Likewise.
	* primary.c (match_integer_constant, match_hollerith_constant,
	match_boz_constant, match_real_constant,
	gfc_get_structure_ctor_component, gfc_match_structure_constructor): Likewise.
	* scanner.c (gfc_widechar_to_char, add_path_to_list,
	add_file_change, load_line, get_file, preprocessor_line,
	load_file, unescape_filename, gfc_read_orig_filename): Likewise.
	* simplify.c (gfc_simplify_ibits, gfc_simplify_ishft,
	gfc_simplify_ishftc): Likewise.
	* symbol.c (gfc_get_st_label, gfc_get_namespace, gfc_new_symtree,
	gfc_get_uop, gfc_new_symbol, save_symbol_data, gfc_get_gsymbol):
	Likewise.
	* target-memory.c (gfc_target_interpret_expr): Likewise.
	* trans-const.c (gfc_build_wide_string_const): Likewise.
	* trans-expr.c (gfc_add_interface_mapping): Likewise.
	* trans-intrinsic.c (gfc_conv_intrinsic_conversion,
	gfc_conv_intrinsic_int, gfc_conv_intrinsic_lib_function,
	gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_ctime,
	gfc_conv_intrinsic_fdate, gfc_conv_intrinsic_ttynam,
	gfc_conv_intrinsic_minmax, gfc_conv_intrinsic_minmax_char,
	gfc_conv_intrinsic_ishftc, gfc_conv_intrinsic_index_scan_verify,
	gfc_conv_intrinsic_merge, gfc_conv_intrinsic_trim): Likewise.
	* trans.c (gfc_get_backend_locus): Likewise.
	* trans.h (gfc_get_ss): Likewise.

From-SVN: r136982
2008-06-20 06:03:16 +00:00
Janus Weil
e68954309d re PR fortran/36325 (specific or generic INTERFACE implies the EXTERNAL attribute)
2008-05-28  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/36325
	PR fortran/35830
	* interface.c (gfc_procedure_use): Enable argument checking for
	external procedures with explicit interface.
	* symbol.c (check_conflict): Fix conflict checking for externals.
	(copy_formal_args): Fix handling of arrays.
	* resolve.c (resolve_specific_f0, resolve_specific_s0): Fix handling
	of intrinsics.
	* parse.c (parse_interface): Non-abstract INTERFACE statement implies
	EXTERNAL attribute.


2008-05-28  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/36325
	PR fortran/35830
	* gfortran.dg/interface_23.f90: New.
	* gfortran.dg/gomp/reduction3.f90: Fixed invalid code.
	* gfortran.dg/proc_decl_12.f90: New:
	* gfortran.dg/external_procedures_1.f90: Fixed error message.

From-SVN: r136130
2008-05-28 23:27:56 +02:00
Paul Thomas
16f2a7a4a5 re PR fortran/36233 (Array valued actual procedure argument rejected)
2008-05-14  Paul Thomas  <pault@gcc.gnu.org>

       PR fortran/36233
       * interface.c (compare_actual_formal): Do not check sizes if the
       actual is BT_PROCEDURE.

2008-05-14  Paul Thomas  <pault@gcc.gnu.org>

       PR fortran/36233
       * gfortran.dg/actual_procedure_1.f90: New test

From-SVN: r135307
2008-05-14 21:32:53 +00:00
Janus Weil
32d99e6869 gfortran.h (struct gfc_symbol): Moving "interface" member to gfc_typespec (plus fixing a small docu error).
* gfortran.h (struct gfc_symbol): Moving "interface" member to
	gfc_typespec (plus fixing a small docu error).
	* interface.c (gfc_procedure_use): Ditto.
	* decl.c (match_procedure_decl): Ditto.
	* resolve.c (resolve_specific_f0,
	resolve_specific_f0, resolve_symbol): Ditto.

From-SVN: r134867
2008-05-01 19:38:04 +00:00
Daniel Franke
ac05557cc7 re PR fortran/35152 (Implicit procedure with keyword=argument is accepted)
gcc/fortran:
2008-03-19  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/35152
        * interface.c (gfc_procedure_use): Check for keyworded arguments in
        procedures without explicit interfaces.

gcc/testsuite:
2008-03-19  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/35152
        * gfortran.dg/argument_checking_16.f90: New test.

From-SVN: r133347
2008-03-19 15:13:48 -04:00
Tobias Burnus
e19bb1866c re PR fortran/35033 (Valid ASSIGNMENT(=) rejected)
2008-02-26  Tobias Burnus  <burnus@net-b.de>

        PR fortran/35033
        * interface.c (check_operator_interface): Show better line for
        * error
        messages; fix constrains for user-defined assignment operators.
        (gfc_extend_assign): Fix constrains for user-defined assignment
        operators.

2008-02-26  Tobias Burnus  <burnus@net-b.de>

        PR fortran/35033
        * gfortran.dg/assignment_2.f90: New.

From-SVN: r132689
2008-02-26 23:33:35 +01:00
Tobias Schlüter
835aac9231 arith.c: Update copyright years.
* arith.c: Update copyright years.
* arith.h: Likewise.
* array.c: Likewise.
* bbt.c: Likewise.
* check.c: Likewise.
* data.c: Likewise.
* data.h: Likewise.
* decl.c: Likewise.
* dependency.c: Likewise.
* dependency.h: Likewise.
* dump-parse-tree.c: Likewise.
* error.c: Likewise.
* expr.c: Likewise.
* gfc-internals.texi: Likewise.
* gfortran.h: Likewise.
* gfortran.texi: Likewise.
* gfortranspec.c: Likewise.
* interface.c: Likewise.
* intrinsic.c: Likewise.
* intrinsic.h: Likewise.
* intrinsic.texi: Likewise.
* invoke.texi: Likewise.
* io.c: Likewise.
* iresolve.c: Likewise.
* iso-c-binding.def: Likewise.
* iso-fortran-env.def: Likewise.
* lang-specs.h: Likewise.
* lang.opt: Likewise.
* libgfortran.h: Likewise.
* match.c: Likewise.
* match.h: Likewise.
* matchexp.c: Likewise.
* misc.c: Likewise.
* module.c: Likewise.
* openmp.c: Likewise.
* options.c: Likewise.
* parse.c: Likewise.
* parse.h: Likewise.
* primary.c: Likewise.
* resolve.c: Likewise.
* scanner.c: Likewise.
* simplify.c: Likewise.
* st.c: Likewise.
* symbol.c: Likewise.
* target-memory.c: Likewise.
* target-memory.h: Likewise.
* trans-array.h: Likewise.
* trans-const.h: Likewise.
* trans-stmt.h: Likewise.
* trans-types.c: Likewise.
* trans-types.h: Likewise.
* types.def: Likewise.

From-SVN: r132600
2008-02-24 22:43:48 +01:00
Tobias Burnus
b5ca4fd2f6 re PR fortran/34848 (internal compiler error with optional argument of character type and array return type)
2008-01-22  Tobias Burnus  <burnus@net-b.de>

       PR fortran/34848
       * interface.c (compare_actual_formal): Fix adding type
       to missing_arg_type for absent optional arguments.

2008-01-22  Tobias Burnus  <burnus@net-b.de>

       PR fortran/34848
       * gfortran.dg/missing_optional_dummy_4.f90

From-SVN: r131738
2008-01-22 20:35:49 +01:00
Tobias Burnus
d68e117b15 re PR fortran/34901 (add kind information to mismatched-types error message)
2007-01-21  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34901
        * interface.c (compare_parameter): Improved error message
        for arguments of same type and mismatched kinds.

From-SVN: r131700
2008-01-21 19:33:10 +01:00
Tobias Burnus
a0710c29ea re PR fortran/32616 ("Too short actual argument" for array element storage sequence)
2008-01-18  Tobias Burnus  <burnus@net-b.de>

        PR fortran/32616
        * interface.c (get_expr_storage_size): Return storage size
        for array element designators.
        (compare_actual_formal): Reject unequal string sizes for
        assumed-shape dummy arguments. And fix error message for
        array-sections with vector subscripts.

2008-01-18  Tobias Burnus  <burnus@net-b.de>

        PR fortran/32616
        * gfortran.dg/argument_checking_15.f90: New.
        * gfortran.dg/argument_checking_5.f90: Change TODO into
        dg-warning.

From-SVN: r131643
2008-01-19 00:46:04 +01:00
Tobias Burnus
6da0839af3 re PR fortran/34796 (Too strict error checking for assumed-shaped array)
2008-01-16  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34796
        * interface.c (compare_parameter): Allow AS_DEFERRED array
        elements and reject attr.pointer array elemenents.
        (get_expr_storage_size): Return storage size of elements of
        assumed-shape and pointer arrays.

2008-01-16  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34796
        * gfortran.dg/argument_checking_13.f90: New.
        * gfortran.dg/argument_checking_14.f90: New.

From-SVN: r131566
2008-01-16 08:12:00 +01:00
Tobias Burnus
5ad6345e92 re PR fortran/34665 (Cannot pass scalar to array argument 'a')
2008-01-13  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34665
        * resolve.c (resolve_actual_arglist): For expressions,
        also check for assume-sized arrays.
        * interface.c (compare_parameter): Move F2003 character checks
        here, print error messages here, reject elements of
        assumed-shape array as argument to dummy arrays.
        (compare_actual_formal): Update for the changes above.

2008-01-13  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34665
        * gfortran.dg/argument_checking_11.f90: New.
        * gfortran.dg/argument_checking_12.f90: New.
        * gfortran.dg/used_dummy_types_4.f90: Update dg-error.
        * gfortran.dg/c_assoc_2.f03: Update dg-error.
        * gfortran.dg/argument_checking_3.f90: Ditto.
        * gfortran.dg/pointer_intent_2.f90: Ditto.
        * gfortran.dg/import2.f90: Ditto.
        * gfortran.dg/assumed_shape_ranks_1.f90: Ditto.
        * gfortran.dg/implicit_actual.f90: Ditto.
        * gfortran.dg/used_dummy_types_3.f90: Ditto.
        * gfortran.dg/derived_comp_array_ref_6.f90: Ditto.

From-SVN: r131513
2008-01-13 22:35:33 +01:00
Tobias Burnus
ac61ba6af2 re PR fortran/34689 (libgomp.fortran/appendix-a/a.33.3.f90 -O (test for excess errors))
2008-01-06  Tobias Burnus  <burnus@net-b.de>

       PR fortran/34689
       * interface.c (compare_actual_formal): Fix intent(out) check for
       function result variables.

2008-01-06  Tobias Burnus  <burnus@net-b.de>

       PR fortran/34689
       * gfortran.dg/intent_out_4.f90: New.

From-SVN: r131359
2008-01-06 20:36:44 +01:00
Tobias Burnus
a5c655e832 re PR fortran/34662 (inout argument with parameter)
2008-01-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34662
        * interface.c (compare_actual_formal): Reject parameter
        actual to intent(out) dummy.

2008-01-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34662
        * gfortran.dg/intent_out_3.f90: New.

From-SVN: r131348
2008-01-06 10:07:47 +01:00
Paul Thomas
6669dbdf74 re PR fortran/34558 (ICE with same TYPE in both program and interface)
2007-12-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/34558
	* interface.c (gfc_compare_types): Prevent linked lists from
	putting this function into an endless recursive loop.

2007-12-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/34558
	* gfortran.dg/linked_list_1.f90: New test.

From-SVN: r131239
2007-12-31 18:10:55 +00:00
Paul Thomas
63287e10a8 re PR fortran/34558 (ICE with same TYPE in both program and interface)
2007-12-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/34558
	* interface.c (gfc_compare_types): Prevent linked lists from
	putting this function into an endless recursive loop.

2007-12-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/34558
	* gfortran.dg/linked_list_1.f90: New test.

From-SVN: r131238
2007-12-31 18:05:10 +00:00
Tobias Burnus
da9ad92397 re PR fortran/34425 (bogus warning)
2007-12-10  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34425
        * interface.c (get_expr_storage_size): Use signed integer when
        obtaining the bounds.

2007-12-10  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34425
        * gfortran.dg/argument_checking_10.f90: New.

From-SVN: r130752
2007-12-10 22:42:56 +01:00
Paul Thomas
0e5a218b31 re PR fortran/33541 (gfortran wrongly imports renamed-use-associated symbol unrenamed)
2007-11-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/33541
	*interface.c (compare_actual_formal): Exclude assumed size
	arrays from the possibility of scalar to array mapping.
	* decl.c (get_proc_name): Fix whitespace problem.

	PR fortran/34231
	* gfortran.h : Add 'use_rename' bit to symbol_attribute.
	* module.c : Add 'renamed' field to pointer_info.u.rsym.
	(load_generic_interfaces): Add 'renamed' that is set after the
	number_use_names is called.  This is used to set the attribute
	use_rename, which, in its turn identifies those symbols that
	have not been renamed.
	(load_needed): If pointer_info.u.rsym->renamed is set, then
	set the use_rename attribute of the symbol.
	(read_module): Correct an erroneous use of use_flag. Use the
	renamed flag and the use_rename attribute to determine which
	symbols are not renamed.

2007-11-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/33541
	* gfortran.dg/use_11.f90: New test.

	PR fortran/34231
	* gfortran.dg/generic_15.f90: New test.

From-SVN: r130471
2007-11-27 19:21:52 +00:00
Francois-Xavier Coudert
2b77e90812 re PR fortran/25252 (ICE on invalid code)
PR fortran/25252

	* interface.c (gfc_current_interface_head,
	gfc_set_current_interface_head): New functions.
	* decl.c (gfc_match_modproc): Move check for syntax error earlier.
	On syntax error, restore previous state of the interface.
	* gfortran.h (gfc_current_interface_head,
	gfc_set_current_interface_head): New prototypes.

	* gfortran.dg/interface_22.f90: New test.

From-SVN: r130259
2007-11-17 17:49:45 +00:00
Jerry DeLisle
6cc309c923 re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-11-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/33162
	* decl.c (match_procedure_decl): Remove TODO and allow intrinsics in
	PROCEDURE declarations.  Set attr.untyped to allow the interface to be
	resolved later where the symbol type will be set.
	* interface.c (compare_intr_interfaces): Remove static from pointer
	declarations.  Add type and kind checks for dummy function arguments.
	(compare_actual_formal_intr): New function to compare an actual
	argument with an intrinsic function. (gfc_procedures_use): Add check for
	interface that points to an intrinsic function, use the new function.
	* resolve.c (resolve_specific_f0): Resolve the intrinsic interface.
	(resolve_specific_s0): Ditto.

From-SVN: r130168
2007-11-14 00:59:09 +00:00
Tobias Burnus
abf86978b3 re PR fortran/33917 (Rejects valid PROCEDURE declarations)
2007-11-08  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33917
        * interface.c (check_sym_interfaces): Disallow PROCEDURE-declared
        procedures for MODULE PROCEDURE.
        * decl.c (match_procedure_in_interface): Do not mark as procedure.

2007-11-08  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33917
        * gfortran.dg/proc_decl_5.f90: New.
        * gfortran.dg/proc_decl_6.f90: New.

From-SVN: r130002
2007-11-08 16:28:30 +01:00
Jerry DeLisle
26033479fb re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/33162
	* interface.c (compare_intr_interfaces): New function to check intrinsic
	function arguments against formal arguments. (compare_interfaces): Fix
	logic in comparison of function and subroutine attributes.
	(compare_parameter): Use new function for intrinsic as argument.
	* resolve.c (resolve_actual_arglist): Allow an intrinsic without
	function attribute to be checked further.  Set function attribute if
	intrinsic symbol is found, return FAILURE if not.

From-SVN: r129798
2007-10-31 14:26:57 +00:00
Paul Thomas
ee332da9f7 re PR fortran/33542 (gfortran does not detect ambigious specific names if they are the same as generic names)
2007-10-04  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/33542
	* interface.c (check_interface1): Revert patch of 2007-10-02.
	
2007-10-04  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/33542
	* gfortran.dg/ambiguous_specific_1.f90: Remove.

From-SVN: r129000
2007-10-04 04:45:41 +00:00
Paul Thomas
dcd3d96354 re PR fortran/33542 (gfortran does not detect ambigious specific names if they are the same as generic names)
2007-10-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/33542
	* interface.c (check_interface1): Specific procedures are
	always ambiguous if they have the same name.

2007-10-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/33542
	* gfortran.dg/ambiguous_specific_1.f90: New test.

From-SVN: r128954
2007-10-02 11:45:11 +00:00
Janus Weil
6977374226 decl.c (match_procedure_decl,match_procedure_in_interface, [...]): Handle PROCEDURE statements.
2007-09-04  Janus Weil  <jaydub66@gmail.com>
	    Paul Thomas  <pault@gcc.gnu.org>

	* decl.c (match_procedure_decl,match_procedure_in_interface,
	gfc_match_procedure): Handle PROCEDURE statements.
	* gfortran.h (struct gfc_symbol): New member "gfc_symbol *interface".
	(enum gfc_statement): New element "ST_PROCEDURE".
	(strcut symbol_attribute): New member "unsigned procedure".
	* interface.c (check_interface0): Extended error checking.
	* match.h: Add gfc_match_procedure prototype.
	* parse.c (decode_statement,next_statement,gfc_ascii_statement,
	parse_derived,parse_interface): Implement PROCEDURE statements.
	* resolve.c (resolve_symbol): Ditto.
	* symbol.c (check_conflict): Ditto.
	(gfc_add_proc): New function for setting the procedure attribute.
	(copy_formal_args): New function for copying formal argument lists.


2007-09-04  Janus Weil  <jaydub66@gmail.com>
	    Tobias Burnus  <burnus@net-b.de>

	* gfortran.dg/proc_decl_1.f90: New.
	* gfortran.dg/proc_decl_2.f90: New.
	* gfortran.dg/proc_decl_3.f90: New.
	* gfortran.dg/proc_decl_4.f90: New.


Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>
Co-Authored-By: Tobias Burnus <burnus@net-b.de>

From-SVN: r128081
2007-09-04 15:50:35 +02:00
Tobias Burnus
e9f63ace23 re PR fortran/33228 (Accepts use-associated functions in MODULE PROCEDURE)
2007-08-30  Tobias Burnus  <burnus@net-b.de>

	PR fortran/33228
	* interface.c (check_interface0): Improve error for external procs.
	(check_sym_interfaces): Fix checking of module procedures.

2007-08-30  Tobias Burnus  <burnus@net-b.de>

	PR fortran/33228
	* gfortran.dg/generic_9.f90: Update error message.
	* gfortran.dg/generic_14.f90: New.

From-SVN: r127925
2007-08-30 15:44:47 +02:00
Tobias Burnus
9e1d712c40 [multiple changes]
2007-08-18  Paul Thomas  <pault@gcc.gnu.org>
	    Janus Weil  <jaydub66@gmail.com>

	* interface.c (gfc_match_interface,gfc_match_abstract_interface,
	gfc_match_end_interface,gfc_add_interface): Add abstract interface.
	* dump-parse-tree.c (gfc_show_attr): Ditto.
	* gfortran.h (interface_type,symbol_attribute): Ditto.
	* module.c (gfc_match_use,ab_attribute,attr_bits,
	mio_symbol_attribute): Ditto.
	* resolve.c (resolve_function): Ditto.
	* match.h: Ditto.
	* parse.c (decode_statement): Ditto.
	(parse_interface): Ditto, check for C1203 (name of abstract interface
	cannot be the same as an intrinsic type).
	* decl.c (gfc_match_bind_c): Check for NAME= with abstract interfaces.
	(access_attr_decl): Handle Abstract interfaces.


2007-08-17  Tobias Burnus  <burnus@net-b.de>

	* gfortran.dg/interface_abstract_1.f90: New.

From-SVN: r127612
2007-08-18 16:57:21 +02:00
Francois-Xavier Coudert
096f0d9dbc re PR fortran/32860 (Support %ld (for "long") for gfc_warning)
PR fortran/32860

	* error.c (error_uinteger): New function.
	(error_integer): Call error_uinteger.
	(error_print): Handle %u, %lu, %li and %ld format specifiers.
	* interface.c (compare_actual_formal): Use the new %lu specifier.

	* c-format.c (gcc_gfc_length_specs): New array.
	(gcc_gfc_char_table): Add unsigned specifier, and references to
	the l length modifier.
	(format_types_orig): Use the new gcc_gfc_length_specs.

	* gcc.dg/format/gcc_gfc-1.c: Updated with new formats.

From-SVN: r127382
2007-08-12 20:39:18 +00:00
Nick Clifton
d234d78859 arith.c: Change copyright header to refer to version 3 of the GNU General Public...
* arith.c: Change copyright header to refer to version 3 of the GNU General 
  Public License and to point readers at the COPYING3 file and the FSF's 
  license web page.
* openmp.c, interface.c, intrinsic.c, trans-array.c, trans-expr.c, symbol.c, 
  iso-fortran-env.def, intrinsic.h, decl.c, trans-array.h, matchexp.c, 
  dump-parse-tree.c, trans-common.c, array.c, Make-lang.in, trans-openmp.c, 
  gfortran.h, error.c, iso-c-binding.def, lang.opt, data.c, trans-const.c, 
  trans-stmt.c, expr.c, trans-const.h, trans-stmt.h, module.c, trans.c, 
  scanner.c, trans-types.c, trans.h, gfortranspec.c, trans-types.h, 
  lang-specs.h, io.c, bbt.c, resolve.c, f95-lang.c, st.c, iresolve.c, match.c,
  trans-decl.c, trans-io.c, target-memory.c, match.h, target-memory.h, parse.c,
  arith.h, check.c, dependency.c, parse.h, types.def, convert.c, dependency.h,
  primary.c, trans-intrinsic.c, options.c, misc.c, simplify.c: Likewise.

From-SVN: r127129
2007-08-01 16:29:36 +00:00
Kazu Hirata
1207ac677d gfortran.h, [...]: Fix comment typos.
* gfortran.h, interface.c, resolve.c, symbol.c: Fix comment
	typos.
	* intrinsic.texi, invoke.texi: Fix typos.

From-SVN: r127029
2007-07-28 23:46:26 +00:00
Daniel Franke
3bed9dd023 re PR fortran/17711 (Wrong operator name in error message)
gcc/fortran:
2007-07-08  Daniel Franke  <franke.daniel@gmail.com>
	    Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>

	PR fortran/17711
	* gfortran.h (gfc_intrinsic_op): Added INTRINSIC_EQ_OS,
	INTRINSIC_NE_OS, INTRINSIC_GT_OS, INTRINSIC_GE_OS, 
	INTRINSIC_LT_OS and INTRINSIC_LE_OS.
	* arith.c (eval_intrinsic, eval_type_intrinsic0): Likewise.
	* arith.h (gfc_eq, gfc_ne, gfc_gt, gfc_ge, gfc_lt, gfc_le):
	Added gfc_intrinsic_op as third argument type.
	* dump-parse-tree.c (gfc_show_expr): Account for new enum values.
	* expr.c (simplify_intrinsic_op, check_intrinsic_op): Likewise.
	* interface.c (check_operator_interface): Likewise.
	(gfc_check_interfaces): Added cross-checks for FORTRAN 77 and 
	Fortran 90 style operators using new enum values.
	(gfc_extend_expr): Likewise.
	(gfc_add_interface): Likewise.
	* match.c (intrinsic_operators): Distinguish FORTRAN 77 style
	operators from Fortran 90 style operators using new enum values.
	* matchexp.c (match_level_4): Account for new enum values.
	* module.c (mio_expr): Likewise.
	* resolve.c (resolve_operator): Deal with new enum values, fix
	inconsistent error messages.
	* trans-expr.c (gfc_conv_expr_op): Account for new enum values.

gcc/testsuite:
2007-07-08  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/17711
	* gfortran.dg/operator_4.f90: New test.
	* gfortran.dg/operator_5.f90: New test.
	* gfortran.dg/logical_comp.f90: Adjusted error messages.
	* gfortran.dg/module_md5_1.f90: Adjusted MD5 sum.


Co-Authored-By: Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>

From-SVN: r126468
2007-07-08 17:08:52 -04:00
Tobias Burnus
376397285d re PR fortran/32669 ("Actual argument contains too few elements for dummy argument" is triggered for valid code)
2007-07-08  Tobias Burnus  <burnus@net-b.de>

	PR fortran/32669
	* interface.c (get_expr_storage_size): Properly obtain lower bound.
	(compare_actual_formal): Add space before parenthesis.

2007-07-08  Tobias Burnus  <burnus@net-b.de>

	PR fortran/32669
	* gfortran.dg/argument_checking_6.f90: New.

From-SVN: r126467
2007-07-08 22:57:07 +02:00
Kazu Hirata
86bf520d74 decl.c, [...]: Fix comment typos.
* decl.c, gfortran.h, interface.c, module.c, resolve.c,
	trans-array.c, trans-decl.c: Fix comment typos.  Follow
	spelling conventions.
	* intrinsic.texi: Fix typos.  Follow spelling conventions.

From-SVN: r126440
2007-07-07 13:15:40 +00:00
Tobias Burnus
2d5b90b2fd re PR fortran/30940 (Fortran 2003: Scalar CHARACTER supplied to array dummy)
2007-07-03  Tobias Burnus  <burnus@net-b.de>

	PR fortran/30940
	* interface.c (get_sym_storage_size): New function.
	(get_sym_storage_size): New function.
	(compare_actual_formal): Enhance sequence association
	support and improve checking.

2007-07-03  Tobias Burnus  <burnus@net-b.de>

	PR fortran/30940
	* gfortran.dg/argument_checking_1.f90: New.
	* gfortran.dg/argument_checking_2.f90: New.
	* gfortran.dg/argument_checking_3.f90: New.
	* gfortran.dg/argument_checking_4.f90: New.
	* gfortran.dg/argument_checking_5.f90: New.
	* gfortran.fortran-torture/execute/st_function_1.f90: Add dg-warning.
	* gfortran.fortran-torture/execute/st_function.f90: Add dg-warning.

From-SVN: r126271
2007-07-03 21:16:42 +02:00
Christopher D. Rickett
a8b3b0b633 [multiple changes]
2007-07-01  Christopher D. Rickett  <crickett@lanl.gov>

	* interface.c (gfc_compare_derived_types): Special case for comparing
	derived types across namespaces.
	(gfc_compare_types): Deal with BT_VOID.
	(compare_parameter): Use BT_VOID to accept ISO C Binding pointers.
	* trans-expr.c (gfc_conv_function_call): Remove setting parm_kind
	to SCALAR
	(gfc_conv_initializer): Deal with ISO C Binding NULL_PTR and 
	NULL_FUNPTR.
	(gfc_conv_expr): Convert expressions for ISO C Binding derived types.
	* symbol.c (gfc_set_default_type): BIND(C) variables should not be
	implicitly declared.
	(check_conflict): Add BIND(C) and check for conflicts.
	(gfc_add_explicit_interface): Whitespace.	
	(gfc_add_is_bind_c): New function.  
	(gfc_copy_attr): Use it.
	(gfc_new_symbol): Initialize ISO C Binding objects.
	(get_iso_c_binding_dt):  New function.
	(verify_bind_c_derived_type): Ditto.
	(gen_special_c_interop_ptr): Ditto.
	(add_formal_arg): Ditto.
	(gen_cptr_param): Ditto.
	(gen_fptr_param): Ditto.
	(gen_shape_param): Ditto.
	(add_proc_interface): Ditto.
	(build_formal_args): Ditto.
	(generate_isocbinding_symbol):  Ditto.
	(get_iso_c_sym):  Ditto.
	* decl.c (num_idents_on_line, has_name_equals): New variables.
	(verify_c_interop_param): New function.
	(build_sym): Finish binding labels and deal with COMMON blocks.
	(add_init_expr_to_sym): Check if the initialized expression is
	an iso_c_binding named constants
	(variable_decl): Set ISO C Binding type_spec components.
	(gfc_match_kind_spec): Check match for C interoperable kind.
	(match_char_spec): Fix comment. Chnage gfc_match_small_int
	to gfc_match_small_int_expr.  Check for C interoperable kind.
	(match_type_spec): Clear the current binding label.
	(match_attr_spec): Add DECL_IS_BIND_C.  If BIND(C) is found, use it
	to set attributes.
	(set_binding_label): New function.
	(set_com_block_bind_c): Ditto.
	(verify_c_interop): Ditto.
	(verify_com_block_vars_c_interop): Ditto.
	(verify_bind_c_sym): Ditto.
	(set_verify_bind_c_sym): Ditto.
	(set_verify_bind_c_com_block): Ditto.
	(get_bind_c_idents): Ditto.
	(gfc_match_bind_c_stmt): Ditto.
	(gfc_match_data_decl): Use num_idents_on_line.
	(match_result): Deal with right paren in BIND(C).
	(gfc_match_suffix): New function.
	(gfc_match_function_decl): Use it.  Code is re-arranged to deal with
	ISO C Binding result clauses.
	(gfc_match_subroutine):  Deal with BIND(C).
 	(gfc_match_bind_c): New function.
	(gfc_get_type_attr_spec): New function.  Code is re-arranged in and
	taken from gfc_match_derived_decl.
	(gfc_match_derived_decl): Add check for BIND(C).
	* trans-common.c: Forward declare gfc_get_common.
	(gfc_sym_mangled_common_id): Change arg from 'const char *name' to
	'gfc_common_head *com'.  Check for ISO C Binding of the common block.
	(build_common_decl): 'com->name' to 'com in SET_DECL_ASSEMBLER_NAME.
	* gfortran.h: Add GFC_MAX_BINDING_LABEL_LEN
	(bt): Add BT_VOID
	(sym_flavor): Add FL_VOID.
 	(iso_fortran_env_symbol, iso_c_binding_symbol, intmod_id): New enum
	(CInteropKind_t): New struct.
	(c_interop_kinds_table): Use it.  Declare an array of structs.
	(symbol_attribute): Add is_bind_c, is_c_interop, and is_iso_c
	bitfields.
	(gfc_typespec): Add is_c_interop; is_iso_c, and f90_type members.
	(gfc_symbol): Add from_intmod, intmod_sym_id, binding_label, and
	common_block members.
	(gfc_common_head): Add binding_label and is_bind_c members.
	(gfc_gsymbol): Add sym_name, mod_name, and binding_label members.
	Add prototypes for get_c_kind, gfc_validate_c_kind, 
	gfc_check_any_c_kind, gfc_add_is_bind_c, gfc_add_value,
	verify_c_interop, verify_c_interop_param, verify_bind_c_sym,
	verify_bind_c_derived_type, verify_com_block_vars_c_interop,
	generate_isocbinding_symbol, get_iso_c_sym, gfc_iso_c_sub_interface
	* iso-c-binding.def: New file. This file contains the definitions
	of the types provided by the Fortran 2003 ISO_C_BINDING intrinsic
	module.
	* trans-const.c (gfc_conv_constant_to_tree): Deal with C_NULL_PTR
	 or C_NULL_FUNPTR expressions.
	* expr.c (gfc_copy_expr): Add BT_VOID case.  For BT_CHARACTER, the
	ISO C Binding requires a minimum string length of 1 for '\0'.  
	* module.c (intmod_sym): New struct.
	(pointer_info): Add binding_label member.
	(write_atom): Set len to 0 for NULL pointers. Check for NULL p and *p.
	(ab_attribute): Add AB_IS_BIND_C, AB_IS_C_INTEROP and AB_IS_ISO_C.
	(attr_bits): Add "IS_BIND_C", "IS_C_INTEROP", and "IS_ISO_C".
	(mio_symbol_attribute): Deal with ISO C Binding attributes.
	(bt_types): Add "VOID".
	(mio_typespec): Deal with ISO C Binding components.
	(mio_namespace_ref): Add intmod variable. 
	(mio_symbol): Check for symbols from an intrinsic module.
	(load_commons): Check for BIND(C) common block.
	(read_module): Read binding_label and use it.
	(write_common): Add label.  Write BIND(C) info.
	(write_blank_common): Blank commons are not BIND(C).  Explicitly
	set is_bind_c=0.
	(write_symbol): Deal with binding_label.
	(sort_iso_c_rename_list): New function.
	(import_iso_c_binding_module): Ditto.
	(create_int_parameter): Add to args.
	(use_iso_fortran_env_module): Adjust to deal with iso_c_binding
	intrinsic module.
	* trans-types.c (c_interop_kinds_table): new array of structs. 
	(gfc_validate_c_kind): New function.
	(gfc_check_any_c_kind): Ditto.
	(get_real_kind_from_node): Ditto.
	(get_int_kind_from_node): Ditto.
	(get_int_kind_from_width): Ditto.
	(get_int_kind_from_minimal_width): Ditto.
	(init_c_interop_kinds): Ditto.
	(gfc_init_kinds): call init_c_interop_kinds.
	(gfc_typenode_for_spec): Adjust for BT_VOID and ISO C Binding pointers.
	Adjust handling of BT_DERIVED.
	(gfc_sym_type): Whitespace.
	(gfc_get_derived_type):  Account for iso_c_binding derived types
	* resolve.c (is_scalar_expr_ptr): New function.
	(gfc_iso_c_func_interface): Ditto.
	(resolve_function): Use gfc_iso_c_func_interface. 
	(set_name_and_label): New function.
	(gfc_iso_c_sub_interface): Ditto.
	(resolve_specific_s0): Use gfc_iso_c_sub_interface.
	(resolve_bind_c_comms): New function.
	(resolve_bind_c_derived_types): Ditto.
	(gfc_verify_binding_labels): Ditto.
	(resolve_fl_procedure): Check for ISO C interoperability.
	(resolve_symbol): Check C interoperability.
	(resolve_types): Walk the namespace.  Check COMMON blocks.
	* trans-decl.c (gfc_sym_mangled_identifier):  Prevent the mangling
	of identifiers that have an assigned binding label.
	(gfc_sym_mangled_function_id): Use the binding label rather than
	the mangled name.
	(gfc_finish_var_decl): Put variables that are BIND(C) into a common
	segment of the object file, because this is what C would do.
	(gfc_create_module_variable): Conver to proper types
	(set_tree_decl_type_code): New function.
	(generate_local_decl): Check dummy variables and derived types for
	ISO C Binding attributes.
	* match.c (gfc_match_small_int_expr): New function.
	(gfc_match_name_C): Ditto.
	(match_common_name): Deal with ISO C Binding in COMMON blocks
	* trans-io.c (transfer_expr):  Deal with C_NULL_PTR or C_NULL_FUNPTR
	expressions
	* match.h: Add prototypes for gfc_match_small_int_expr,
	gfc_match_name_C, match_common_name, set_com_block_bind_c,
	set_binding_label, set_verify_bind_c_sym,
	set_verify_bind_c_com_block, get_bind_c_idents,
	gfc_match_bind_c_stmt, gfc_match_suffix, gfc_match_bind_c,
	gfc_get_type_attr_spec
	* parse.c (decode_statement): Use gfc_match_bind_c_stmt
	(parse_derived): Init *derived_sym = NULL, and gfc_current_block
	later for valiadation.
	* primary.c (got_delim): Set ISO C Binding components of ts.
	(match_logical_constant): Ditto.
	(match_complex_constant): Ditto.
	(match_complex_constant): Ditto.
	(gfc_match_rvalue): Check for existence of at least one arg for
	C_LOC, C_FUNLOC, and C_ASSOCIATED.
	* misc.c (gfc_clear_ts): Clear ISO C Bindoing components in ts.
	(get_c_kind): New function.

2007-07-01  Christopher D. Rickett  <crickett@lanl.gov>

	* Makefile.in: Add support for iso_c_generated_procs.c and
	iso_c_binding.c.
	* Makefile.am: Ditto.
	* intrinsics/iso_c_generated_procs.c: New file containing helper
	functions.
	* intrinsics/iso_c_binding.c: Ditto.
	* intrinsics/iso_c_binding.h: New file
	* gfortran.map: Include the __iso_c_binding_c_* functions.
	* libgfortran.h: define GFC_NUM_RANK_BITS.

2007-06-23  Christopher D. Rickett  <crickett@lanl.gov>

	* bind_c_array_params.f03: New files for Fortran 2003 ISO C Binding.
	* bind_c_coms.f90: Ditto.
	* bind_c_coms_driver.c: Ditto.
	* bind_c_dts.f90: Ditto.
	* bind_c_dts_2.f03: Ditto.
	* bind_c_dts_2_driver.c: Ditto.
	* bind_c_dts_3.f03: Ditto.
	* bind_c_dts_4.f03: Ditto.
	* bind_c_dts_driver.c: Ditto.
	* bind_c_implicit_vars.f03: Ditto.
	* bind_c_procs.f03: Ditto.
	* bind_c_usage_2.f03: Ditto.
	* bind_c_usage_3.f03: Ditto.
	* bind_c_usage_5.f03: Ditto.
	* bind_c_usage_6.f03: Ditto.
	* bind_c_usage_7.f03: Ditto.
	* bind_c_vars.f90: Ditto.
	* bind_c_vars_driver.c: Ditto.
	* binding_c_table_15_1.f03: Ditto.
	* binding_label_tests.f03: Ditto.
	* binding_label_tests_10.f03: Ditto.
	* binding_label_tests_10_main.f03: Ditto.
	* binding_label_tests_11.f03: Ditto.
	* binding_label_tests_11_main.f03: Ditto.
	* binding_label_tests_12.f03: Ditto.
	* binding_label_tests_13.f03: Ditto.
	* binding_label_tests_13_main.f03: Ditto.
	* binding_label_tests_14.f03: Ditto.
	* binding_label_tests_2.f03: Ditto.
	* binding_label_tests_3.f03: Ditto.
	* binding_label_tests_4.f03: Ditto.
	* binding_label_tests_5.f03: Ditto.
	* binding_label_tests_6.f03: Ditto.
	* binding_label_tests_7.f03: Ditto.
	* binding_label_tests_8.f03: Ditto.
	* binding_label_tests_9.f03: Ditto.
	* c_assoc.f90: Ditto.
	* c_assoc_2.f03: Ditto.
	* c_f_pointer_shape_test.f90: Ditto.
	* c_f_pointer_tests.f90: Ditto.
	* c_f_tests_driver.c: Ditto.
	* c_funloc_tests.f03: Ditto.
	* c_funloc_tests_2.f03: Ditto.
	* c_funloc_tests_3.f03: Ditto.
	* c_funloc_tests_3_funcs.c: Ditto.
	* c_kind_params.f90: Ditto.
	* c_kind_tests_2.f03: Ditto.
	* c_kinds.c: Ditto.
	* c_loc_driver.c: Ditto.
	* c_loc_test.f90: Ditto.
	* c_loc_tests_2.f03: Ditto.
	* c_loc_tests_2_funcs.c: Ditto.
	* c_loc_tests_3.f03: Ditto.
	* c_loc_tests_4.f03: Ditto.
	* c_loc_tests_5.f03: Ditto.
	* c_loc_tests_6.f03: Ditto.
	* c_loc_tests_7.f03: Ditto.
	* c_loc_tests_8.f03: Ditto.
	* c_ptr_tests.f03: Ditto.
	* c_ptr_tests_10.f03: Ditto.
	* c_ptr_tests_5.f03: Ditto.
	* c_ptr_tests_7.f03: Ditto.
	* c_ptr_tests_7_driver.c: Ditto.
	* c_ptr_tests_8.f03: Ditto.
	* c_ptr_tests_8_funcs.c: Ditto.
	* c_ptr_tests_9.f03: Ditto.
	* c_ptr_tests_driver.c: Ditto.
	* c_size_t_driver.c: Ditto.
	* c_size_t_test.f03: Ditto.
	* com_block_driver.f90: Ditto.
	* global_vars_c_init.f90: Ditto.
	* global_vars_c_init_driver.c: Ditto.
	* global_vars_f90_init.f90: Ditto.
	* global_vars_f90_init_driver.c: Ditto.
	* interop_params.f03: Ditto.
	* iso_c_binding_only.f03: Ditto.
	* iso_c_binding_rename_1.f03: Ditto.
	* iso_c_binding_rename_1_driver.c: Ditto.
	* iso_c_binding_rename_2.f03: Ditto.
	* iso_c_binding_rename_2_driver.c: Ditto.
	* kind_tests_2.f03: Ditto.
	* kind_tests_3.f03: Ditto.
	* module_md5_1.f90: Ditto.
	* only_clause_main.c: Ditto.
	* print_c_kinds.f90: Ditto.
	* test_bind_c_parens.f03: Ditto.
	* test_c_assoc.c: Ditto.
	* test_com_block.f90: Ditto.
	* test_common_binding_labels.f03: Ditto.
	* test_common_binding_labels_2.f03: Ditto.
	* test_common_binding_labels_2_main.f03: Ditto.
	* test_common_binding_labels_3.f03: Ditto.
	* test_common_binding_labels_3_main.f03: Ditto.
	* test_only_clause.f90: Ditto.
	* use_iso_c_binding.f90: Ditto.
	* value_5.f90: Ditto.
	* value_test.f90: Ditto.
	* value_tests_f03.f90: Ditto.

From-SVN: r126185
2007-07-02 02:47:21 +00:00
Tobias Burnus
2eae3dc776 re PR fortran/32460 (structure constructor not allowed if a USEd type has private components)
2007-06-24  Tobias Burnus  <burnus@net-de>

	PR fortran/32460
	* interface.c (gfc_compare_derived_types): Add access check.
	* symbol.c (gfc_find_component): Ditto.
	(gfc_set_component_attr,gfc_get_component_attr) Copy access state.
	* dump-parse-tree.c (gfc_show_components): Dump access state.
	* gfortran.h (struct gfc_component): Add gfc_access.
	* module.c (mio_component): Add access state.
	* (gfc_match_structure_constructor): Check for private access state.

2007-06-24  Tobias Burnus  <burnus@net-de>

	PR fortran/32460
	* gfortran.dg/private_type_6.f90: New.

From-SVN: r125984
2007-06-24 18:19:11 +02:00
Tobias Burnus
59be80716a re PR fortran/32323 (Accepts invalid vector subscript actual argument for intent(out) dummy argument)
2007-06-13  Tobias Burnus  <burnus@net-b.de>

	PR fortran/32323
	* interface.c (has_vector_section): New.
	(compare_actual_formal): Check for array sections with vector subscript.

2007-06-13  Tobias Burnus  <burnus@net-b.de>

	PR fortran/32323
	* gfortran.dg/actual_array_vect_1.f90: New.

From-SVN: r125684
2007-06-13 22:12:40 +02:00
Steven G. Kargl
66e4ab3127 decl.c: Miscellaneous whitespace fixes.
* decl.c: Miscellaneous whitespace fixes.
* expr.c: Likewise.
* gfortran.h: Likewise.
* interface.c : Likewise.
* io.c: Likewise.
* match.c: Likewise.
* match.h: Likewise.
* module.c: Likewise.
* parse.c: Likewise.
* resolve.c: Likewise.
* symbol.c: Likewise.
* trans-array.c: Likewise.
* trans-common.c: Likewise.
* trans-decl.c: Likewise.
* trans-intrinsic.c: Likewise.
* trans-io.c: Likewise.
* trans-stmt.c: Likewise.
* trans-types.c: Likewise.

From-SVN: r125533
2007-06-07 11:10:31 -07:00
Tobias Burnus
a0324f7b5a re PR fortran/25071 (dummy argument larger than actual argument)
2007-05-04  Tobias Burnus  <burnus@net-b.de>

        PR fortran/25071
        * interface.c (compare_actual_formal): Check character length.

2007-05-04  Tobias Burnus  <burnus@net-b.de>

        PR fortran/25071
        * gfortran.dg/char_length_3.f90: New test.
        * gfortran.dg/char_result_2.f90: Fix test.

From-SVN: r124411
2007-05-04 09:54:06 +02:00
Francois-Xavier Coudert
271892929a re PR fortran/30877 (Extending intrinsic operators)
PR fortran/30877

	* fortran/interface.c (check_operator_interface): Implement
	the standard checks on user operators extending intrinsic operators.
	* fortran/resolve.c (resolve_operator): If the ranks of operators
	don't match, don't error out but try the user-defined ones first.

	* gfortran.dg/operator_1.f90: New test.
	* gfortran.dg/operator_2.f90: New test.

From-SVN: r123196
2007-03-25 09:01:23 +00:00
Tobias Burnus
9bce3c1cc4 re PR fortran/30520 (Conflics checking of VOLATILE attribute needs improvement)
fortran/
2007-01-31  Tobias Burnus  <burnus@net-b.de>

       PR fortran/30520
       * interface.c (compare_actual_formal): Check conformance between
         actual and VOLATILE dummy arguments.
       * symbol.c (gfc_add_volatile): Allow setting of VOLATILE
         multiple times in different scopes.
       * decl.c (gfc_match_volatile): Search symbol in host association.

testsuite/
2007-01-31  Tobias Burnus  <burnus@net-b.de>

       PR fortran/30520
       * gfortran.dg/volatile8.f90: New argument conformance test.
       * gfortran.dg/volatile9.f90: New scope test.

From-SVN: r121379
2007-01-31 10:18:33 +01:00
Steven G. Kargl
b251af9792 interface.c, [...]: Update Copyright years.
2007-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>

    * interface.c, intrinsic.c, gfortranspec.c, io.c, f95-lang.c,
    iresolve.c, match.c:  Update Copyright years.  Whitespace.

From-SVN: r120587
2007-01-08 19:02:08 +00:00
Tobias Burnus
f17facacf2 re PR fortran/29624 (Fortran 2003: Support intent for pointers)
fortran/
2007-01-05  Tobias Burnus  <burnus@net-b.de>

        PR fortran/29624
        * interface.c (compare_parameter_intent): New function.
          (check_intents): Support pointer intents.
        * symbol.c (check_conflict): Support pointer intents,
          better conflict_std message.
        * expr.c (gfc_check_assign,gfc_check_pointer_assign):
          Support pointer intents.
        * resolve.c (resolve_deallocate_expr,resolve_allocate_expr):
          Support pointer intents.

testsuite/
2006-01-05  Tobias Burnus  <burnus@net-b.de>

        PR fortran/29624
        * gfortran.dg/alloc_alloc_expr_1.f90: Add check for
          invalid deallocate.
        * gfortran.dg/allocatable_dummy_2.f90: Update dg-error.
        * gfortran.dg/protected_4.f90: Add pointer intent check.
        * gfortran.dg/protected_6.f90: Add pointer intent check.
        * gfortran.dg/pointer_intent_1.f90: New test.
        * gfortran.dg/pointer_intent_2.f90: New test.
        * gfortran.dg/pointer_intent_3.f90: New test.

From-SVN: r120472
2007-01-05 10:08:37 +01:00
Brooks Moses
3ab7b3def2 re PR fortran/30235 ([4.1 only] missing alternate return argument with explicit interface causes segfault)
fortran/
	PR 30235
	* interface.c (compare_actual_formal): check for
	alternate returns when iterating over non-present
	arguments.

testsuite/
	PR 30235
	* gfortran.dg/altreturn_2.f90: new test.

From-SVN: r120447
2007-01-04 09:30:37 -08:00
Paul Thomas
ff60488853 re PR fortran/20896 (ambiguous interface not detected)
2007-01-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20896
	* interface.c (check_sym_interfaces): Remove call to
	resolve_global_procedure.
	gfortran.h : Remove prototype for resolve_global_procedure.
	resolve.c (resolve_global_procedure): Add static attribute
	to function declaration.

2007-01-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20896
	* gfortran.dg/interface_10.f90: Remove.

From-SVN: r120342
2007-01-02 14:23:36 +00:00
Paul Thomas
7fcafa718d re PR fortran/23060 (%VAL, %REF and %DESCR constructs not implemented)
2006-12-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/23060
	* intrinsic.c (compare_actual_formal ): Distinguish argument
	list functions from keywords.
	* intrinsic.c (sort_actual): If formal is NULL, the presence of
	an argument list function actual is an error.
	* trans-expr.c (conv_arglist_function) : New function to
	implement argument list functions %VAL, %REF and %LOC.
	(gfc_conv_function_call): Call it.
	* resolve.c (resolve_actual_arglist): Add arg ptype and check
	argument list functions.
	(resolve_function, resolve_call): Set value of ptype before
	calls to resolve_actual_arglist.
	* primary.c (match_arg_list_function): New function.
	(gfc_match_actual_arglist): Call it before trying for a
	keyword argument.

2006-12-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/23060
	* gfortran.dg/c_by_val.c: Called by c_by_val_1.f.
	* gfortran.dg/c_by_val_1.f: New test.
	* gfortran.dg/c_by_val_2.f: New test.
	* gfortran.dg/c_by_val_3.f: New test.

From-SVN: r120295
2006-12-31 06:55:16 +00:00
Gerald Pfeifer
88549b8155 interface.c (compare_actual_formal): Remove unused variable gsym.
* interface.c (compare_actual_formal): Remove unused variable
	gsym.

From-SVN: r120219
2006-12-27 16:30:11 +00:00
Paul Thomas
9914f8cff9 re PR fortran/20896 (ambiguous interface not detected)
2006-12-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20896
	* interface.c (check_sym_interfaces): Try to resolve interface
	reference as a global symbol, if it is not a nodule procedure.
	(compare_actual_formal): Remove call to gfc_find_symbol; if
	the expression is already a variable it is locally declared
	and this has precedence.
	gfortran.h : Add prototype for resolve_global_procedure.
	resolve.c (resolve_global_procedure): Remove static attribute
	from function declaration.
	(resolve_fl_procedure): Remove symtree declaration and the
	redundant check for an ambiguous procedure.

	PR fortran/25135
	* module.c (load_generic_interfaces): If the symbol is present
	and is not generic it is ambiguous.

2006-12-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20896
	* gfortran.dg/interface_10.f90: New test.
	* gfortran.dg/dummy_procedure_1.f90: Add error for call s1(z),
	since z is already, locally a variable.

	PR fortran/25135
	* gfortran.dg/generic_11.f90: New test.
	* gfortran.dg/interface_7.f90: Remove name clash between module
	name and procedure 'x' referenced in the interface.

From-SVN: r120218
2006-12-27 13:46:47 +00:00
Kazu Hirata
4c256e3482 * interface.c: Fix a comment typo.
From-SVN: r120135
2006-12-22 01:09:02 +00:00
Paul Thomas
71f77fd790 re PR fortran/29992 ([4.1 only] INTERFACE equivalent to MODULE PROCEDURE?!)
2006-12-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/29992
	* interface.c (check_sym_interfaces): Module procedures in a
	generic must be use associated or contained in the module.
	* decl.c (gfc_match_modproc): Set attribute mod_proc.
	* gfortran.h (symbol_attribute): Add mod_proc atribute.

	PR fortran/30081
	* resolve.c (resolve_generic_f, resolve_generic_s): Use
	gfc_intrinsic_name to find out if the function is intrinsic
	because it does not have to be a generic intrinsic to be
	overloaded.

2006-12-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/29992
	* gfortran.dg/generic_9.f90: New test.

	PR fortran/30081
	* gfortran.dg/generic_10.f90: New test.

From-SVN: r120072
2006-12-20 13:48:06 +00:00
Paul Thomas
26f2ca2b6f re PR fortran/30236 ([4.1 only]alternate-return subroutine in generic interface causes ice/segfault)
2006-12-19  Paul Thomas <pault@gcc.gnu.org>

	PR fortran/30236
	* interface.c (compare_interfaces): Handle NULL symbols.
	(count_types_test): Count NULL symbols, which correspond to
	alternate returns.

	(check_interface1): Change final argument from int to bool
	in the function and all references.

2006-12-19  Paul Thomas <pault@gcc.gnu.org>

	PR fortran/30236
	* gfortran.dg/altreturn_3.f90: New test.

	* gfortran.dg/char_result_12.f90: Fix comment typos.

From-SVN: r120052
2006-12-19 17:02:20 +00:00
Tobias Burnus
ee7e677fdd re PR fortran/23994 (PROTECTED attribute (F2003) is not implemented)
fortran/
2006-12-10  Tobias Burnus  <burnus@net-b.de>

    PR fortran/23994
    * interface.c (compare_actual_formal): PROTECTED is incompatible
with intent(out).
    * symbol.c (check_conflict): Check for PROTECTED conflicts.
      (gfc_add_protected): New function.
      (gfc_copy_attr): Copy PROTECTED attribute.
    * decl.c (match_attr_spec): Add PROTECTED support.
      (gfc_match_protected): New function.
    * dump-parse-tree.c (gfc_show_attr): Add PROTECTED support.
    * gfortran.h (gfc_symbol): Add protected flag.
      Add gfc_add_protected prototype.
    * expr.c (gfc_check_pointer_assign): Add PROTECTED support.
    * module.c (ab_attribute, attr_bits, mio_symbol_attribute,
mio_symbol_attribute):
       Add PROTECTED support.
    * resolve.c (resolve_equivalence): Add PROTECTED support.
    * match.c (gfc_match_assignment,)gfc_match_pointer_assignment:
       Check PROTECTED attribute.
    * match.h: Add gfc_match_protected prototype.
    * parse.c (decode_statement): Match PROTECTED statement.
    * primary.c (match_variable): Add PROTECTED support.

testsuite/
2006-12-10  Tobias Burnus  <burnus@net-b.de>

    PR fortran/23994
    * gfortran.dg/protected_1.f90: New test.
    * gfortran.dg/protected_2.f90: New test.
    * gfortran.dg/protected_3.f90: New test.
    * gfortran.dg/protected_4.f90: New test.
    * gfortran.dg/protected_5.f90: New test.
    * gfortran.dg/protected_6.f90: New test.

From-SVN: r119709
2006-12-10 20:53:07 +01:00
Paul Thomas
993ef28f82 re PR other/29975 ([meta-bugs] ICEs with CP2K)
2006-12-09  Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29975
	PR fortran/30068
	PR fortran/30096
	* interface.c (compare_type_rank_if): Reject invalid generic
	interfaces.
	(check_interface1): Give a warning for nonreferred to ambiguous
	interfaces.
	(check_sym_interfaces): Check whether an ambiguous interface is
	referred to.  Do not check host associated interfaces since these
	cannot be ambiguous with the local versions.
	(check_uop_interface, gfc_check_interfaces): Update call to
	check_interface1.
	* symbol.c (gfc_get_sym_tree, gfc_get_sym_tree): Allow adding
	unambiguous procedures to generic interfaces.
	* gfortran.h (symbol_attribute): Added use_only and
	ambiguous_interfaces.
	* module.c (load_need): Set the use_only flag, if needed.
	* resolve.c (resolve_fl_procedure): Warn for nonreferred
	interfaces.
	* expr.c (find_array_section): Fix initializer array contructor.


2006-12-09  Paul Thomas <pault@gcc.gnu.org>
	    Tobias Burnus <burnus@gcc.gnu.org>

	PR fortran/29975
	PR fortran/30068
	* gfortran.dg/interface_4.f90: Test adding procedure to generic
	interface.
	* gfortran.dg/interface_5.f90: Test warning for not-referenced-to
	ambiguous interfaces.
	* gfortran.dg/interface_6.f90: Test invalid, ambiguous interface.
	* gfortran.dg/interface_7.f90: Test invalid, ambiguous interface.
	* gfortran.dg/interface_8.f90: Test warning for not-referenced-to
	ambiguous interfaces.
	* gfortran.dg/interface_1.f90: Change dg-error into a dg-warning.
	* gfortran.dg/array_initializer_2.f90: Add initializer array
	constructor test.

	PR fortran/30096
	* gfortran.dg/interface_9.f90: Test that host interfaces are
	not checked for ambiguity with the local version.

Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org>

From-SVN: r119697
2006-12-09 21:13:29 +00:00
Paul Thomas
536afc35bc re PR fortran/20880 (USE association of procedure's own interface)
2006-11-24  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20880
	* parse.c (parse_interface): Error if procedure name is that of
	encompassing scope.
	* resolve.c (resolve_fl_procedure): Error if procedure is
	ambiguous.

	PR fortran/29387
	* interface.c (compare_actual_formal): Add missing condition
	that 'where' be present for error that asserts that actual
	arguments be definable.

2006-11-24  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20880
	* gfortran.dg/interface_3.f90: New test.

	PR fortran/29387
	* gfortran.dg/generic_8.f90: New test.

From-SVN: r119173
2006-11-24 22:22:40 +00:00
Paul Thomas
991f3b1289 re PR fortran/29652 (ambiguous interface declaration undetected)
2006-11-22 Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/29652
	* interface.c (check_interface1): Use a local value, instead of
	the dummy, as the inner iterator over interface symbols.

2006-11-22 Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/29652
	* gfortran.dg/generic_7.f90: New test.
	* gfortran.dg/defined_operators_1.f90: Add new error.

From-SVN: r119076
2006-11-22 00:02:02 +00:00
Tobias Schlüter
bc0a33d315 data.c: Add 2006 to copyright years.
* data.c: Add 2006 to copyright years.
* interface.c: Same.
* misc.c: Same.
* trans-io.c: Same.

From-SVN: r118700
2006-11-11 18:10:24 +01:00
Paul Thomas
5046aff56b [multiple changes]
2006-10-05  Erik Edelmann <edelmann@gcc.gnu.org>
	    Paul Thomas <pault@gcc.gnu.org>

	PR fortran/20541
	* interface.c (gfc_compare_derived_types): Add comparison of
	the allocatable field.
	* intrinsic.c (add_subroutines): Add MOVE_ALLOC.
	* trans-expr.c (gfc_conv_aliased_arg, gfc_trans_subarray_assign,
	gfc_trans_subcomponent_assign, gfc_conv_string_parameter,
	gfc_trans_scalar_assign): Add extra arguments l_is_temp
	and r_is_var to references to latter function.
	(gfc_conv_function_call): Add enum for types of argument and
	an associated variable parm_kind. Deallocate components of
	INTENT(OUT) and non-variable arrays.
	(gfc_trans_subcomponent_assign): Add block to assign arrays
	to allocatable components.
	(gfc_trans_scalar_assign): Add block to handle assignments of
	derived types with allocatable components, using the above new
	arguments to control allocation/deallocation of memory and the
	copying of allocated arrays.
	* trans-array.c (gfc_array_allocate): Remove old identification 
	of pointer and replace with that of an allocatable array. Add
	nullify of structures with allocatable components. 
	(gfc_conv_array_initializer): Treat EXPR_NULL.
	(gfc_conv_array_parameter): Deallocate allocatable components
	of non-variable structures.
	(gfc_trans_dealloc_allocated): Use second argument of library
	deallocate to inhibit, without error, freeing NULL pointers.
	(get_full_array_size): New function to return the size of a
	full array.
	(gfc_duplicate_allocatable): New function to allocate and copy
	allocated data.
	(structure_alloc_comps): New recursive function to deallocate,
	nullify or copy allocatable components.
	(gfc_nullify_alloc_comp, gfc_deallocate_alloc_comp,
	gfc_copy_alloc_comp): New interface functions to call previous.
	(gfc_trans_deferred_array): Add the code to nullify allocatable
	components, when entering scope, and to deallocate them on
	leaving. Do not call gfc_trans_static_array_pointer and return
	for structures with allocatable components and default
	initializers.
	* symbol.c (gfc_set_component_attr): Set allocatable field.
	(gfc_get_component_attr): Set the allocatable attribute.
	* intrinsic.h : Prototype for gfc_check_move_alloc.
	* decl.c (build_struct): Apply TR15581 constraints for
	allocatable components.
	(variable_decl): Default initializer is always NULL for
	allocatable components.
	(match_attr_spec): Allow, or not, allocatable components,
	according to the standard in force.
	* trans-array.h : Prototypes for gfc_nullify_alloc_comp,
	gfc_deallocate_alloc_comp, gfc_copy_alloc_comp and
	gfc_duplicate_allocatable.
	* gfortran.texi : Add mention of TR15581 extensions.
	* gfortran.h : Add attribute alloc_comp, add
	gfc_components field allocatable and add the prototype
	for gfc_expr_to_initialize.
	* trans-stmt.c (generate_loop_for_temp_to_lhs,
	generate_loop_for_rhs_to_temp, gfc_trans_where_assign,
	gfc_trans_where_3): Add extra arguments to calls to
	gfc_trans_scalar_assign and set appropriately.
	(gfc_trans_allocate): Nullify allocatable components.
	(gfc_trans_deallocate): Deallocate to ultimate allocatable
	components but stop at ultimate pointer components.
	* module.c (mio_symbol_attribute, mio_symbol_attribute,
	mio_component): Add module support for allocatable
	components.
	* trans-types.c (gfc_get_derived_type): Treat allocatable
	components.
	* trans.h : Add two boolean arguments to
	gfc_trans_scalar_assign.
	* resolve.c (resolve_structure_cons): Check conformance of
	constructor element and the component.
	(resolve_allocate_expr): Add expression to nullify the
	constructor expression for allocatable components.
	(resolve_transfer): Inhibit I/O of derived types with
	allocatable components.
	(resolve_fl_derived): Skip check of bounds of allocatable
	components.
	* trans-decl.c (gfc_get_symbol_decl): Add derived types
	with allocatable components to deferred variable.
	(gfc_trans_deferred_vars): Make calls for derived types
	with allocatable components to gfc_trans_deferred_array.
	(gfc_generate_function_code): Nullify allocatable
	component function result on entry.
	* parse.c (parse_derived): Set symbol attr.allocatable if
	allocatable components are present.
	* check.c (gfc_check_allocated): Enforce attr.allocatable
	for intrinsic arguments.
	(gfc_check_move_alloc): Check arguments of move_alloc.
	* primary.c (gfc_variable_attr): Set allocatable attribute.
	* intrinsic.texi : Add index entry and section for
	for move_alloc.

	PR fortran/29115
	* resolve.c (resolve_structure_cons): It is an error if the
	pointer component elements of a derived type constructor are
	not pointer or target.


	PR fortran/29211
	* trans-stmt.c (generate_loop_for_temp_to_lhs,
	generate_loop_for_rhs_to_temp): Provide a string length for
	the temporary by copying that of the other side of the scalar
	assignment.


2006-10-05  Paul Thomas  <pault@gcc.gnu.org>
	    Erik Edelmann  <edelmann@gcc.gnu.org>

	PR libgfortran/20541
	* Makefile.in : Add move_alloc.
	* intrinsics/move_alloc.c: New function.
	* Makefile.am : Add move_alloc.



2006-10-05  Erik Edelmann  <edelmann@gcc.gnu.org>
	    Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20541
	* gfortran.dg/alloc_comp_basics_1.f90: New test.
	* gfortran.dg/alloc_comp_basics_2.f90: New test.
	* gfortran.dg/alloc_comp_assign_1.f90: New test.
	* gfortran.dg/alloc_comp_assign_2.f90: New test.
	* gfortran.dg/alloc_comp_assign_3.f90: New test.
	* gfortran.dg/alloc_comp_assign_4.f90: New test.
	* gfortran.dg/alloc_comp_constraint_1.f90: New test.
	* gfortran.dg/alloc_comp_constraint_2.f90: New test.
	* gfortran.dg/alloc_comp_constraint_3.f90: New test.
	* gfortran.dg/alloc_comp_constructor_1.f90: New test.
	* gfortran.dg/alloc_comp_constructor_2.f90: New test.
	* gfortran.dg/alloc_comp_initializer_1.f90: New test.
	* gfortran.dg/alloc_comp_std.f90: New test.
	* gfortran.dg/move_alloc.f90: New test.

	PR fortran/29115
	* gfortran.dg/derived_constructor_comps_2.f90: New test.

	PR fortran/29211
	* gfortran.dg/forall_char_dependencies_1.f90: New test.

From-SVN: r117558
2006-10-08 16:21:55 +00:00
Paul Thomas
8c086c9c6e re PR fortran/28885 (ICE passing components of array of derived type)
2006-08-30  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/28885
	REGRESSION FIX
	* trans-expr.c (gfc_conv_aliased_arg): Ensure that the temp
	declaration is retained for INTENT(OUT) arguments.

	PR fortran/28873
	REGRESSION FIX
	PR fortran/20067
	* resolve.c (resolve_generic_f): Make error message more
	comprehensible.
	(resolve_generic_s): Restructure search for specific procedures
	to be similar to resolve_generic_f and change to similar error
	message.  Ensure that symbol reference is refreshed, in case
	the search produces a NULL.
	(resolve_specific_s): Restructure search, as above and as
	resolve_specific_f. Ensure that symbol reference is refreshed,
	in case the search produces a NULL.

	PR fortran/25077
	PR fortran/25102
	* interface.c (check_operator_interface): Throw error if the
	interface assignment tries to change intrinsic type assigments
	or has less than two arguments.  Also, it is an error if an
	interface operator contains an alternate return.

	PR fortran/24866
	* parse.c (gfc_fixup_sibling_symbols): Do not modify the symbol
	if it is a dummy in the contained namespace.


2006-08-30  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/28885
	* gfortran.dg/aliasing_dummy_2.f90: New test.

	PR fortran/20067
	* gfortran.dg/generic_5.f90: Change error message.

	PR fortran/28873
	* gfortran.dg/generic_6.f90: New test.

	PR fortran/25077
	* gfortran.dg/redefined_intrinsic_assignment.f90: New test.

	PR fortran/25102
	* gfortran.dg/invalid_interface_assignment.f90: New test.

	PR fortran/24866
	* gfortran.dg/module_proc_external_dummy.f90: New test.

From-SVN: r116578
2006-08-30 05:18:36 +00:00
Francois-Xavier Coudert
e5d7f6f735 re PR fortran/20892 (dummy procedure can't be generic)
PR fortran/20892
	* interface.c (gfc_match_interface): Don't allow dummy procedures
	to have a generic interface.

From-SVN: r115201
2006-07-05 15:22:26 +00:00
Paul Thomas
d68bd5a8f2 re PR fortran/25056 (non-PURE function should not be a valid argument)
2006-06-25  Paul Thomas  <pault@gcc.gnu.org>
 
	PR fortran/25056
	* interface.c (compare_actual_formal): Signal an error if the formal
	argument is a pure procedure and the actual is not pure.

	PR fortran/27554
	* resolve.c (resolve_actual_arglist): If the type of procedure
	passed as an actual argument is not already declared, see if it is
	an intrinsic.

	PR fortran/25073
	* resolve.c (resolve_select): Use bits 1 and 2 of a new int to
	keep track of  the appearance of constant logical case expressions.
	Signal an error is either value appears more than once.

	PR fortran/20874
	* resolve.c (resolve_fl_procedure): Signal an error if an elemental
	function is not scalar valued.

	PR fortran/20867
	* match.c (recursive_stmt_fcn): Perform implicit typing of variables.

	PR fortran/22038
	* match.c (match_forall_iterator): Mark new variables as
	FL_UNKNOWN if the match fails.

	PR fortran/28119
	* match.c (gfc_match_forall): Remove extraneous call to
	gfc_match_eos.

	PR fortran/25072
	* resolve.c (resolve_code, resolve_function): Rework
	forall_flag scheme so that it is set and has a value of
	2, when the code->expr (ie. the forall mask) is resolved.
	This is used to change "block" to "mask" in the non-PURE
	error message.


2006-06-25  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20867
	* gfortran.dg/stfunc_3.f90: New test.

	PR fortran/25056
	* gfortran.dg/impure_actual_1.f90: New test.

	PR fortran/20874
	* gfortran.dg/elemental_result_1.f90: New test.

	PR fortran/25073
	* gfortran.dg/select_7.f90: New test.

	PR fortran/27554
	* intrinsic_actual_1.f: New test.

	PR fortran/22038
	PR fortran/28119
	* gfortran.dg/forall_4.f90: New test.

	PR fortran/25072
	* gfortran.dg/forall_5.f90: New test.

From-SVN: r114987
2006-06-25 15:11:02 +00:00
Paul Thomas
699fa7aa1a re PR fortran/25098 (Variable as actual argument for procedure dummy argument allowed)
2006-06-01  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/25098
	PR fortran/25147
	* interface.c (compare_parameter): Return 1 if the actual arg
	is external and the formal is a procedure.
	(compare_actual_formal): If the actual argument is a variable
	and the formal a procedure, this an error.  If a gsymbol exists
	for a procedure of the same name, this is not yet resolved and
	the error is cleared.

	* trans-intrinsic.c (gfc_conv_associated): Make provision for
	zero array length or zero string length contingent on presence
	of target, for consistency with standard.

2006-06-01  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/25098
	* gfortran.dg/dummy_procedure_1.f90: New test.

	PR fortran/25147
	* gfortran.dg/dummy_procedure_2.f90: New test.

	* gfortran.dg/associated_2.f90: Correct to make consistent with
	standard.

From-SVN: r114296
2006-06-01 04:35:38 +00:00
Paul Thomas
476220e7ee re PR fortran/25746 (Elemental assignment gives wrong result)
2006-05-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/25746
	* interface.c (gfc_extend_assign): Use new code EXEC_ASSIGN_CALL.
	* gfortran.h : Put EXEC_ASSIGN_CALL in enum.
	* trans-stmt.c (gfc_conv_elemental_dependencies): New function.
	(gfc_trans_call): Call it.  Add new boolian argument to flag
	need for dependency checking. Assert intent OUT and IN for arg1
	and arg2.
	(gfc_trans_forall_1): Use new code EXEC_ASSIGN_CALL.
	trans-stmt.h : Modify prototype of gfc_trans_call.
	trans.c (gfc_trans_code): Add call for EXEC_ASSIGN_CALL.
	st.c (gfc_free_statement): Free actual for EXEC_ASSIGN_CALL.
	* dependency.c (gfc_check_fncall_dependency): Don't check other
	against itself.

	PR fortran/25090
	* resolve.c : Remove resolving_index_expr.
	(entry_parameter): Remove.
	(gfc_resolve_expr, resolve_charlen, resolve_fl_variable): Remove
	calls to entry_parameter and references to resolving_index_expr.

	PR fortran/27584
	* check.c (gfc_check_associated): Replace NULL assert with an
	error message, since it is possible to generate bad code that
	has us fall through to here..

	PR fortran/19015
	* iresolve.c (maxloc, minloc): If DIM is not present, pass the
	rank of ARRAY as the shape of the result.  Otherwise, pass the
	shape of ARRAY, less the dimension DIM.
	(maxval, minval): The same, when DIM is present, otherwise no
	change.

2006-05-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/25746
	* gfortran.dg/elemental_subroutine_3.f90: New test.

	PR fortran/25090
	* gfortran.dg/entry_dummy_ref_1.f90: Remove.

	PR fortran/27584
	* gfortran.dg/associated_target_1.f90: New test.

	PR fortran/19015
	* gfortran.dg/maxloc_shape_1.f90: New test.

From-SVN: r113949
2006-05-21 07:35:05 +00:00
Paul Thomas
98cb5a5439 re PR fortran/26716 (gfortran: incorrect choice of overloaded function)
2006-03-19  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/26716
	*expr.c (external_spec_function): Permit elemental functions.

	PR fortran/26716
	*interface.c (compare_actual_formal): Detect call for procedure
	usage and require rank checking, in this case, for assumed shape
	and deferred shape arrays.
	(gfc_procedure_use): Revert to pre-PR25070 call to
	compare_actual_formal that does not require rank checking..

2006-03-19  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/26716
	* gfortran.dg/elemental_initializer_1.f90: New test.

	PR fortran/26716
	* gfortran.dg/assumed_shape_ranks_2: New test.

From-SVN: r112210
2006-03-19 10:36:09 +00:00
Erik Edelmann
aa08038dda re PR fortran/16136 (Conflicting attributes ALLOCATABLE, DUMMY (F2003))
fortran/
2005-03-05  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/16136
        * symbol.c (conf_std): New macro.
        (check_conflict): Use it to allow ALLOCATABLE dummy
        arguments for F2003.
        * trans-expr.c (gfc_conv_function_call): Pass the
        address of the array descriptor when dummy argument is
        ALLOCATABLE.
        * interface.c (compare_allocatable): New function.
        (compare_actual_formal): Use it.
        resolve.c (resolve_deallocate_expr,
        resolve_allocate_expr): Check that INTENT(IN) variables
        aren't (de)allocated.
        * gfortran.texi (Fortran 2003 status): List ALLOCATABLE
        dummy arguments as supported.

testsuite/
2005-03-05  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/16136
        * allocatable_dummy_1.f90: New.
        * allocatable_dummy_2.f90: New.

From-SVN: r111741
2006-03-05 19:24:48 +00:00
Paul Thomas
c4bbc10564 re PR fortran/26038 (ICE on allocation of assumed length CHARACTER dummy.)
2006-02-09  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/26038
	* trans-stmt.c (gfc_trans_allocate): Provide assumed character length
	scalar with missing backend_decl for the hidden dummy charlen.

	PR fortran/25059
	* interface.c (gfc_extend_assign): Remove detection of non-PURE
	subroutine in assignment interface, with gfc_error, and put it in
	* resolve.c (resolve_code).

	PR fortran/25070
	* interface.c (gfc_procedure_use): Flag rank checking for non-
	elemental, contained or interface procedures in call to
	(compare_actual_formal), where ranks are checked for assumed
	shape arrays..

2006-02-09  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/26038
	* gfortran.dg/allocate_char_star_scalar_1.f90: New test.

	PR fortran/25059
	* gfortran.dg/impure_assignment_1.f90: New test.

	PR fortran/25070
	* gfortran.dg/assumed_shape_ranks_1.f90: New test.

From-SVN: r110816
2006-02-09 23:23:28 +00:00
Paul Thomas
a920e94a9e re PR fortran/18578 (intent(inout) violation is not detected)
2006-01-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/18578
	PR fortran/18579
	PR fortran/20857
	PR fortran/20885
	* interface.c (compare_actual_formal): Error for INTENT(OUT or INOUT)
	if actual argument is not a variable.

2006-01-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/18578
	PR fortran/18579
	PR fortran/20857
	PR fortran/20885
	* gfortran.dg/intent_out_1.f90: New test.

From-SVN: r110376
2006-01-29 16:31:24 +00:00
Erik Edelmann
cf013e9fdb re PR fortran/22607 (Elemental character functions don't work)
fortran/
2005-12-30  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/22607
        * trans-decl.c(gfc_get_extern_function_decl): Don't set
        DECL_IS_PURE (fndecl) = 1 for return-by-reference
        functions.

        fortran/PR 25396
        * interface.c (gfc_extend_expr): Initialize
        e->value.function.name to NULL.



testsuite/
2005-12-30  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/22607
        * gfortran-dg/pure_byref_3.f90: New.

        fortran/PR 25396
        * gfortran.dg/userdef_operator_1.f90: New.

From-SVN: r109171
2005-12-30 15:02:44 +00:00
Paul Thomas
e0e85e0617 re PR fortran/20889 (type in a structure-constructor differs from type in derived-type-def)
2005-12-22  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20889
	*resolve.c(resolve_structure_cons): Do not attempt to convert
	the type of mismatched pointer type components, except when
	the constructor component is BT_UNKNOWN; emit error instead.

	PR fortran/25029
	PR fortran/21256
	*resolve.c(check_assumed_size_reference): New function to check for upper
	bound in assumed size array references.
	(resolve_assumed_size_actual): New function to do a very restricted scan
	of actual argument expressions of those procedures for which incomplete
	assumed size array references are not allowed.
	(resolve_function, resolve_call): Switch off assumed size checking of
	actual arguments, except for elemental procedures and array valued
	intrinsics; excepting LBOUND.
	(resolve_variable): Call check_assumed_size_reference.

	PR fortran/19362
	PR fortran/20244
	PR fortran/20864
	PR fortran/25391
	*interface.c(gfc_compare_types): Broken into two.
	(gfc_compare_derived_types): Second half of gfc_compare_types with
	corrections for a missing check that module name is non-NULL and
	a check for private components.
	*symbol.c(gfc_free_dt_list): New function.
	(gfc_free_namespace): Call gfc_free_dt_list.
	*resolve.c(resolve_symbol): Build the list of derived types in the
	symbols namespace.
	*gfortran.h: Define the structure type gfc_dt_list.  Add a new field,
	derived_types to gfc_namespace.  Provide a prototye for the new
	function gfc_compare_derived_types.
	*trans_types.c(gfc_get_derived_type): Test for the derived type being
	available in the host namespace. In this case, the host backend
	declaration is used for the structure and its components.  If an
	unbuilt, equal structure that is not use associated is found in the
	host namespace, build it there and then.  On exit,traverse the
	namespace of the derived type to see if there are equal but unbuilt.
	If so, copy the structure and its component declarations.
	(copy_dt_decls_ifequal): New functions to copy declarations to other
	equal structure types.

	PR fortran/20862
	* io.c (gfc_match_format): Make the appearance of a format statement
	in a module specification block an error.

	PR fortran/23152
	* match.c (gfc_match_namelist): Set assumed shape arrays in
	namelists as std=GFC_STD_GNU and assumed size arrays as an
	unconditional error.

	PR fortran/25069
	* match.c (gfc_match_namelist): Set the respecification of a USE
	associated namelist group as std=GFC_STD_GNU.  Permit the concatenation
	on no error.

	PR fortran/25053
	PR fortran/25063
	PR fortran/25064
	PR fortran/25066
	PR fortran/25067
	PR fortran/25068
	PR fortran/25307
	* io.c (resolve_tag): Change std on IOSTAT != default integer to
	GFC_STD_GNU and change message accordingly.  Add same error for
	SIZE.
	(match_dt_element, gfortran.h): Add field err_where to gfc_dt and
	set it when tags are being matched.
	(gfc_resolve_dt): Remove tests that can be done before resolution
	and add some of the new ones here.
	(check_io_constraints): New function that checks for most of the
	data transfer constraints. Some of these were previously done in
	match_io, from where this function is called, and some were done
	in gfc_resolve_dt.
	(match_io): Remove most of the tests of constraints and add the
	call to check_io_constraints.

2005-12-22  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20889
	*gfortran.dg/pointer_component_type_1.f90: New test.

	PR fortran/25029
	PR fortran/21256
	*gfortran.dg/assumed_size_refs.f90: New test for the conditions that
	should give an error with assumed size array refernces and checks those
	that should not.
	*gfortran.dg/gfortran.dg/pr15140.f90: Give the assumed size array
	reference an upper bound so that it does not generate an error.

	PR fortran/19362
	PR fortran/20244
	PR fortran/20864
	PR fortran/25391
	*gfortran.dg/used_dummy_types_1.f90: New test.
	*gfortran.dg/used_dummy_types_2.f90: New test.
	*gfortran.dg/used_dummy_types_3.f90: New test.
	*gfortran.dg/used_dummy_types_4.f90: New test.
	*gfortran.dg/used_dummy_types_5.f90: New test.

	PR fortran/23152
	*gfortran.dg/namelist_use.f90: Add trap for warning on NAMELIST
	group already being USE associated.
	*gfortran.dg/assumed_shape_nml.f90: New test.
	*gfortran.dg/assumed_size_nml.f90: New test.

	PR fortran/20862
	PR fortran/25053
	PR fortran/25063
	PR fortran/25064
	PR fortran/25066
	PR fortran/25067
	PR fortran/25068
	PR fortran/25307
	* gfortran.dg/io_constraints_1.f90: New test.
	* gfortran.dg/io_constraints_1.f90: New test.
	* gfortran.dg/iostat_3.f90: Change wording of warning.
	 * gfortran.dg/g77/19981216-0.f:  the same.

From-SVN: r108943
2005-12-22 07:05:22 +00:00
Steven Bosscher
55898b2c1b interface.c: Fix previous checkin (an incomplete patch was commited for me).
* interface.c: Fix previous checkin (an incomplete patch
	was commited for me).

From-SVN: r105992
2005-10-29 13:08:33 +00:00
Steven G. Kargl
9b46f94ffa re PR fortran/24545 (gfortran bug regarding interface block with named END INTERFACE statements)
PR fortran/24545
* interface.c (gfc_match_end_interface): Fix typo in INTERFACE_USER_OP case.

From-SVN: r105953
2005-10-28 20:05:56 +00:00
Jakub Jelinek
bf9d2177bf interface.c (compare_actual_formal): Issue error when attempting to pass an assumed-size array as assumed-shape...
* interface.c (compare_actual_formal): Issue error when attempting
	to pass an assumed-size array as assumed-shape array argument.

	* gfortran.dg/assumed_dummy_2.f90: New test.

From-SVN: r105765
2005-10-21 20:50:52 +02:00
Steven G. Kargl
312ae8f402 re PR fortran/24005 (Ambiguous INTERFACE leads to seg fault)
PR fortran/24005
* interface.c (check_interface1): Fix NULL dereference.

From-SVN: r104544
2005-09-22 22:45:40 +00:00
Kelley Cook
ab57747bb0 Update FSF address.
From-SVN: r101310
2005-06-25 00:40:37 +00:00
François-Xavier Coudert
90aeadcb5c re PR fortran/21177 (wrong code with NULL())
PR fortran/21177

	* interface.c (compare_parameter): Ignore type for EXPR_NULL
	only if type is BT_UNKNOWN.

	* gfortran.dg/pr21177.f90: New test

From-SVN: r98837
2005-04-27 15:37:53 +00:00
Kazu Hirata
6892757cae * interface.c: Fix a comment typo.
From-SVN: r97951
2005-04-10 17:49:46 +00:00