Commit Graph

635 Commits

Author SHA1 Message Date
Jakub Jelinek 2700d0e3ab gfortran.h (gfc_error): Rename overload with OPT argument to...
* gfortran.h (gfc_error): Rename overload with OPT argument to...
	(gfc_error_opt): ... this.
	* error.c (gfc_error): Rename overloads with OPT argument to...
	(gfc_error_opt): ... this.  Adjust callers.
	(gfc_notify_std, gfc_error): Adjust callers.
	* resolve.c (resolve_structure_cons, resolve_global_procedure): Use
	gfc_error_opt instead of gfc_error.
	* interface.c (argument_rank_mismatch, compare_parameter,
	gfc_check_typebound_override): Likewise.  Fix up formatting.

From-SVN: r243941
2016-12-27 16:17:19 +01:00
Janus Weil f3e1097bc6 re PR fortran/78798 ([cleanup] some int-valued functions should be bool)
2016-12-15  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/78798
	* gfortran.h (gfc_compare_derived_types,gfc_compare_types,
	gfc_compare_interfaces,gfc_has_vector_subscript): Return bool instead
	of int.
	* interface.c (compare_components): Ditto.
	(gfc_compare_union_types): Rename to compare_union_types, declare as
	static, return bool.
	(gfc_compare_derived_types): Return bool instead of int.
	(gfc_compare_types): Ditto.
	(compare_type): Ditto.
	(compare_rank): Ditto.
	(compare_type_rank): Ditto.
	(compare_type_rank_if): Ditto.
	(count_types_test): Ditto.
	(generic_correspondence): Ditto.
	(gfc_compare_interfaces): Ditto.
	(check_interface0): Ditto.
	(check_interface1): Ditto.
	(compare_allocatable): Ditto.
	(compare_parameter): Ditto.
	(gfc_has_vector_subscript): Ditto.
	(compare_actual_formal): Ditto.

From-SVN: r243726
2016-12-15 21:54:18 +01:00
Andre Vehreschild eb401400f5 re PR fortran/78672 (Gfortran test suite failures with a sanitized compiler)
gcc/fortran/ChangeLog:

2016-12-14  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/78672
	* array.c (gfc_find_array_ref): Add flag to return NULL when no ref is
	found instead of erroring out.
	* data.c (gfc_assign_data_value): Only constant expressions are valid
	for initializers.
	* gfortran.h: Reflect change of gfc_find_array_ref's signature.
	* interface.c (compare_actual_formal): Access the non-elemental
	array-ref.  Prevent taking a REF_COMPONENT for a REF_ARRAY.  Correct
	indentation.
	* module.c (load_omp_udrs): Clear typespec before reading into it.
	* trans-decl.c (gfc_build_qualified_array): Prevent accessing the array
	when it is a coarray.
	* trans-expr.c (gfc_conv_cst_int_power): Use wi::abs()-function instead
	of crutch preventing sanitizer's bickering here.
	* trans-stmt.c (gfc_trans_deallocate): Only get data-component when it
	is a descriptor-array here.

From-SVN: r243647
2016-12-14 12:52:09 +01:00
Janus Weil 7a28353e36 re PR fortran/78798 ([cleanup] some int-valued functions should be bool)
2016-12-13  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/78798
	* gfortran.h (gfc_is_constant_expr, gfc_is_formal_arg,
	gfc_is_compile_time_shape): Return bool instead of int.
	* array.c (gfc_is_compile_time_shape): Ditto.
	* expr.c (gfc_is_constant_expr): Ditto.
	* resolve.c (gfc_is_formal_arg): Ditto. Make formal_arg_flag bool.

From-SVN: r243621
2016-12-13 19:55:20 +01:00
Janus Weil e4e659b947 re PR fortran/78737 ([OOP] linking error with deferred, undefined user-defined derived-type I/O)
2016-12-13  Janus Weil  <janus@gcc.gnu.org>
	    Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78737
	* gfortran.h (gfc_find_typebound_dtio_proc): New prototype.
	* interface.c (gfc_compare_interfaces): Whitespace fix.
	(gfc_find_typebound_dtio_proc): New function.
	(gfc_find_specific_dtio_proc): Use it. Improve error recovery.
	* trans-io.c (get_dtio_proc): Implement polymorphic calls to DTIO
	procedures.

2016-12-13  Janus Weil  <janus@gcc.gnu.org>
	    Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78737
	* gfortran.dg/dtio_19.f90: New test case.

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

From-SVN: r243609
2016-12-13 15:28:17 +01:00
Thomas Koenig be841e112b re PR fortran/78226 (Fill out location information everywhere)
2016-12-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/78226
	* error.c (gfc_warning_internal):  New function.
	* frontend-passes.c (gfc_run_passes):  Call check_locus if
	CHECKING_P is defined.
	(check_locus_code):  New function.
	(check_locus_expr):  New function.
	(check_locus):  New function.
	* gfortran.h:  Add prototype for gfc_warning_internal.

From-SVN: r243520
2016-12-10 22:28:32 +00:00
Paul Thomas c064374dc4 re PR fortran/77903 ([F08] gfortran 6.1.0/7.0.0 accept invalid code with conflicting module/submodule interfaces)
2016-12-09  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/77903
	* decl.c (get_proc_name): Use the symbol tlink field instead of
	the typespec interface field.
	(gfc_match_function_decl, gfc_match_submod_proc): Ditto.
	* gfortran.h : Since the symbol tlink field is no longer used
	by the frontend for change management, change the comment to
	reflect its current uses.
	* parse.c (get_modproc_result): Same as decl.c changes.
	* resolve.c (resolve_fl_procedure): Ditto.

2016-12-09  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/77903
	* gfortran.dg/submodule_20.f08: New test.

From-SVN: r243507
2016-12-09 22:25:26 +00:00
Paul Thomas 345bd7ebbb re PR fortran/44265 (Link error with reference to parameter array in specification expression)
2016-12-09  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/44265
	* gfortran.h : Add fn_result_spec bitfield to gfc_symbol.
	* resolve.c (flag_fn_result_spec): New function.
	(resolve_fntype): Call it for character result lengths.
	* symbol.c (gfc_new_symbol): Set fn_result_spec to zero.
	* trans-decl.c (gfc_sym_mangled_identifier): Include the
	procedure name in the mangled name for symbols with the
	fn_result_spec bit set.
	(gfc_finish_var_decl): Mark the decls of these symbols
	appropriately for the case where the function is external.
	(gfc_get_symbol_decl): Mangle the name of these symbols.
	(gfc_create_module_variable): Allow them through the assert.
	(gfc_generate_function_code): Remove the assert before the
	initialization of sym->tlink because the frontend no longer
	uses this field.
	* trans-expr.c (gfc_map_intrinsic_function): Add a case to
	treat the LEN_TRIM intrinsic.
	(gfc_trans_string_copy): Deal with Wstringop-overflow warning
	that can occur with constant source lengths at -O3.

2016-12-09  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/44265
	* gfortran.dg/char_result_14.f90: New test.
	* gfortran.dg/char_result_15.f90: New test.

From-SVN: r243478
2016-12-09 11:55:27 +00:00
Steven G. Kargl d0803c0cf8 re PR fortran/65173 (ICE while compiling wrong code)
2016-12-07  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/65173
	PR fortran/69064
	PR fortran/69859
	PR fortran/78350
	* gfortran.h (gfc_namespace): Remove old_cl_list member.
	* parse.c (use_modules, next_statement): old_cl_list is gone.
	(clear_default_charlen): Remove no longer used function.
	(reject_statement): Do not try ot clean up gfc_charlen structure(s)
	that may have been added to a cl_list list.
	* symbol.c (gfc_new_charlen): old_cl_list structure is gone.

2016-12-07  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/65173
	PR fortran/69064
	PR fortran/69859
	PR fortran/78350
	* gfortran.dg/misplaced_implicit_character.f90: Adjust errors.
	* gfortran.dg/charlen_01.f90: New test.
	* gfortran.dg/charlen_02.f90: Ditto.
	* gfortran.dg/charlen_03.f90: Ditto.
	* gfortran.dg/charlen_04.f90: Ditto.
	* gfortran.dg/charlen_05.f90: Ditto.
	* gfortran.dg/charlen_06.f90: Ditto.
	* gfortran.dg/charlen_07.f90: Ditto.
	* gfortran.dg/charlen_08.f90: Ditto.
	* gfortran.dg/charlen_09.f90: Ditto.
	* gfortran.dg/charlen_10.f90: Ditto.
	* gfortran.dg/charlen_11.f90: Ditto.
	* gfortran.dg/charlen_12.f90: Ditto.
	* gfortran.dg/charlen_13.f90: Ditto.
	* gfortran.dg/charlen_14.f90: Ditto.
	* gfortran.dg/charlen_15.f90: Ditto.
	* gfortran.dg/charlen_16.f90: Ditto.

From-SVN: r243463
2016-12-08 21:26:11 +00:00
Andre Vehreschild ba85c8c3fc libcaf.h: Add new action types for (de-)registration of allocatable components in derived...
libgfortran/ChangeLog:

2016-11-30  Andre Vehreschild  <vehre@gcc.gnu.org>

	* caf/libcaf.h: Add new action types for (de-)registration of
	allocatable components in derived type coarrays.  Add _caf_is_present
	prototype.
	* caf/single.c (_gfortran_caf_register): Add support for registration
	only and allocation of already registered allocatable components in
	derived type coarrays.
	(_gfortran_caf_deregister): Add mode to deallocate but not deregister
	an allocatable component in a derived type coarray.
	(_gfortran_caf_is_present): New function.  Query whether an
	allocatable component in a derived type coarray on a remote image is
	allocated.


gcc/testsuite/ChangeLog:

2016-11-30  Andre Vehreschild  <vehre@gcc.gnu.org>

	* gfortran.dg/coarray/alloc_comp_1.f90: Fix tree-dump scans to adhere
	to the changed interfaces.
	* gfortran.dg/coarray_alloc_comp_1.f08: Likewise.
	* gfortran.dg/coarray_allocate_7.f08: Likewise.
	* gfortran.dg/coarray_lib_alloc_1.f90: Likewise.
	* gfortran.dg/coarray_lib_alloc_2.f90: Likewise.
	* gfortran.dg/coarray_lib_alloc_3.f90: Likewise.
	* gfortran.dg/coarray_lib_comm_1.f90: Likewise.
	* gfortran.dg/coarray_lib_alloc_4.f90: New test.

gcc/fortran/ChangeLog:

2016-11-30  Andre Vehreschild  <vehre@gcc.gnu.org>

	* check.c (gfc_check_allocated): By pass the caf_get call and check on
	the array.
	* gfortran.h: Add optional flag to gfc_caf_attr.
	* gfortran.texi: Document new enum values and _caf_is_present function.
	* primary.c (caf_variable_attr): Add optional flag to indicate that the
	expression is reffing a component.
	(gfc_caf_attr): Likewise.
	* trans-array.c (gfc_array_deallocate): Handle deallocation mode for
	coarray deregistration.
	(gfc_trans_dealloc_allocated): Likewise.
	(duplicate_allocatable): Use constants instead of
        creating custom constant tree node of zero or one.  Use gfc_add_modify
        convenience function.
	(duplicate_allocatable_coarray): This function is similar to
	duplicate_allocatable but tailored to handle coarrays.
	(caf_enabled): Check whether in-derived-type coarray processing is
	enabled.
	(caf_in_coarray): Check that in-derived-type coarray processing is
	enabled and currently in a derived-typed coarray.
	(gfc_caf_is_dealloc_only): Return true, when deallocate only is
	desired for components in derived typed coarrays.
	(structure_alloc_comps): A mode for handling coarrays, that is no
	longer encode in the purpose.  This makes the use cases of the
	routine more flexible without repeating.  Allocatable components in
	derived type coarrays are now registered only when nullifying an
	object and allocated before copying data into them.
	(gfc_nullify_alloc_comp): Use the caf_mode of structure_alloc_comps
	now.
	(gfc_deallocate_alloc_comp): Likewise.
	(gfc_deallocate_alloc_comp_no_caf): Likewise.
	(gfc_reassign_alloc_comp_caf): Likewise.
	(gfc_copy_alloc_comp): Likewise.
	(gfc_copy_only_alloc_comp): Likewise.
	(gfc_alloc_allocatable_for_assignment): Make use to the cheaper way of
	reallocating a coarray without deregistering and reregistering it.
	(gfc_trans_deferred_array): Initialize the coarray token correctly for
	deferred variables and tear them down on exit.
	* trans-array.h: Change some prototypes to add the coarray (de-)
	registration modes.  Add prototype for checking if deallocate only is
	selected for components in derived typed coarrays.
	* trans-decl.c (gfc_build_builtin_function_decls): Generate the
	declarations for the changed/new caf-lib routines.
	(gfc_trans_deferred_vars): Ensure deferred variables are (de-)
	registered correctly on procedure entry/exit.
	(generate_coarray_sym_init): Use constants.
	* trans-expr.c (gfc_conv_procedure_call): Propagate coarray allocation
	modes accordingly.
	(gfc_trans_alloc_subarray_assign): Likewise.
	(gfc_trans_subcomponent_assign): Likewise.
	(gfc_trans_structure_assign): Generate code to register the components
	of a derived type coarray prior to initialization.
	(gfc_conv_structure): Set flag that the structure is in a coarray.
	(gfc_trans_scalar_assign): Add flag to indicate being in a coarray and
	set the structure_alloc_comps modes correctly.
	(gfc_trans_assignment_1): Figure being in a coarray expression.
	* trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Adapt to new
	structure_alloc_comps interface.
	(conv_caf_send): Use the old API as long as possible.
	(trans_caf_is_present): Generate code to check whether an allocatable
	component in a derived typed coarray is allocated on a remote image.
	(caf_this_image_ref): Return true, when only reffing this image.
	(gfc_conv_allocated): Convert allocated queries on allocatable
	components to the library API.
	(conv_intrinsic_move_alloc): Adapt to new interface of
	structure_alloc_comps.
	* trans-openmp.c (gfc_walk_alloc_comps): Likewise.
	(gfc_omp_clause_assign_op): Likewise.
	(gfc_omp_clause_dtor): Likewise.
	* trans-stmt.c (gfc_trans_deallocate): Figure which mode to use when
	deallocating allocatable components in derived type coarras.
	* trans.c (gfc_allocate_using_lib): Renamed to
	gfc_allcate_using_caf_lib.
	(gfc_allocate_allocatable): Set the registration mode/type of caf-
	register calls adapting to all the possible allocatable objects.
	(gfc_deallocate_with_status): Add deregistration mode for allocatable
	components in derived type coarrays.
	(gfc_deallocate_scalar_with_status): Likewise.
	* trans.h (enum gfc_coarray_type): Renamed to gfc_coarray_regtype to
	avoid collision with gfc_coarray_deregtype.

From-SVN: r243021
2016-11-30 14:27:49 +01:00
Jakub Jelinek b4c3a85be9 omp-low.c (lower_omp_target): Fix up argument to is_reference.
gcc/
	* omp-low.c (lower_omp_target): Fix up argument to is_reference.
	(expand_omp_ordered_sink): Handle TREE_PURPOSE of deps being
	TRUNC_DIV_EXPR.
	* gimplify.c (gimplify_scan_omp_clauses): Likewise.  Set
	ctx->target_map_scalars_firstprivate on OMP_TARGET even for Fortran.
	Remove omp_no_lastprivate callers.  Propagate lastprivate on combined
	teams distribute parallel for simd even to distribute and teams
	construct.  For OMP_CLAUSE_DEPEND add missing break at the end of
	OMP_CLAUSE_DEPEND_SINK case.
	(omp_notice_variable): Use lang_hooks.decls.omp_scalar_p.
	(omp_no_lastprivate): Removed.
	(gimplify_adjust_omp_clauses): Remove omp_no_lastprivate callers.
	(gimplify_omp_for): Likewise.
	(computable_teams_clause): Fail for automatic vars from current
	function not yet seen in bind expr.
	* langhooks.c (lhd_omp_scalar_p): New function.
	* langhooks.h (struct lang_hooks_for_decls): Add omp_scalar_p.
	* varpool.c (varpool_node::get_create): Set node->offloading
	even for DECL_EXTERNAL decls.
	* langhooks-def.h (lhd_omp_scalar_p): New prototype.
	(LANG_HOOKS_OMP_SCALAR_P): Define.
	(LANG_HOOKS_DECLS): Use it.
gcc/fortran/
	* openmp.c (gfc_free_omp_clauses): Free critical_name, grainsize,
	hint, num_tasks, priority and if_exprs.
	(gfc_match_omp_to_link, gfc_match_omp_depend_sink): New functions.
	(enum omp_mask1, enum omp_mask2): New enums.
	Change all OMP_CLAUSE_* defines into enum values, and change their
	values from ((uint64_t) 1 << bit) to just bit.
	(omp_mask, omp_inv_mask): New classes.  Add ctors and operators.
	(gfc_match_omp_clauses): Change mask argument from uint64_t to
	const omp_mask.  Assert OMP_MASK1_LAST and OMP_MASK2_LAST are
	at most 64.  Move delete clause handling to where it
	alphabetically belongs.  Parse defaultmap, grainsize, hint,
	is_device_ptr, nogroup, nowait, num_tasks, priority, simd, threads
	and use_device_ptr clauses.  Parse if clause modifier.  Parse map
	clause always modifier, and release and delete kinds.  Parse ordered
	clause with argument.  Parse schedule clause modifiers.  Differentiate
	device clause parsing based on openacc flag.  Guard link clause
	parsing with openacc flag.  Add support for parsing
	linear clause modifiers.  Parse depend(source) and depend(sink: ...).
	Use gfc_match_omp_to_link for to and link clauses in declare target
	construct.
	(match_acc): Change mask type from uint64_t to const omp_mask.
	(OMP_SINGLE_CLAUSES, OMP_ORDERED_CLAUSES,
	OMP_DECLARE_TARGET_CLAUSES, OMP_TASKLOOP_CLAUSES,
	OMP_TARGET_ENTER_DATA_CLAUSES, OMP_TARGET_EXIT_DATA_CLAUSES): Define.
	(OACC_PARALLEL_CLAUSES, OACC_KERNELS_CLAUSES, OACC_DATA_CLAUSES,
	OACC_LOOP_CLAUSES, OACC_HOST_DATA_CLAUSES, OACC_DECLARE_CLAUSES,
	OACC_ENTER_DATA_CLAUSES, OACC_EXIT_DATA_CLAUSES, OACC_WAIT_CLAUSES,
	OACC_ROUTINE_CLAUSES, OMP_PARALLEL_CLAUSES, OMP_DECLARE_SIMD_CLAUSES,
	OMP_SECTIONS_CLAUSES, OMP_TEAMS_CLAUSES, OMP_DISTRIBUTE_CLAUSES):
	Replace first or only OMP_CLAUSE_* value in bitset with
	omp_mask (OMP_CLAUSE_*).
	(OMP_DO_CLAUSES): Likewise.  Add OMP_CLAUSE_LINEAR.
	(OMP_SIMD_CLAUSES): Replace first or only OMP_CLAUSE_* value in
	bitset with omp_mask (OMP_CLAUSE_*).  Add OMP_CLAUSE_SIMDLEN.
	(OACC_UPDATE_CLAUSES): Replace first or only OMP_CLAUSE_* value in
	bitset with omp_mask (OMP_CLAUSE_*).  Replace OMP_CLAUSE_OACC_DEVICE
	with OMP_CLAUSE_DEVICE.
	(OMP_TASK_CLAUSES): Replace first or only OMP_CLAUSE_* value in
	bitset with omp_mask (OMP_CLAUSE_*).  Add OMP_CLAUSE_PRIORITY.
	(OMP_TARGET_CLAUSES): Replace first or only OMP_CLAUSE_* value in
	bitset with omp_mask (OMP_CLAUSE_*).  Add OMP_CLAUSE_DEPEND,
	OMP_CLAUSE_NOWAIT, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_FIRSTPRIVATE,
	OMP_CLAUSE_DEFAULTMAP and OMP_CLAUSE_IS_DEVICE_PTR.
	(OMP_TARGET_DATA_CLAUSES): Replace first or only OMP_CLAUSE_* value in
	bitset with omp_mask (OMP_CLAUSE_*).  Add OMP_CLAUSE_USE_DEVICE_PTR.
	(OMP_TARGET_UPDATE_CLAUSES): Replace first or only OMP_CLAUSE_* value
	in bitset with omp_mask (OMP_CLAUSE_*).  Add OMP_CLAUSE_DEPEND and
	OMP_CLAUSE_NOWAIT.
	(match_omp): Change mask argument from unsigned int to
	const omp_mask.
	(gfc_match_omp_critical): Parse optional clauses and use omp_clauses
	union member instead of omp_name.
	(gfc_match_omp_end_critical): New function.
	(gfc_match_omp_distribute_parallel_do): Remove ordered and linear
	clauses from the mask.
	(gfc_match_omp_distribute_parallel_do_simd): Use
	& ~(omp_mask (OMP_CLAUSE_*)) instead of & ~OMP_CLAUSE_*.
	(gfc_match_omp_target_teams_distribute_parallel_do_simd): Likewise.
	(gfc_match_omp_teams_distribute_parallel_do_simd): Likewise.
	(gfc_match_omp_do_simd): Likewise.  Don't remove ordered clause from
	the mask.
	(gfc_match_omp_parallel_do_simd): Likewise.
	(gfc_match_omp_target_teams_distribute_parallel_do): Likewise.
	(gfc_match_omp_teams_distribute_parallel_do): Likewise.
	(gfc_match_omp_declare_simd): If not using the form with
	(proc-name), require space before first clause.  Make (proc-name)
	optional.  If not present, set proc_name to NULL.
	(gfc_match_omp_declare_target): Rewritten for OpenMP 4.5.
	(gfc_match_omp_single): Use OMP_SINGLE_CLAUSES.
	(gfc_match_omp_task, gfc_match_omp_taskwait, gfc_match_omp_taskyield):
	Move around to where they belong alphabetically.
	(gfc_match_omp_target_enter_data, gfc_match_omp_target_exit_data,
	gfc_match_omp_target_parallel, gfc_match_omp_target_parallel_do,
	gfc_match_omp_target_parallel_do_simd, gfc_match_omp_target_simd,
	gfc_match_omp_taskloop, gfc_match_omp_taskloop_simd):
	New functions.
	(gfc_match_omp_ordered): Parse clauses.
	(gfc_match_omp_ordered_depend): New function.
	(gfc_match_omp_cancel, gfc_match_omp_end_single): Use
	omp_mask (OMP_CLAUSE_*) instead of OMP_CLAUSE_*.
	(resolve_oacc_scalar_int_expr): Renamed to ...
	(resolve_scalar_int_expr): ... this.  Fix up formatting.
	(resolve_oacc_positive_int_expr): Renamed to ...
	(resolve_positive_int_expr): ... this.  Fix up formatting.
	(resolve_nonnegative_int_expr): New function.
	(resolve_omp_clauses): Adjust callers, use the above functions
	even for OpenMP clauses, add handling of new OpenMP 4.5 clauses.
	Require orderedc >= collapse if specified. Handle depend(sink:)
	and depend(source) restrictions.  Disallow linear clause when
	orderedc is non-zero.  Diagnose linear clause modifiers when not in
	declare simd.  Only check for integer type if ref modifier
	is not used.  Remove diagnostics for required VALUE attribute.
	Diagnose VALUE attribute with ref or uval modifiers.  Allow
	non-constant linear-step, if it is a dummy argument alone and is
	mentioned in uniform clause.  Diagnose map kinds not allowed
	for various constructs.  Diagnose target {enter ,exit ,}data without
	any map clauses.  Add dummy OMP_LIST_IS_DEVICE_PTR and
	OMP_LIST_USE_DEVICE_PTR cases.
	(gfc_resolve_omp_do_blocks): Set omp_current_do_collapse to orderedc
	if non-zero.
	(gfc_resolve_omp_parallel_blocks): Handle new OpenMP 4.5 constructs,
	replace underscores with spaces in a few construct names.
	(resolve_omp_do): Set collapse to orderedc if non-zero.  Handle new
	OpenMP 4.5 constructs.
	(resolve_oacc_loop_blocks): Call resolve_positive_int_expr instead
	of resolve_oacc_positive_int_expr.
	(gfc_resolve_omp_directive): Handle new OpenMP 4.5 constructs.
	(gfc_resolve_omp_declare_simd): Allow ods->proc_name to be NULL.
	* trans-openmp.c (gfc_omp_scalar_p): New function.
	(doacross_steps): New variable.
	(gfc_trans_omp_clauses): Handle new OpenMP 4.5 clauses and new clause
	modifiers.
	(gfc_trans_omp_critical): Adjust EXEC_OMP_CRITICAL handling.
	(gfc_trans_omp_do): Handle doacross loops.  Clear sched_simd flag.
	Handle EXEC_OMP_TASKLOOP.
	(gfc_trans_omp_ordered): Translate omp clauses, allow NULL
	code->block.
	(GFC_OMP_SPLIT_TASKLOOP, GFC_OMP_MASK_TASKLOOP): New enum constants.
	(gfc_split_omp_clauses): Copy orderedc together with ordered.  Change
	firstprivate and lastprivate handling for OpenMP 4.5.
	Handle EXEC_OMP_TARGET_SIMD, EXEC_OMP_TARGET_PARALLEL{,_DO,_DO_SIMD}
	and EXEC_OMP_TASKLOOP{,_SIMD}.  Add handling for new OpenMP 4.5
	clauses and clause modifiers and handle if clause without/with
	modifiers.
	(gfc_trans_omp_teams): Add omp_clauses argument, add it to other
	teams clauses.  Don't wrap into OMP_TEAMS if -fopenmp-simd.
	(gfc_trans_omp_target): For -fopenmp, translate num_teams and
	thread_limit clauses on combined target teams early and pass to
	gfc_trans_omp_teams.  Set OMP_TARGET_COMBINED if needed.
	Handle EXEC_OMP_TARGET_PARALLEL{,_DO,_DO_SIMD} and
	EXEC_OMP_TARGET_SIMD.
	(gfc_trans_omp_taskloop, gfc_trans_omp_target_enter_data,
	gfc_trans_omp_target_exit_data): New functions.
	(gfc_trans_omp_directive): Handle EXEC_OMP_TARGET_{ENTER,EXIT}_DATA
	EXEC_OMP_TASKLOOP{,_SIMD}, EXEC_OMP_TARGET_PARALLEL{,_DO,_DO_SIMD}
	and EXEC_OMP_TARGET_SIMD.  Adjust gfc_trans_omp_teams caller.
	* symbol.c (check_conflict): Handle omp_declare_target_link.
	(gfc_add_omp_declare_target_link): New function.
	(gfc_copy_attr): Copy omp_declare_target_link.
	* dump-parse-tree.c (show_omp_namelist): Handle OMP_DEPEND_SINK_FIRST
	depend_op.  Print linear clause modifiers.
	(show_omp_clauses): Adjust for OpenMP 4.5 clause changes.
	(show_omp_node): Print clauses for EXEC_OMP_ORDERED.  Allow NULL
	c->block for EXEC_OMP_ORDERED.  Formatting fixes.  Adjust handling of
	EXEC_OMP_CRITICAL, handle new OpenMP 4.5 constructs and some
	forgotten OpenMP 4.0 constructs.
	(show_code_node): Handle new OpenMP 4.5 constructs and some forgotten
	OpenMP 4.0 constructs.
	* gfortran.h (symbol_attribute): Add omp_declare_target_link bitfield.
	(struct gfc_omp_namelist): Add u.common and u.linear_op fields.
	(struct gfc_common_head): Change omp_declare_target into bitfield.
	Add omp_declare_target_link bitfield.
	(gfc_add_omp_declare_target_link): New prototype.
	(enum gfc_statement): Add ST_OMP_TARGET_PARALLEL,
	ST_OMP_END_TARGET_PARALLEL, ST_OMP_TARGET_PARALLEL_DO,
	ST_OMP_END_TARGET_PARALLEL_DO, ST_OMP_TARGET_PARALLEL_DO_SIMD,
	ST_OMP_END_TARGET_PARALLEL_DO_SIMD, ST_OMP_TARGET_ENTER_DATA,
	ST_OMP_TARGET_EXIT_DATA, ST_OMP_TARGET_SIMD, ST_OMP_END_TARGET_SIMD,
	ST_OMP_TASKLOOP, ST_OMP_END_TASKLOOP, ST_OMP_TASKLOOP_SIMD,
	ST_OMP_END_TASKLOOP_SIMD and ST_OMP_ORDERED_DEPEND.
	(enum gfc_omp_depend_op): Add OMP_DEPEND_SINK_FIRST and
	OMP_DEPEND_SINK.
	(enum gfc_omp_linear_op): New.
	(struct gfc_omp_clauses): Add critical_name, depend_source,
	orderedc, defaultmap, nogroup, sched_simd, sched_monotonic,
	sched_nonmonotonic, simd, threads, grainsize, hint, num_tasks,
	priority and if_exprs fields.
	(enum gfc_exec_op): Add EXEC_OMP_END_CRITICAL,
	EXEC_OMP_TARGET_ENTER_DATA, EXEC_OMP_TARGET_EXIT_DATA,
	EXEC_OMP_TARGET_PARALLEL, EXEC_OMP_TARGET_PARALLEL_DO,
	EXEC_OMP_TARGET_PARALLEL_DO_SIMD, EXEC_OMP_TARGET_SIMD,
	EXEC_OMP_TASKLOOP, EXEC_OMP_TASKLOOP_SIMD.
	(enum gfc_omp_map_op): Add OMP_MAP_RELEASE,
	OMP_MAP_ALWAYS_TO, OMP_MAP_ALWAYS_FROM and OMP_MAP_ALWAYS_TOFROM.
	(OMP_LIST_IS_DEVICE_PTR, OMP_LIST_USE_DEVICE_PTR): New.
	(enum gfc_omp_if_kind): New.
	* module.c (enum ab_attribute): Add AB_OMP_DECLARE_TARGET_LINK.
	(attr_bits): Add AB_OMP_DECLARE_TARGET_LINK entry.
	(mio_symbol_attribute): Save and restore omp_declare_target_link bit.
	* trans.h (gfc_omp_scalar_p): New prototype.
	* frontend-passes.c (gfc_code_walker): Handle new OpenMP 4.5
	expressions.
	* trans.c (trans_code): Handle new OpenMP 4.5 constructs.
	* resolve.c (gfc_resolve_blocks): Likewise.
	(gfc_resolve_code): Likewise.
	* f95-lang.c (LANG_HOOKS_OMP_SCALAR_P): Redefine to gfc_omp_scalar_p.
	(gfc_attribute_table): Add "omp declare target link".
	* st.c (gfc_free_statement): Handle EXEC_OMP_END_CRITICAL like
	EXEC_OMP_CRITICAL before, free clauses for EXEC_OMP_CRITICAL
	and new OpenMP 4.5 constructs.  Free omp clauses even for
	EXEC_OMP_ORDERED.
	* match.c (match_exit_cycle): Rename collapse variable to count,
	set it to orderedc if non-zero, instead of collapse.
	* trans-decl.c (add_attributes_to_decl): Add "omp declare target link"
	instead of "omp declare target" for omp_declare_target_link.
	* trans-common.c (build_common_decl): Likewise.
	* match.h (gfc_match_omp_target_enter_data,
	gfc_match_omp_target_exit_data, gfc_match_omp_target_parallel,
	gfc_match_omp_target_parallel_do,
	gfc_match_omp_target_parallel_do_simd, gfc_match_omp_target_simd,
	gfc_match_omp_taskloop, gfc_match_omp_taskloop_simd,
	gfc_match_omp_end_critical, gfc_match_omp_ordered_depend): New
	prototypes.
	* parse.c (decode_omp_directive): Use gfc_match_omp_end_critical
	instead of gfc_match_omp_critical for !$omp end critical.
	Handle new OpenMP 4.5 constructs.  If ordered directive has
	depend clause as the first of the clauses, use
	gfc_match_omp_ordered_depend and ST_OMP_ORDERED_DEPEND instead of
	gfc_match_omp_ordered and ST_OMP_ORDERED.
	(case_executable): Add ST_OMP_TARGET_ENTER_DATA,
	ST_OMP_TARGET_EXIT_DATA and ST_OMP_ORDERED_DEPEND cases.
	(case_exec_markers): Add ST_OMP_TARGET_PARALLEL,
	ST_OMP_TARGET_PARALLEL_DO, ST_OMP_TARGET_PARALLEL_DO_SIMD,
	ST_OMP_TARGET_SIMD, ST_OMP_TASKLOOP and ST_OMP_TASKLOOP_SIMD cases.
	(gfc_ascii_statement): Handle new OpenMP 4.5 constructs.
	(parse_omp_do): Handle ST_OMP_TARGET_PARALLEL_DO,
	ST_OMP_TARGET_PARALLEL_DO_SIMD, ST_OMP_TASKLOOP and
	ST_OMP_TASKLOOP_SIMD.
	(parse_omp_structured_block): Handle EXEC_OMP_END_CRITICAL instead
	of EXEC_OMP_CRITICAL, adjust for EXEC_OMP_CRITICAL having omp clauses
	now.
	(parse_executable): Handle ST_OMP_TARGET_PARALLEL,
	ST_OMP_TARGET_PARALLEL_DO, ST_OMP_TARGET_PARALLEL_DO_SIMD,
	ST_OMP_TASKLOOP and ST_OMP_TASKLOOP_SIMD.
gcc/testsuite/
	* gfortran.dg/gomp/pr77516.f90: Add dg-warning.
	* gfortran.dg/gomp/target1.f90: Remove ordered clause where it is
	no longer allowed and corresponding ordered construct.
	* gfortran.dg/gomp/linear-1.f90: New test.
	* gfortran.dg/gomp/declare-simd-2.f90: New test.
	* gfortran.dg/gomp/declare-target-1.f90: New test.
	* gfortran.dg/gomp/declare-target-2.f90: New test.
libgomp/
	* testsuite/libgomp.fortran/examples-4/declare_target-1.f90
	(fib_wrapper): Add map(from: x) clause.
	* testsuite/libgomp.fortran/examples-4/declare_target-2.f90
	(e_53_2): Likewise.
	* testsuite/libgomp.fortran/examples-4/declare_target-4.f90
	(accum): Add map(tmp) clause.
	* testsuite/libgomp.fortran/examples-4/declare_target-5.f90
	(accum): Add map(tofrom: tmp) clause.
	* testsuite/libgomp.fortran/examples-4/target_data-3.f90
	(gramSchmidt): Likewise.
	* testsuite/libgomp.fortran/examples-4/teams-2.f90 (dotprod): Add
	map(tofrom: sum) clause.
	* testsuite/libgomp.fortran/nestedfn5.f90 (foo): Add twice
	map (alloc: a, l) clause.  Add defaultmap(tofrom: scalar) clause.
	* testsuite/libgomp.fortran/pr66199-2.f90: Adjust for linear clause
	only allowed on the loop iterator.
	* testsuite/libgomp.fortran/target4.f90 (foo): Add map(t) clause.
	* testsuite/libgomp.fortran/taskloop2.f90: New test.
	* testsuite/libgomp.fortran/taskloop4.f90: New test.
	* testsuite/libgomp.fortran/doacross1.f90: New test.
	* testsuite/libgomp.fortran/doacross3.f90: New test.
	* testsuite/libgomp.fortran/taskloop1.f90: New test.
	* testsuite/libgomp.fortran/taskloop3.f90: New test.
	* testsuite/libgomp.fortran/doacross2.f90: New test.
	* testsuite/libgomp.c/doacross-1.c (main): Add missing
	#pragma omp atomic read.
	* testsuite/libgomp.c/doacross-2.c (main): Likewise.
	* testsuite/libgomp.c/doacross-3.c (main): Likewise.

From-SVN: r242037
2016-11-10 12:38:05 +01:00
Fritz Reese 6869e9c69f Default missing exponents to 0 with -fdec.
gcc/fortran/
	* gfortran.texi: Document.
	* gfortran.h (gfc_dt): New field default_exp.
	* primary.c (match_real_constant): Default exponent with -fdec.
	* io.c (match_io): Set dt.default_exp with -fdec.
	* ioparm.def (IOPARM_dt_default_exp): New.
	* trans-io.c (build_dt): Set IOPARM_dt_default_exp with -fdec.

	libgfortran/io/
	* io.h (IOPARM_DT_DEFAULT_EXP): New flag bit.
	* list_read.c (parse_real, read_real): Allow omission of exponent with
	IOPARM_DT_DEFAULT_EXP.
	* read.c (read_f): Ditto.

	gcc/testsuite/gfortran.dg/
	* dec_exp_1.f90, dec_exp_2.f90, dec_exp_3.f90: New testcases.

From-SVN: r241828
2016-11-03 18:09:44 +00:00
Fritz Reese eab1ee2254 Allow warning flags to associate through gfc_error.
gcc/fortran/
	* gfortran.h (gfc_error): New declaration for gfc_error with 'opt'.
	* error.c (gfc_error): Add optional 'opt' argument.
	* error.c (gfc_notify_std): Call fully-qualified gfc_error.

From-SVN: r241794
2016-11-02 14:46:33 +00:00
Fritz Reese 0ef33d4462 New I/O specifiers CARRIAGECONTROL, READONLY, SHARE with -fdec.
gcc/fortran/
	* gfortran.texi: Document.
	* frontend-passes.c (gfc_code_walker): Add SHARE and CARRIAGECONTROL.
	* io.c (gfc_free_open, gfc_resolve_open, gfc_match_open): Ditto.
	* gfortran.h (gfc_open): Add SHARE, CARRIAGECONTROL, and READONLY.
	* io.c (io_tag, match_open_element): Ditto.
	* ioparm.def: Ditto.
	* trans-io.c (gfc_trans_open): Ditto.
	* io.c (match_dec_etag, match_dec_ftag): New functions.

	libgfortran/io/
	* libgfortran.h (IOPARM_OPEN_HAS_READONLY, IOPARM_OPEN_HAS_SHARE,
	IOPARM_OPEN_HAS_CC): New for READONLY, SHARE, and CARRIAGECONTROL.
	* close.c (st_close): Support READONLY.
	* io.h (st_parameter_open, unit_flags): Support SHARE, CARRIAGECONTROL,
	and READONLY.
	* open.c (st_open): Ditto.
	* transfer.c (data_transfer_init): Ditto.
	* io.h (st_parameter_dt): New member 'cc' for CARRIAGECONTROL.
	* write.c (write_check_cc, write_cc): New functions for CARRIAGECONTROL.
	* transfer.c (next_record_cc): Ditto.
	* file_pos.c (st_endfile): Support SHARE and CARRIAGECONTROL.
	* io.h (st_parameter_inquire): Ditto.
	* open.c (edit_modes, new_unit): Ditto.
	* inquire.c (inquire_via_unit, inquire_via_filename): Ditto.
	* io.h (unit_share, unit_cc, cc_fortran, IOPARM_INQUIRE_HAS_SHARE,
	IOPARM_INQUIRE_HAS_CC): New for SHARE and CARRIAGECONTROL.
	* open.c (share_opt, cc_opt): Ditto.
	* read.c (read_x): Support CARRIAGECONTROL.
	* transfer.c (read_sf, next_record_r, next_record_w): Ditto.
	* write.c (list_formatted_write_scalar, write_a): Ditto.
	* unix.h (close_share): New prototype.
	* unix.c (open_share, close_share): New functions to handle SHARE.
	* unix.c (open_external): Handle READONLY. Call open_share.
	* close.c (st_close): Call close_share.

	gcc/testsuite/
	* dec_io_1.f90: New test.
        * dec_io_2.f90: New test.
        * dec_io_3.f90: New test.
        * dec_io_4.f90: New test.
        * dec_io_5.f90: New test.
        * dec_io_6.f90: New test.

From-SVN: r241550
2016-10-26 12:11:44 +00:00
Fritz Reese ef14476730 Treat form feed as whitespace.
gcc/fortran/
	* gfortran.texi: Document.
	* gfortran.h (gfc_is_whitespace): Include form feed ('\f').

	gcc/testsuite/gfortran.dg/
	* feed_1.f90, feed_2.f90: New testcases.

From-SVN: r241517
2016-10-25 15:20:36 +00:00
Fritz Reese f6d17ecdaf Cleanup -fdec.
gcc/fortran/
	* invoke.texi, gfortran.texi: Touch up documentation of -fdec.
	* gfortran.h (gfc_option): Move flag_dec_structure out of gfc_option.
	* decl.c (match_record_decl, gfc_match_decl_type_spec,
	gfc_match_structure_decl): Ditto.
	* match.c (gfc_match_member_sep): Ditto.
	* options.c (gfc_handle_option): Ditto.
	* lang.opt (fdec-structure): Use Fortran Var for flag_dec_structure.
	* lang.opt (fdec): Use Fortran Var to create flag_dec.
	* options.c (set_dec_flags): With -fdec enable -fcray-pointer,
	-fd-lines-as-comments (default), -fdollar-ok, and legacy std flags.

From-SVN: r241516
2016-10-25 15:13:43 +00:00
Fritz Reese 8e8c2744fa New flag -fdec-math for COTAN and degree trig intrinsics.
2016-10-11  Fritz Reese  <fritzoreese@gmail.com>

New flag -fdec-math for COTAN and degree trig intrinsics.

	gcc/fortran/
	* lang.opt: New flag -fdec-math.
	* options.c (set_dec_flags): Enable with -fdec.
	* invoke.texi, gfortran.texi, intrinsic.texi: Update documentation.
	* intrinsics.c (add_functions, do_simplify): New intrinsics
	with -fdec-math.
	* gfortran.h (gfc_isym_id): New isym GFC_ISYM_COTAN.
	* gfortran.h (gfc_resolve_atan2d, gfc_resolve_cotan,
	gfc_resolve_trigd, gfc_resolve_atrigd): New prototypes.
	* iresolve.c (resolve_trig_call, get_degrees, get_radians,
	is_trig_resolved, gfc_resolve_cotan, gfc_resolve_trigd,
	gfc_resolve_atrigd, gfc_resolve_atan2d): New functions.
	* intrinsics.h (gfc_simplify_atan2d, gfc_simplify_atrigd,
	gfc_simplify_cotan, gfc_simplify_trigd): New prototypes.
	* simplify.c (simplify_trig_call, degrees_f, radians_f,
	gfc_simplify_cotan, gfc_simplify_trigd, gfc_simplify_atrigd,
	gfc_simplify_atan2d): New functions.

	gcc/testsuite/gfortran.dg/
	* dec_math.f90: New testsuite.

From-SVN: r240989
2016-10-11 11:21:07 +00:00
Fritz Reese 34d567d1f5 lang.opt, [...]: New flag -fdec-static.
2016-09-23  Fritz Reese  <fritzoreese@gmail.com>

	gcc/fortran/
	* lang.opt, invoke.texi, gfortran.texi: New flag -fdec-static.
	* options.c (set_dec_flags): Set -fdec-static with -fdec.
	* gfortran.h (symbol_attribute): New attribute automatic.
	* gfortran.h (gfc_add_automatic): New prototype.
	* match.h (gfc_match_automatic, gfc_match_static): New functions.
	* decl.c (gfc_match_automatic, gfc_match_static): Ditto.
	* symbol.c (gfc_add_automatic): Ditto.
	* decl.c (match_attr_spec): Match AUTOMATIC and STATIC decls.
	* parse.c (decode_specification_statement, decode_statement): Ditto.
	* resolve.c (apply_default_init_local, resolve_fl_variable_derived,
	resolve_symbol): Support for automatic attribute.
	* symbol.c (check_conflict, gfc_copy_attr, gfc_is_var_automatic):
	Ditto.
	* trans-decl.c (gfc_finish_var_decl): Ditto.

	gcc/testsuite/gfortran.dg/
	* dec_static_1.f90, dec_static_2.f90, dec_static_3.f90,
	dec_static_4.f90: New testcases.

From-SVN: r240458
2016-09-23 21:06:18 +00:00
Jerry DeLisle 4a8d4422b0 re PR fortran/48298 ([F03] User-Defined Derived-Type IO (DTIO))
2016-09-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48298
	* io/inquire.c (inquire_via_unit): Adjust error check for the
	two possible internal unit KINDs.
	* io/io.h: Adjust defines for is_internal_unit and
	is_char4_unit. (gfc_unit): Add internal unit data to structure.
	(get_internal_unit): Change declaration to set_internal_unit.
	(free_internal_unit): Change name to stash_internal_unit_number.
	(get_unique_unit_number): Adjust parameter argument.
	Define IOPARM_DT_HAS_UDTIO. (gfc_saved_unit): New structure.
	* io/list_read.c (next_char_internal): Use is_char4_unit.
	* io/open.c (st_open): Adjust call to get_unique_unit_number.
	* io/transfer.c (write_block): Use is_char4_unit.
	(data_transfer_init): Update check for unit numbers.
	(st_read_done): Free the various allocated memories used for the
	internal units and stash the negative unit number and pointer to unit
	structure to allow reuse. (st_write_done): Likewise stash the freed
	unit.
	* io/unit.c: Create a fixed size buffer of 16 gfc_saved_unit's to use
	as a stack to save newunit unit numbers and unit structure for reuse.
	(get_external_unit): Change name to get_gfc_unit to better
	reflect what it does. (find_unit): Change call to get_gfc_unit.
	(find_or_create_unit): Likewise. (get_internal_unit): Change
	name to set_internal_unit. Move internal unit from the dtp
	structure to the gfc_unit structure so that it can be passed to
	child I/O statements through the UNIT.
	(free_internal_unit): Change name to stash_internal_unit_number.
	Push the common.unit number onto the newunit stack, saving it
	for possible reuse later. (get_unit): Set the internal unit
	KIND. Use get_unique_unit_number to get a negative unit number
	for the internal unit. Use get_gfc_unit to get the unit structure
	and use set_internal_unit to initialize it.
	(init_units): Initialize the newunit stack.
	(get_unique_unit_number): Check the stack for an available unit
	number and use it. If none there get the next most negative
	number. (close_units): Free any unit structures pointed to from the save
	stack.

2016-09-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/48298
	* gfortran.h (gfc_dt): Add *udtio.
	* ioparm.def: Add bit IOPARM_dt_f2003 to align with library use of bit
	25. Add IOPARM_dt_dtio bit to common flags.
	* resolve.c (resolve_transfer): Set dt->udtio to expression.
	* io.c (gfc_match_inquire): Adjust error message for internal
	unit KIND.
	* libgfortran.h: Adjust defines for GFC_INTERNAL_UNIT4,
	GFC_INTERNAL_UNIT, and GFC_INVALID_UNIT.
	* trans-io.c (build_dt): Set common_unit to reflect the KIND of
	the internal unit. Set mask bit for presence of dt->udtio.

2016-09-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/48298
	* gfortran.dg/negative_unit_check.f90: Update test.
	* gfortran.dg/dtio_14.f90: New test.

From-SVN: r240456
2016-09-23 20:36:21 +00:00
Paul Thomas 195d1431ff re PR fortran/48298 ([F03] User-Defined Derived-Type IO (DTIO))
2016-09-22  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/48298
	* gfortran.h : Place the pseudo operators INTRINSIC_FORMATTED
	and INTRINSIC_UNFORMATTED after the sentinel in enum
	gfc_intrinsic_op so that they do not appear as place holders
	in module_write.
	* interface.c (dtio_op): Comment on the special nature of the
	pseudo operators INTRINSIC FORMATTED and INTRINSIC_UNFORMATTED.

From-SVN: r240349
2016-09-22 11:26:59 +00:00
Andre Vehreschild 3c9f5092c6 libcaf.h: Add caf_reference_type.
libgfortran/ChangeLog:

2016-09-19  Andre Vehreschild  <vehre@gcc.gnu.org>

	* caf/libcaf.h: Add caf_reference_type.
	* caf/mpi.c: Adapted signature of caf_register().
	* caf/single.c (struct caf_single_token): Added to keep the pointer
	to the memory registered and array descriptor.
	(caf_internal_error): Added convenience interface.
	(_gfortran_caf_register): Adapted to work with caf_single_token and
	return memory in the array descriptor.
	(_gfortran_caf_deregister): Same.
	(assign_char1_from_char4): Fixed style.
	(convert_type): Fixed incorrect conversion.
	(_gfortran_caf_get): Adapted to work with caf_single_token.
	(_gfortran_caf_send): Same.
	(_gfortran_caf_sendget): Same.
	(copy_data): Added to stop repeating it in all _by_ref functions.
	(get_for_ref): Recursive getting of coarray data using a chain of
	references.
	(_gfortran_caf_get_by_ref): Driver for computing the memory needed for
	the get and checking properties of the operation.
	(send_by_ref): Same as get_for_ref but for sending data.
	(_gfortran_caf_send_by_ref): Same like caf_get_by_ref but for sending.
	(_gfortran_caf_sendget_by_ref): Uses get_by_ref and send_by_ref to
	implement sendget for reference chains.
	(_gfortran_caf_atomic_define): Adapted to work with caf_single_token.
	(_gfortran_caf_atomic_ref): Likewise.
	(_gfortran_caf_atomic_cas): Likewise.
	(_gfortran_caf_atomic_op): Likewise.
	(_gfortran_caf_event_post): Likewise.
	(_gfortran_caf_event_wait): Likewise.
	(_gfortran_caf_event_query): Likewise.
	(_gfortran_caf_lock): Likewise.
	(_gfortran_caf_unlock): Likewise.


gcc/testsuite/ChangeLog:

2016-09-19  Andre Vehreschild  <vehre@gcc.gnu.org>

	* gfortran.dg/coarray/alloc_comp_4.f90: New test.
	* gfortran.dg/coarray_38.f90:
	* gfortran.dg/coarray_alloc_comp_1.f08: New test.
	* gfortran.dg/coarray_alloc_comp_2.f08: New test.
	* gfortran.dg/coarray_allocate_7.f08: New test.
	* gfortran.dg/coarray_allocate_8.f08: New test.
	* gfortran.dg/coarray_allocate_9.f08: New test.
	* gfortran.dg/coarray_lib_alloc_1.f90: Adapted scan-tree-dumps to expect
	new caf_register.
	* gfortran.dg/coarray_lib_alloc_2.f90: Same.
	* gfortran.dg/coarray_lib_alloc_3.f90: Same.
	* gfortran.dg/coarray_lib_comm_1.f90: Adapted scan-tree-dumps to expect
	get_by_refs.
	* gfortran.dg/coarray_lib_token_3.f90: Same as for coarray_lib_alloc2.
	* gfortran.dg/coarray_lock_7.f90: Same.
	* gfortran.dg/coarray_poly_5.f90: Same.
	* gfortran.dg/coarray_poly_6.f90: Same.
	* gfortran.dg/coarray_poly_7.f90: Same.
	* gfortran.dg/coarray_poly_8.f90: Same.
	* gfortran.dg/coindexed_1.f90: Changed errors expected.

gcc/fortran/ChangeLog:

2016-09-19  Andre Vehreschild  <vehre@gcc.gnu.org>

	* expr.c (gfc_check_assign): Added flag to control whether datatype
	conversion is allowed.
	* gfortran.h: Added caf-token-tree to gfc_component.  Changed
	prototypes mostly to add whether datatype conversion is allowed.
	* gfortran.texi: Added documentation for the caf_reference_t and the
	caf_*_by_ref function.
	* primary.c (caf_variable_attr): Similar to gfc_variable_attr but
	focused on the needs of coarrays.
	(gfc_caf_attr): Same.
	* resolve.c (resolve_ordinary_assign): Set the conversion allowed
	flag when not in a coarray.
	* trans-array.c (gfc_array_init_size): Moved setting of array
	descriptor's datatype before the alloc, because caf_register needs it.
	(gfc_array_allocate): Changed notion of whether an array is a coarray.
	(gfc_array_deallocate): Same.
	(gfc_alloc_allocatable_for_assignment): Added setting of coarray's
	array descriptor datatype before the register.  And using deregister/
	register to mimmick a realloc for coarrays.
	* trans-decl.c (gfc_build_builtin_function_decls): Corrected signatures
	of old caf-functions and added signature definitions of the _by_ref
	ones.
	(generate_coarray_sym_init): Adapted to new caf_register signature.
	* trans-expr.c (gfc_conv_scalar_to_descriptor): Make sure a constant
	is translated to an lvalue expression before use in an array
	descriptor.
	(gfc_get_ultimate_alloc_ptr_comps_caf_token): New function.  Get the
	last allocatable component's coarray token.
	(gfc_get_tree_for_caf_expr): For top-level object get the coarray
	token and check for unsupported features.
	(gfc_get_caf_token_offset): Getting the offset might procude new
	statements, which now are stored in the pre and post of the current se.
	(gfc_caf_get_image_index): For this image return a call to
	caf_this_image.
	(expr_may_alias_variables): Check that the result is set for testing
	its properties.
	(alloc_scalar_allocatable_for_assignment): Added auto allocation of
	coarray components.
	(gfc_trans_assignment_1): Rewrite an assign to a coarray object to
	be a sendget.
	* trans-intrinsic.c (conv_caf_vector_subscript_elem): Corrected
	wrong comment.
	(compute_component_offset): Compute the correct offset a structure
	member.
	(conv_expr_ref_to_caf_ref): Convert to a chain of refs into
	caf_references.
	(gfc_conv_intrinsic_caf_get): Call caf_get_by_ref instead of caf_get.
	(conv_caf_send): Call caf_*_by_ref for coarrays that need
	reallocation.
	(gfc_conv_intrinsic_function): Adapted to new signuature of the caf
	drivers.
	(conv_intrinsic_atomic_op): Add pre and post statements correctly.
	(conv_intrinsic_atomic_ref): Same.
	(conv_intrinsic_atomic_cas): Same.
	(conv_intrinsic_event_query): Same.
	* trans-stmt.c (gfc_trans_lock_unlock): Same.
	(gfc_trans_event_post_wait): Same.
	(gfc_trans_allocate): Support allocation of allocatable coarrays.
	(gfc_trans_deallocate): And there deallocation.
	* trans-types.c (gfc_typenode_for_spec): Added flag to control whether
	a component is part of coarray.  When so, then add space to store a
	coarray token.
	(gfc_build_array_type): Same.
	(gfc_get_array_descriptor_base): Same.
	(gfc_get_array_type_bounds): Same.
	(gfc_sym_type): Same.
	(gfc_get_derived_type): Same.
	(gfc_get_caf_reference_type): Declare the caf_reference_type.
	* trans-types.h: Prototype changes only.
	* trans.c (gfc_allocate_using_lib): Use the updated caf_register
	signature.
	(gfc_allocate_allocatable): Same.
	(gfc_deallocate_with_status): Same.
	* trans.h: Defined the runtime types for caf_reference_t and the enums.

From-SVN: r240231
2016-09-19 15:45:40 +02:00
Paul Thomas e73d3ca6d1 [multiple changes]
2016-08-31  Paul Thomas  <pault@gcc.gnu.org>
	Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/48298

	* decl.c (access_attr_decl): Include case INTERFACE_DTIO as
	appropriate.
	* gfortran.h : Add INTRINSIC_FORMATTED and
	INTRINSIC_UNFORMATTED to gfc_intrinsic_op. Add INTERFACE_DTIO
	to interface type. Add new enum 'dtio_codes'. Add bitfield
	'has_dtio_procs' to symbol_attr. Add prototypes
	'gfc_check_dtio_interfaces' and 'gfc_find_specific_dtio_proc'.
	* interface.c (dtio_op): New function.
	(gfc_match_generic_spec): Match generic DTIO interfaces.
	(gfc_match_interface): Treat DTIO interfaces in the same way as
	(gfc_current_interface_head): Add INTERFACE_DTIO appropriately.
	(check_dtio_arg_TKR_intent): New function.
	(check_dtio_interface1): New function.
	(gfc_check_dtio_interfaces): New function.
	(gfc_find_specific_dtio_proc): New function.
	* io.c : Add FMT_DT to format_token.
	(format_lex): Handle DTIO formatting.
	* match.c (gfc_op2string): Add DTIO operators.
	* resolve.c (derived_inaccessible): Ignore pointer components
	to enclosing derived type.
	(resolve_transfer): Resolve transfers that involve DTIO.
	procedures. Find the specific subroutine for the transfer and
	use its existence to over-ride some of the constraints on
	derived types. If the transfer is recursive, require that the
	subroutine be so qualified.
	(dtio_procs_present): New function.
	(resolve_fl_namelist): Remove inhibition of polymorphic objects
	in namelists if DTIO read and write subroutines exist. Likewise
	for derived types.
	(resolve_types): Invoke 'gfc_verify_dtio_procedures'.
	* symbol.c : Set 'dtio_procs' using 'minit'.
	* trans-decl.c (gfc_finish_var_decl): If a derived-type/class
	object is associated with DTIO procedures, make it TREE_STATIC.
	* trans-expr.c (gfc_get_vptr_from_expr): If the expression
	drills down to a PARM_DECL, extract the vptr correctly.
	(gfc_conv_derived_to_class): Check 'info' in the test for
	'useflags'. If the se expression exists and is a pointer, use
	it as the class _data.
	* trans-io.c : Add IOCALL_X_DERIVED to iocall and the function
	prototype. Likewise for IOCALL_SET_NML_DTIO_VAL.
	(set_parameter_tree): Renamed from 'set_parameter_const', now
	returns void and has new tree argument. Calls modified to match
	new interface.
	(transfer_namelist_element): Transfer DTIO procedure pointer
	and vpointer using the new function IOCALL_SET_NML_DTIO_VAL.
	(get_dtio_proc): New function.
	(transfer_expr): Add new argument for the vptr field of class
	objects. Add the code to call the specific DTIO proc, convert
	derived types to class and call IOCALL_X_DERIVED.
	(trans_transfer): Add BT_CLASS to structures for treatment by
	the scalarizer. Obtain the vptr for the dynamic type, both for
	scalar and array transfer.

2016-08-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	Paul Thomas  <pault@gcc.gnu.org>

	PR libgfortran/48298
	* gfortran.map : Flag _st_set_nml_dtio_var and
	_gfortran_transfer_derived.
	* io/format.c (format_lex): Detect DTIO formatting.
	(parse_format_list): Parse the DTIO format.
	(next_format): Include FMT_DT.
	* io/format.h : Likewise. Add structure 'udf' to structure
	'fnode' to carry the IOTYPE string and the 'vlist'.
	* io/io.h : Add prototypes for the two types of DTIO subroutine
	and a typedef for gfc_class. Also, add to 'namelist_type'
	fields for the pointer to the DTIO procedure and the vtable.
	Add fields to struct st_parameter_dt for pointers to the two
	types of DTIO subroutine. Add to gfc_unit DTIO specific fields.
	(internal_proto): Add prototype for 'read_user_defined' and
	'write_user_defined'.
	* io/list_read.c (check_buffers): Use the 'current_unit' field.
	(unget_char): Likewise.
	(eat_spaces): Likewise.
	(list_formatted_read_scalar): For case BT_CLASS, call the DTIO
	procedure.
	(nml_get_obj_data): Likewise when DTIO procedure is present,.
	* io/transfer.c : Export prototypes for 'transfer_derived' and
	'transfer_derived_write'.
	(unformatted_read): For case BT_CLASS, call the DTIO procedure.
	(unformatted_write): Likewise.
	(formatted_transfer_scalar_read): Likewise.
	(formatted_transfer_scalar_write: Likewise.
	(transfer_derived): New function.
	(data_transfer_init): Set last_char if no child_dtio.
	(finalize_transfer): Return if child_dtio set.
	(st_write_done): Add condition for child_dtio not set.
	Add extra arguments for st_set_nml_var prototype.
	(set_nml_var): New function that contains the contents of the
	old version of st_set_nml_var. Also sets the 'dtio_sub' and
	'vtable' fields of the 'nml' structure.
	(st_set_nml_var): Now just calls set_nml_var with 'dtio_sub'
	and 'vtable' NULL.
	(st_set_nml_dtio_var): New function that calls set_nml_var.
	* io/unit.c (get_external_unit): If the found unit child_dtio
	is non zero, don't do any mutex locking/unlocking.  Just
	return the unit.
	* io/unix.c (tempfile_open): Revert to C style comment.
	* io/write.c (list_formatted_write_scalar): Do the DTIO call.
	(nml_write_obj): Add BT_CLASS and do the DTIO call.

2016-08-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/48298
	* gfortran.dg/dtio_1.f90: New test.
	* gfortran.dg/dtio_2.f90: New test.
	* gfortran.dg/dtio_3.f90: New test.
	* gfortran.dg/dtio_4.f90: New test.
	* gfortran.dg/dtio_5.f90: New test.
	* gfortran.dg/dtio_6.f90: New test.
	* gfortran.dg/dtio_7.f90: New test.
	* gfortran.dg/dtio_8.f90: New test.
	* gfortran.dg/dtio_9.f90: New test.
	* gfortran.dg/dtio_10.f90: New test.

From-SVN: r239880
2016-08-31 05:36:22 +00:00
Fritz Reese 7fc6162617 lang.opt, [...]: New flag -finit-derived.
2016-08-15  Fritz Reese  <fritzoreese@gmail.com>

	gcc/fortran/
	* lang.opt, invoke.texi: New flag -finit-derived.
	* gfortran.h (gfc_build_default_init_expr, gfc_apply_init,
	gfc_generate_initializer): New prototypes.
	* expr.c (gfc_build_default_init_expr, gfc_apply_init,
	component_initializer, gfc_generate_initializer): New functions.
	* expr.c (gfc_default_initializer): Wrap gfc_generate_initializer.
	* decl.c (build_struct): Move common code to gfc_apply_init.
	* resolve.c (can_generate_init): New function.
	* resolve.c (build_default_init_expr): Wrap gfc_build_default_init_expr.
	* resolve.c (apply_default_init, resolve_fl_variable_derived): Use
	gfc_generate_initializer.
	* trans-decl.c (gfc_generate_function_code): Use
	gfc_generate_initializer.

	gcc/testsuite/gfortran.dg/
	* init_flag_13.f90: New testcase.
	* init_flag_14.f90: Ditto.
	* init_flag_15.f03: Ditto.
	* dec_init_1.f90: Ditto.
	* dec_init_2.f90: Ditto.

From-SVN: r239489
2016-08-15 21:19:09 +00:00
Alessandro Fanfarillo 20d0bfcefd Second review of STAT= patch + tests
From-SVN: r238007
2016-07-05 09:33:06 -06:00
Fritz Reese f6288c2431 re PR fortran/56226 (Add support for DEC UNION and MAP extensions)
2016-05-07  Fritz Reese  <fritzoreese@gmail.com>

	PR fortran/56226
	* module.c (dt_upper_string): Rename to gfc_dt_upper_string
	(dt_lower_string): Likewise.
	* gfortran.h: Make new gfc_dt_upper/lower_string global.
	* class.c: Use gfc_dt_upper_string.
	* decl.c: Likewise.
	* symbol.c: Likewise.
	* resolve.c (resolve_component): New function.
	(resolve_fl_derived0): Move component loop code to resolve_component.
	* parse.c (check_component): New function.
	(parse_derived): Move loop code to check_component.
	* lang.opt, invoke.texi, options.c : New option -fdec-structure.
	* libgfortran.h (bt): New basic type BT_UNION.
	* gfortran.h (gfc_option): New option -fdec-structure.
	(gfc_get_union_type, gfc_compare_union_types): New prototypes.
	(gfc_bt_struct, gfc_fl_struct, case_bt_struct, case_fl_struct): New
	macros.
	(gfc_find_component): Change prototype.
	* match.h (gfc_match_member_sep, gfc_match_map, gfc_match_union,
	gfc_match_structure_decl): New prototypes.
	* parse.h (gfc_comp_struct): New macro.
	* symbol.c (gfc_find_component): Search for components in nested unions
	* class.c (insert_component_ref, gfc_add_component_ref, add_proc_comp,
	copy_vtab_proc_comps): Update calls to gfc_find_component.
	* primary.c (gfc_convert_to_structure_constructor): Likewise.
	* symbol.c (gfc_add_component): Likewise.
	* resolve.c (resolve_typebound_function, resolve_typebound_subroutine,
	resolve_typebound_procedure, resolve_component, resolve_fl_derived):
	Likewise.
	* expr.c (get_union_init, component_init): New functions.
	* decl.c (match_clist_expr, match_record_decl, get_struct_decl,
	gfc_match_map, gfc_match_union, gfc_match_structure_decl): Likewise.
	* interface.c (compare_components, gfc_compare_union_types): Likewise.
	* match.c (gfc_match_member_sep): Likewise.
	* parse.c (check_component, parse_union, parse_struct_map): Likewise.
	* resolve.c (resolve_fl_struct): Likewise.
	* symbol.c (find_union_component): Likewise.
	* trans-types.c (gfc_get_union_type): Likewise.
	* parse.c (parse_derived): Use new functions.
	* interface.c (gfc_compare_derived_types, gfc_compare_types): Likewise.
	* expr.c (gfc_default_initializer): Likewise.
	* gfortran.texi: Support for DEC structures, unions, and maps.
	* gfortran.h (gfc_statement, sym_flavor): Likewise.
	* check.c (gfc_check_kill_sub): Likewise.
	* expr.c (gfc_copy_expr, simplify_const_ref,
	gfc_has_default_initializer): Likewise.
	* decl.c (build_sym, match_data_constant, add_init_expr_to_sym,
	match_pointer_init, build_struct, variable_decl,
	gfc_match_decl_type_spec, gfc_mach_data-decl, gfc_match_entry,
	gfc_match_end, gfc_match_derived_decl): Likewise.
	* interface.c (check_interface0, check_interface1,
	gfc_search_interface): Likewise.
	* misc.c (gfc_basic_typename, gfc_typename): Likewise.
	* module.c (add_true_name, build_tnt, bt_types, mio_typespec,
	fix_mio_expr, load_needed, mio_symbol, read_module, write_symbol,
	gfc_get_module_backend_decl): Likewise.
	* parse.h (gfc_compile_state): Likewise.
	* parse.c (decode_specification_statement, decode_statement,
	gfc_ascii_statement, verify_st_order, parse_spec): Likewise.
	* primary.c (gfc_match_varspec, gfc_match_structure_constructor,
	gfc_match_rvalue, match_variable): Likewise.
	* resolve.c (find_arglists, resolve_structure_cons,
	is_illegal_recursion, resolve_generic_f, get_declared_from_expr,
	resolve_typebound_subroutine, resolve_allocate_expr,
	nonscalar_typebound_assign, generate_component_assignments,
	resolve_fl_variable_derived, check_defined_assignments,
	resolve_component, resolve_symbol, resolve_equivalence_derived):
	Likewise.
	* symbol.c (flavors, check_conflict, gfc_add_flavor, gfc_use_derived,
	gfc_restore_last_undo_checkpoint, gfc_type_compatible,
	gfc_find_dt_in_generic): Likewise.
	* trans-decl.c (gfc_get_module_backend_decl, create_function_arglist,
	gfc_create_module_variable, check_constant_initializer): Likewise.
	* trans-expr.c (gfc_conv_component_ref, gfc_conv_initializer,
	gfc_trans_alloc_subarray_assign, gfc_trans_subcomponent_assign,
	gfc_conv_structure, gfc_trans_scalar_assign, copyable_array_p):
	Likewise.
	* trans-io.c (transfer_namelist_element, transfer_expr,
	gfc_trans_transfer): Likewise.
	* trans-stmt.c (gfc_trans_deallocate): Likewise.
	* trans-types.c (gfc_typenode_for_spec, gfc_copy_dt_decls_ifequal,
	gfc_get_derived_type): Likewise.

2016-05-07  Fritz Reese  <fritzoreese@gmail.com>

	PR fortran/56226
	* gfortran.dg/dec_structure_1.f90: New testcase.
	* gfortran.dg/dec_structure_2.f90: Ditto.
	* gfortran.dg/dec_structure_3.f90: Ditto.
	* gfortran.dg/dec_structure_4.f90: Ditto.
	* gfortran.dg/dec_structure_5.f90: Ditto.
	* gfortran.dg/dec_structure_6.f90: Ditto.
	* gfortran.dg/dec_structure_7.f90: Ditto.
	* gfortran.dg/dec_structure_8.f90: Ditto.
	* gfortran.dg/dec_structure_9.f90: Ditto.
	* gfortran.dg/dec_structure_10.f90: Ditto.
	* gfortran.dg/dec_structure_11.f90: Ditto.
	* gfortran.dg/dec_union_1.f90: Ditto.
	* gfortran.dg/dec_union_2.f90: Ditto.
	* gfortran.dg/dec_union_3.f90: Ditto.
	* gfortran.dg/dec_union_4.f90: Ditto.
	* gfortran.dg/dec_union_5.f90: Ditto.
	* gfortran.dg/dec_union_6.f90: Ditto.
	* gfortran.dg/dec_union_7.f90: Ditto.

From-SVN: r235999
2016-05-07 23:16:23 +00:00
Thomas Schwinge 91106e8435 Rename GOMP_MAP_FORCE_DEALLOC to GOMP_MAP_DELETE
Also rename the Fortran OMP_MAP_FORCE_DEALLOC to OMP_MAP_DELETE.

	include/
	* gomp-constants.h (enum gomp_map_kind): Rename
	GOMP_MAP_FORCE_DEALLOC to GOMP_MAP_DELETE.  Adjust all users.

	gcc/fortran/
	* gfortran.h (enum gfc_omp_map_op): Rename OMP_MAP_FORCE_DEALLOC
	to OMP_MAP_DELETE.  Adjust all users.

From-SVN: r234294
2016-03-17 16:07:54 +01:00
Andre Vehreschild 76fe932be3 re PR fortran/69296 ([F03] Problem with associate and vector subscript)
gcc/fortran/ChangeLog:

2016-02-11  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/69296
	* gfortran.h: Added flag to gfc_association_list indicating that
	the rank of an associate variable has been guessed only.
	* parse.c (parse_associate): Set the guess flag mentioned above
	when guessing the rank of an expression.
	* resolve.c (resolve_assoc_var): When the rank has been guessed,
	make sure, that the guess was correct else overwrite with the actual
	rank.
	* trans-stmt.c (trans_associate_var): For subref_array_pointers in
	class objects, take the span from the _data component.

gcc/testsuite/ChangeLog:

2016-02-11  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/69296
	* gfortran.dg/associate_19.f03: New test.
	* gfortran.dg/associate_20.f03: New test.

From-SVN: r233351
2016-02-11 17:48:45 +01:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Tobias Burnus 460263d0ef re PR fortran/45859 ([Coarray, F2008, IR] Rejects valid actuals to coarray dummies)
2014-12-12  Tobias Burnus  <burnus@net-b.de>

gcc/fortran
        PR fortran/45859
        * expr.c (gfc_is_simply_contiguous): Optionally permit array
        * elements.
        (gfc_check_pointer_assign): Update call.
        * interface.c (compare_parameter): Ditto.
        * trans-array.c (gfc_conv_array_parameter): Ditto.
        * trans-intrinsic.c (gfc_conv_intrinsic_transfer,
        conv_isocbinding_function): Ditto.
        * gfortran.h (gfc_is_simply_contiguous): Update prototype.

gcc/testsuite/
        PR fortran/45859
        * gcc/testsuite/gfortran.dg/coarray_args_2.f90: Remove dg-error.

From-SVN: r231585
2015-12-12 20:00:32 +01:00
Tobias Burnus 5df445a2a5 check.c (gfc_check_event_query): New function.
2015-12-02  Tobias Burnus  <burnus@net-b.de>
	    Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>

	* check.c (gfc_check_event_query): New function.
	* dump-parse-tree.c (show_code_node): Handle EXEC_EVENT_POST,
	EXEC_EVENT_WAIT.
	* expr.c (gfc_check_vardef_context): New check for event variables
	definition.
	* gfortran.h (gfc_statement): Add ST_EVENT_POST, ST_EVENT_WAIT.
	(gfc_isym_id): GFC_ISYM_EVENT_QUERY.
	(struct symbol_attribute): New field.
	(gfc_exec_op): Add EXEC_EVENT_POST and EXEC_EVENT_WAIT.
	* gfortran.texi: Document about new events functions and minor
	changes.
	* interface.c (compare_parameter): New check.
	(gfc_procedure_use): New check for explicit procedure interface.
	(add_subroutines): Add event_query.
	* intrinsic.h (gfc_check_event_query,gfc_resolve_event_query):
	New prototypes.
	* iresolve.c (gfc_resolve_event_query): New function.
	* iso-fortran-env.def (event_type): New type.
	* match.c (event_statement,gfc_match_event_post,gfc_match_event_wait):
	New functions.
	(gfc_match_name): New event post and event wait.
	* match.h (gfc_match_event_post,gfc_match_event_wait):
	New prototypes.
	* module.c (ab_attribute): Add AB_EVENT_COMP.
	(attr_bits): Likewise.
	(mio_symbol_attribute): Handle event_comp attribute.
	* parse.c (decode_statement): Add ST_EVENT_POST, ST_EVENT_WAIT.
	(next_statement): Add ST_EVENT_POST, ST_EVENT_WAIT.
	(gfc_ascii_statement): Add ST_EVENT_POST, ST_EVENT_WAIT.
	(parse_derived): Check for event_type components.
	* resolve.c (resolve_allocate_expr): Check for event variable def.
	(resolve_lock_unlock): Renamed to resolve_lock_unlock_event. It
	includes logic for locks and events.
	(gfc_resolve_code): Call it.
	(gfc_resolve_symbol): New check for event variable to be a corray.
	* st.c (gfc_free_statement): Handle new EXEC_EVENT_POST and
	EXEC_EVENT_WAIT.
	* trans-decl.c (gfor_fndecl_caf_event_post,gfor_fndecl_caf_event_wait,
	gfor_fndecl_caf_event_query): New global variables.
	(generate_coarray_sym_init): Checking for event_type.
	(gfc_conv_procedure_call): Check for C bind attribute.
	* trans-intrinsic.c (conv_intrinsic_event_query): New function.
	(conv_intrinsic_move_alloc): Call it.
	* trans-stmt.c (gfc_trans_lock_unlock): Passing address
	of actual argument.
	(gfc_trans_sync): Likewise.
	(gfc_trans_event_post_wait): New function.
	* trans-stmt.h (gfc_trans_event_post_wait): New prototype.
	* trans-types.c (gfc_get_derived_type): Integer_kind as event_type.
	* trans.c (gfc_allocate_using_lib): New argument and logic for events.
	(gfc_allocate_allocatable): Passing new argument.
	(trans_code): Handle EXEC_EVENT_POST, EXEC_EVENT_WAIT.
	* trans.h (gfc_coarray_type): New elements.
	(gfor_fndecl_caf_event_post,gfor_fndecl_caf_event_wait,
	gfor_fndecl_caf_event_query): Declare them.

2015-12-02  Tobias Burnus  <burnus@net-b.de>
	    Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>

	* gfortran.dg/coarray/event_1.f90: New.
	* gfortran.dg/coarray/event_2.f90: New.

Co-Authored-By: Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>

From-SVN: r231208
2015-12-02 21:59:05 +00:00
Cesar Philippidis 2a70708e0b dump-parse-tree.c (show_omp_clauses): Handle optional num and static arguments for the gang clause.
gcc/fortran/
	* dump-parse-tree.c (show_omp_clauses): Handle optional num and static
	arguments for the gang clause.
	* gfortran.h (gfc_omp_clauses): Rename gang_expr as gang_num_expr.
	Add gang_static_expr.
	* openmp.c (gfc_free_omp_clauses): Update to free gang_num_expr and
	gang_static_expr.
	(match_oacc_clause_gang): Update to support both num and static in
	the same clause.
	(resolve_omp_clauses): Formatting.  Also handle gang_num_expr and
	gang_static_expr.
	(resolve_oacc_params_in_parallel): New const char arg argument.
	Use it to report more accurate gang, worker and vector clause errors.
	(resolve_oacc_loop_blocks): Update calls to
	resolve_oacc_params_in_parallel.
	* trans-openmp.c (gfc_trans_omp_clauses): Update the gimplification of
	the gang clause.
	(gfc_trans_oacc_combined_directive): Make use of gang_num_expr and
	gang_static_expr.  Remove OMP_LIST_REDUCTION from construct_clauses.

	gcc/testsuite/
	* gfortran.dg/goacc/gang-static.f95: Add tests for gang num arguments.
	* gfortran.dg/goacc/loop-2.f95: Update expected diagnostics.
	* gfortran.dg/goacc/loop-6.f95: Likewise.
	* gfortran.dg/goacc/loop-7.f95: New test.
	* gfortran.dg/goacc/reduction-2.f95: New test.

From-SVN: r231112
2015-12-01 06:27:11 -08:00
Cesar Philippidis db941d7ef7 tree-nested.c (convert_nonlocal_omp_clauses): Add support for OMP_CLAUSE_{NUM_GANGS,NUM_VECTORS,VECTOR_LENGTH,SEQ}.
gcc/
	* tree-nested.c (convert_nonlocal_omp_clauses): Add support for
	OMP_CLAUSE_{NUM_GANGS,NUM_VECTORS,VECTOR_LENGTH,SEQ}.
	(convert_local_omp_clauses): Likewise.

	gcc/fortran/
	* f95-lang.c (gfc_attribute_table): Add an "oacc function"
	attribute.
	* gfortran.h (symbol_attribute): Add an oacc_function bit-field.
	(gfc_oacc_routine_name): New struct;
	(gfc_get_oacc_routine_name): New macro.
	(gfc_namespace): Add oacc_routine_clauses, oacc_routine_names and
	oacc_routine fields.
	(gfc_exec_op): Add EXEC_OACC_ROUTINE.
	* openmp.c (OACC_ROUTINE_CLAUSES): New mask.
	(gfc_oacc_routine_dims): New function.
	(gfc_match_oacc_routine): Add support for named routines and the
	gang, worker vector and seq clauses.
	* parse.c (is_oacc): Add EXEC_OACC_ROUTINE.
	* resolve.c (gfc_resolve_blocks): Likewise.
	* st.c (gfc_free_statement): Likewise.
	* trans-decl.c (add_attributes_to_decl): Attach an 'oacc function'
	attribute and shape geometry for acc routine.

	gcc/testsuite/
	* gfortran.dg/goacc/routine-3.f90: New test.
	* gfortran.dg/goacc/routine-4.f90: New test.
	* gfortran.dg/goacc/routine-5.f90: New test.
	* gfortran.dg/goacc/routine-6.f90: New test.
	* gfortran.dg/goacc/subroutines: New test.

	libgomp/
	* libgomp.oacc-fortran/routine-5.f90: New test.
	* libgomp.oacc-fortran/routine-7.f90: New test.
	* libgomp.oacc-fortran/routine-9.f90: New test.

From-SVN: r231081
2015-11-30 11:09:33 -08:00
James Norris dc7a8b4b7a dump-parse-tree.c (show_namespace): Handle declares.
gcc/fortran/
	* dump-parse-tree.c (show_namespace): Handle declares.
	* gfortran.h (struct symbol_attribute): New fields.
	(enum gfc_omp_map_map): Add OMP_MAP_DEVICE_RESIDENT and OMP_MAP_LINK.
	(OMP_LIST_LINK): New enum.
	(struct gfc_oacc_declare): New structure.
	(gfc_get_oacc_declare): New definition.
	(struct gfc_namespace): Change type.
	(enum gfc_exec_op): Add EXEC_OACC_DECLARE.
	(struct gfc_code): New field.
	* module.c (enum ab_attribute): Add AB_OACC_DECLARE_CREATE,
	AB_OACC_DECLARE_COPYIN, AB_OACC_DECLARE_DEVICEPTR,
	AB_OACC_DECLARE_DEVICE_RESIDENT, AB_OACC_DECLARE_LINK
	(attr_bits): Add new initializers.
	(mio_symbol_attribute): Handle new atributes.
	* openmp.c (gfc_free_oacc_declare_clauses): New function.
	(gfc_match_oacc_clause_link: Likewise.
	(OMP_CLAUSE_LINK): New definition.
	(gfc_match_omp_clauses): Handle OMP_CLAUSE_LINK.
	(OACC_DECLARE_CLAUSES): Add OMP_CLAUSE_LINK
	(gfc_match_oacc_declare): Add checking and module handling.
	(resolve_omp_clauses): Add array initializer.
	(gfc_resolve_oacc_declare): Reimplement.
	* parse.c (case_decl): Add ST_OACC_DECLARE.
	(parse_spec): Remove handling.
	(parse_progunit): Remove handling.
	* parse.h (struct gfc_state_data): Change type.
	* resolve.c (gfc_resolve_blocks): Handle EXEC_OACC_DECLARE.
	* st.c (gfc_free_statement): Handle EXEC_OACC_DECLARE.
	* symbol.c (check_conflict): Add conflict checks.
	(gfc_add_oacc_declare_create, gfc_add_oacc_declare_copyin, 
	gfc_add_oacc_declare_deviceptr, gfc_add_oacc_declare_device_resident):
	New functions.
	(gfc_copy_attr): Handle new symbols.
	* trans-decl.c (add_clause, find_module_oacc_declare_clauses,
	finish_oacc_declare): New functions.
	(gfc_generate_function_code): Replace with call.
	* trans-openmp.c (gfc_trans_oacc_declare): Reimplement.
	(gfc_trans_oacc_directive): Handle EXEC_OACC_DECLARE.
	* trans-stmt.c (gfc_trans_block_construct): Replace with call.
	* trans-stmt.h (gfc_trans_oacc_declare): Remove argument.
	* trans.c (trans_code): Handle EXEC_OACC_DECLARE.

	gcc/testsuite
	* gfortran.dg/goacc/declare-1.f95: Update test.
	* gfortran.dg/goacc/declare-2.f95: New test.

	libgomp/
	* testsuite/libgomp.oacc-fortran/declare-1.f90: New test.
	* testsuite/libgomp.oacc-fortran/declare-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/declare-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/declare-4.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/declare-5.f90: Likewise.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>

From-SVN: r230722
2015-11-22 16:45:38 +00:00
Thomas Schwinge 4bf9e5a8a2 OpenACC atomic directive
gcc/c-family/
	* c-pragma.c (oacc_pragmas): Add "atomic".
	* c-pragma.h (pragma_kind): Add PRAGMA_OACC_ATOMIC.
	gcc/c/
	* c-parser.c (c_parser_omp_construct): Handle PRAGMA_OACC_ATOMIC.
	gcc/cp/
	* parser.c (cp_parser_omp_construct, cp_parser_pragma): Handle
	PRAGMA_OACC_ATOMIC.
	gcc/fortran/
	* gfortran.h (gfc_statement): Add ST_OACC_ATOMIC,
	ST_OACC_END_ATOMIC.
	(gfc_exec_op): Add EXEC_OACC_ATOMIC.
	* match.h (gfc_match_oacc_atomic): New prototype.
	* openmp.c (gfc_match_omp_atomic, gfc_match_oacc_atomic): New
	wrapper functions around...
	(gfc_match_omp_oacc_atomic): ... this new function.
	(oacc_code_to_statement, gfc_resolve_oacc_directive): Handle
	EXEC_OACC_ATOMIC.
	* parse.c (decode_oacc_directive): Handle "atomic", "end atomic".
	(case_exec_markers): Add ST_OACC_ATOMIC.
	(gfc_ascii_statement): Handle ST_OACC_ATOMIC, ST_OACC_END_ATOMIC.
	(parse_omp_atomic): Rename to...
	(parse_omp_oacc_atomic): ... this new function.  Add omp_p formal
	parameter.  Adjust all users.
	(parse_executable): Handle ST_OACC_ATOMIC.
	(is_oacc): Handle EXEC_OACC_ATOMIC.
	* resolve.c (gfc_resolve_blocks, gfc_resolve_code): Handle
	EXEC_OACC_ATOMIC.
	* st.c (gfc_free_statement): Handle EXEC_OACC_ATOMIC.
	* trans-openmp.c (gfc_trans_oacc_directive): Handle
	EXEC_OACC_ATOMIC.
	* trans.c (trans_code): Handle EXEC_OACC_ATOMIC.
	gcc/
	* builtins.def (DEF_GOMP_BUILTIN): Enable for flag_openacc.
	* omp-low.c (check_omp_nesting_restrictions): Allow
	GIMPLE_OMP_ATOMIC_LOAD, GIMPLE_OMP_ATOMIC_STORE inside OpenACC
	contexts.
	gcc/testsuite/
	* c-c++-common/goacc-gomp/nesting-fail-1.c: Move "atomic" tests
	from here to...
	* c-c++-common/goacc-gomp/nesting-1.c: ... here, and expect them
	to succeed.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/atomic_capture-1.c: New
	file.
	* testsuite/libgomp.oacc-c-c++-common/atomic_capture-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/atomic_rw-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/atomic_update-1.c: Likewise.
	* testsuite/libgomp.oacc-fortran/atomic_capture-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/atomic_rw-1.f90: New file.
	* testsuite/libgomp.oacc-fortran/atomic_update-1.f90: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: New file.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/worker-single-1a.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/worker-single-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/worker-single-6.c: Likewise.

From-SVN: r229703
2015-11-03 12:28:22 +01:00
Cesar Philippidis 2ac33bca8a gfortran.h (gfc_omp_namespace): Add locus where member.
gcc/fortran/
	* gfortran.h (gfc_omp_namespace): Add locus where member.
	* openmp.c (gfc_match_omp_variable_list): Set where for each list
	item found.
	(resolve_omp_clauses): Remove where argument and use the where
	gfc_omp_namespace member when reporting errors.
	(resolve_omp_do):  Update call to resolve_omp_clauses.
	(resolve_oacc_loop): Likewise.
	(gfc_resolve_oacc_directive): Likewise.
	(gfc_resolve_omp_directive): Likewise.
	(gfc_resolve_omp_declare_simd): Likewise.

	gcc/testsuite/
	* gfortran.dg/gomp/intentin1.f90: Adjust copyprivate warning.

From-SVN: r229609
2015-10-30 15:16:52 -07:00
Louis Krupp 388902dab9 re PR fortran/66056 (ICEs and endless compilation for lonely labels/numbers in type)
2015-10-26  Louis Krupp  <louis.krupp@zoho.com>

	PR fortran/66056
	* fortran.h: Include namespace pointer in statement label
	structure.
	* symbol.c (gfc_get_st_label): Store pointer to namespace
	that owns the statement label tree in each label.
	(gfc_free_st_label): Use namespace owning statement label
	tree when deleting statement label.
	* io.c: Initialize format_asterisk with NULL namespace pointer.

2015-10-26  Louis Krupp  <louis.krupp@zoho.com>

	PR fortran/66056
	* gfortran.dg/empty_label_typedecl.f90: New test

From-SVN: r229390
2015-10-26 19:18:08 +00:00
Mikael Morin a70ba41f41 Fix common-related error recovery ICE.
Fix an inconsistent state, between the in_common attribute
and the common_block pointer.

 - adding a symbol to a common block list in gfc_match_common is delayed
   after the call to gfc_add_in_common.
 - gfc_restore_latest_undo_checkpoint is changed to check the common_block
   pointer directly instead of the in_common attribute.
 - gfc_restore_old_symbol is changed to also restore
   the common-related pointers.  This is done using a new function created
   to factor the related memory management.
 - In gfc_restore_last_undo_checkpoint, when a symbol has been removed
   from the common block linked list, its common_next pointer is cleared.

	PR fortran/67758
gcc/fortran/
	* gfortran.h (gfc_symbol): Expand comment.
	* match.c (gfc_match_common): Delay adding the symbol to
	the common_block after the gfc_add_in_common call.
	* symbol.c (gfc_free_symbol): Move common block memory handling...
	(gfc_set_symbol_common_block): ... here as a new function.
	(restore_old_symbol): Restore common block fields.
	(gfc_restore_last_undo_checkpoint):
	Check the common_block pointer instead of the in_common attribute.
	When a symbol has been removed from the common block linked list,
	clear its common_next pointer.
gcc/testsuite/
	* gfortran.dg/common_25.f90: New file.

From-SVN: r228947
2015-10-18 17:17:21 +00:00
Trevor Saunders a79683d5f0 remove more useless typedefs
gcc/c-family/ChangeLog:

2015-08-18  Trevor Saunders  <tbsaunde@tbsaunde.org>

	* c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h,
	c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless
 typedefs.

gcc/c/ChangeLog:

2015-08-18  Trevor Saunders  <tbsaunde@tbsaunde.org>

	* c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs.

gcc/cp/ChangeLog:

2015-08-18  Trevor Saunders  <tbsaunde@tbsaunde.org>

	* call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c,
	method.c, name-lookup.h, parser.c, parser.h, rtti.c,
	semantics.c, typeck2.c: Remove useless typedefs.

gcc/fortran/ChangeLog:

2015-08-18  Trevor Saunders  <tbsaunde@tbsaunde.org>

	* dependency.c, dependency.h, gfortran.h, io.c, module.c,
	parse.h, resolve.c, trans-types.h, trans.h: remove useless
typedefs.

gcc/lto/ChangeLog:

2015-08-18  Trevor Saunders  <tbsaunde@tbsaunde.org>

	* lto.h: Remove useless typedefs.

gcc/objc/ChangeLog:

2015-08-18  Trevor Saunders  <tbsaunde@tbsaunde.org>

	* objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h:
	Remove useless typedefs.

gcc/ChangeLog:

2015-08-18  Trevor Saunders  <tbsaunde@tbsaunde.org>

	* bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c,
	dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h,
	mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c,
	signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c,
	tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c,
	tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c,
	tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c,
	tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c,
	tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless
typedefs.

From-SVN: r227001
2015-08-19 02:48:48 +00:00
Francois-Xavier Coudert 0e360db970 re PR fortran/64104 ([F2003][IEEE] Allow IEEE functions in specification expressions)
PR fortran/64104

	* expr.c (gfc_check_init_expr): Allow some IEEE functions in
	constant expressions.
	(external_spec_function): Allow some IEEE functions in specification
	expressions.
	* simplify.c (gfc_simplify_ieee_selected_real_kind): Remove.
	(simplify_ieee_selected_real_kind, simplify_ieee_support,
	matches_ieee_function_name, gfc_simplify_ieee_functions): New
	functions.
	* gfortran.h (gfc_simplify_ieee_selected_real_kind): Remove
	prototype.
	(gfc_simplify_ieee_functions): Add prototype.

	* gfortran.dg/ieee/ieee_8.f90: New test.

From-SVN: r226723
2015-08-07 15:02:15 +00:00
Paul Thomas 3d5dc929f4 re PR fortran/52846 ([F2008] Support submodules)
2015-07-17  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/52846
	* decl.c (gfc_match_end): Pick out declared submodule name from
	the composite identifier.
	* gfortran.h : Add 'submodule_name' to gfc_use_list structure.
	* module.c (gfc_match_submodule): Define submodule_name and add
	static 'submodule_name'.
	(gfc_match_submodule): Build up submodule filenames, using '@'
	as a delimiter. Store the output filename in 'submodule_name'.
	Similarly, the submodule identifier is built using '.' as an
	identifier.
	(gfc_dump_module): If current state is COMP_SUBMODULE, write
	to file 'submodule_name', using SUBMODULE_EXTENSION.
	(gfc_use_module): Similarly, use the 'submodule_name' field in
	the gfc_use_list structure and SUBMODULE_EXTENSION to read the
	implicitly used submodule files.

2015-07-17  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/52846
	* lib/fortran-modules.exp (proc cleanup-submodules): New
	procedure.
	* gfortran.dg/submodule_1.f08: Change extension and clean up
	the submodule files.
	* gfortran.dg/submodule_2.f08: ditto
	* gfortran.dg/submodule_6.f08: ditto
	* gfortran.dg/submodule_7.f08: ditto
	* gfortran.dg/submodule_8.f08: New test
	* gfortran.dg/submodule_9.f08: New test

From-SVN: r225945
2015-07-17 17:23:45 +00:00
Paul Thomas 4668d6f9c0 re PR fortran/52846 ([F2008] Support submodules)
2015-07-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/52846
	* decl.c (get_proc_name): Make a partially populated interface
	symbol to carry the characteristics of a module procedure and
	its result.
	(variable_decl): Declarations of dummies or results in the
	abreviated form of module procedure is an error.
	(gfc_match_import): IMPORT is not permitted in the interface
	declaration of module procedures.
	(match_attr_spec): Submodule variables have implicit save
	attribute for F2008 onwards.
	(gfc_match_prefix): Add 'module' as the a prefix and set the
	module_procedure attribute.
	(gfc_match_formal_arglist): For a module procedure keep the
	interface formal_arglist from the interface, match new the
	formal arguments and then compare the number and names of each.
	(gfc_match_procedure): Add case COMP_SUBMODULE.
	(gfc_match_function_decl, gfc_match_subroutine_decl): Set the
	module_procedure attribute.
	(gfc_match_entry, gfc_match_end):  Add case COMP_SUBMODULE. If
	attr abr_modproc_decl is set, switch the message accordingly
	for subroutines and functions.
	(gfc_match_submod_proc): New function to match the abbreviated
	style of submodule declaration.
	* gfortran.h : Add ST_SUBMODULE and ST_END_SUBMODULE. Add the
	attribute bits 'used_in_submodule' and 'module_procedure'. Add
	the bit field 'abr_modproc_decl' to gfc_symbol. Add prototypes
	for 'gfc_copy_dummy_sym', 'gfc_check_dummy_characteristics' and
	'gfc_check_result_characteristics'.
	* interface.c : Add the prefix 'gfc_' to the names of functions
	'check_dummy(result)_characteristics' and all their references.
	* match.h : Add prototype for 'gfc_match_submod_proc' and
	'gfc_match_submodule'.
	(check_sym_interfaces): A module procedure is not an error in
	a module procedure statment in a generic interface.
	* module.c (gfc_match_submodule): New function. Add handling
	for the 'module_procedure' attribute bit.
	(gfc_use_module): Make sure that a submodule cannot use itself.
	* parse.c (decode_statement): Set attr has_'import_set' for
	the interface declaration of module procedures. Handle a match
	occurring in 'gfc_match_submod_proc' and a match for
	'submodule'.
	(gfc_enclosing_unit): Include the state COMP_SUBMODULE.
	(gfc_ascii_statement): Add END SUBMODULE.
	(accept_statement): Add ST_SUBMODULE.
	(parse_spec): Disallow statement functions in a submodule
	specification part.
	(parse_contained): Add ST_END_SUBMODULE and COMP_SUBMODULE
	twice each.
	(get_modproc_result): Copy the result symbol of the interface.
	(parse_progunit): Call it.
	(set_syms_host_assoc): Make symbols from the ancestor module
	and submodules use associated, as required by the standard and
	set all private components public. Module procedures 'external'
	attribute bit is reset and the 'used_in_submodule' bit is set.
	(parse_module): If this is a submodule, use the ancestor module
	and submodules. Traverse the namespace, calling
	'set_syms_host_assoc'. Add ST_END_SUBMODULE and COMP_SUBMODULE.
	* parse.h : Add COMP_SUBMODULE.
	* primary.c (match_variable): Add COMP_SUBMODULE.
	* resolve.c (compare_fsyms): New function to compare the dummy
	characteristics of a module procedure with its interface.
	(resolve_fl_procedure): Compare the procedure, result and dummy
	characteristics of a module_procedure with its interface, using
	'compare_fsyms' for the dummy arguments.
	* symbol.c (gfc_add_procedure): Suppress the check for existing
	procedures in the case of a module procedure.
	(gfc_add_explicit_interface): Skip checks that must fail for
	module procedures.
	(gfc_add_type): Allow a new type to be added to module
	procedures, their results or their dummy arguments.
	(gfc_copy_dummy_sym): New function to generate new dummy args
	and copy the characteristics from the interface.
	* trans-decl.c (gfc_sym_mangled_function_id): Module procedures
	must always have their names mangled as if they are symbols
	coming from a declaration in a module.
	(gfc_get_symbol_decl): Add 'used_in_submodule' to the assert.
	(gfc_finish_var_decl): Symbols with the 'used_in_submodule' bit
	set are set DECL_EXTERNAL as if they were use associated.

2015-07-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/52846
	* gfortran.dg/submodule_1.f90: New test
	* gfortran.dg/submodule_2.f90: New test
	* gfortran.dg/submodule_3.f90: New test
	* gfortran.dg/submodule_4.f90: New test
	* gfortran.dg/submodule_5.f90: New test
	* gfortran.dg/submodule_6.f90: New test
	* gfortran.dg/submodule_7.f90: New test

From-SVN: r225354
2015-07-02 20:39:56 +00:00
Andrew MacLeod abb226c954 coretypes.h: Include input.h and as-a.h.
2015-06-17  Andrew MacLeod  <amacleod@redhat.com>

	* coretypes.h: Include input.h and as-a.h.
	* rtl.h: Include input.h and as-a.h for generator files.
	* hwint.c: Include input.h.
	* vec.c: Include input.h.
	* alias.c: Do not include input.h, line-map.h or is-a.h.
	* asan.c: Likewise.
	* attribs.c: Likewise.
	* auto-inc-dec.c: Likewise.
	* auto-profile.c: Likewise.
	* bb-reorder.c: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* caller-save.c: Likewise.
	* calls.c: Likewise.
	* ccmp.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* cilk-common.c: Likewise.
	* combine-stack-adj.c: Likewise.
	* combine.c: Likewise.
	* compare-elim.c: Likewise.
	* convert.c: Likewise.
	* coverage.c: Likewise.
	* cppbuiltin.c: Likewise.
	* cprop.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* data-streamer-in.c: Likewise.
	* data-streamer-out.c: Likewise.
	* data-streamer.c: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* ddg.c: Likewise.
	* debug.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* df.h: Likewise.
	* dfp.c: Likewise.
	* diagnostic-core.h: Likewise.
	* diagnostic.c: Likewise.
	* dojump.c: Likewise.
	* dominance.c: Likewise.
	* domwalk.c: Likewise.
	* double-int.c: Likewise.
	* dse.c: Likewise.
	* dumpfile.c: Likewise.
	* dumpfile.h: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2cfi.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* et-forest.c: Likewise.
	* except.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* final.c: Likewise.
	* fixed-value.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* fwprop.c: Likewise.
	* gcc-plugin.h: Likewise.
	* gcse.c: Likewise.
	* generic-match-head.c: Likewise.
	* ggc-page.c: Likewise.
	* gimple-builder.c: Likewise.
	* gimple-expr.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-match-head.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-ssa-isolate-paths.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple-streamer-out.c: Likewise.
	* gimple-streamer.h: Likewise.
	* gimple-walk.c: Likewise.
	* gimple.c: Likewise.
	* gimplify-me.c: Likewise.
	* gimplify.c: Likewise.
	* godump.c: Likewise.
	* graph.c: Likewise.
	* graphite-blocking.c: Likewise.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-isl-ast-to-gimple.c: Likewise.
	* graphite-optimize-isl.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* ifcvt.c: Likewise.
	* init-regs.c: Likewise.
	* input.c: Likewise.
	* internal-fn.c: Likewise.
	* ipa-chkp.c: Likewise.
	* ipa-comdats.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-icf-gimple.c: Likewise.
	* ipa-icf.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-polymorphic-call.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-ref.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-visibility.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* jump.c: Likewise.
	* langhooks.c: Likewise.
	* lcm.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-init.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-iv.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-assigns.c: Likewise.
	* lra-coalesce.c: Likewise.
	* lra-constraints.c: Likewise.
	* lra-eliminations.c: Likewise.
	* lra-lives.c: Likewise.
	* lra-remat.c: Likewise.
	* lra-spills.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-compress.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* mcf.c: Likewise.
	* mode-switching.c: Likewise.
	* modulo-sched.c: Likewise.
	* omega.c: Likewise.
	* omp-low.c: Likewise.
	* optabs.c: Likewise.
	* opts-global.c: Likewise.
	* opts.h: Likewise.
	* passes.c: Likewise.
	* plugin.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* pretty-print.h: Likewise.
	* print-rtl.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* real.c: Likewise.
	* realmpfr.c: Likewise.
	* recog.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regcprop.c: Likewise.
	* reginfo.c: Likewise.
	* regrename.c: Likewise.
	* regstat.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* rtl-chkp.c: Likewise.
	* rtl-error.c: Likewise.
	* rtlanal.c: Likewise.
	* rtlhooks.c: Likewise.
	* sanopt.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* sched-vis.c: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched.c: Likewise.
	* sese.c: Likewise.
	* shrink-wrap.c: Likewise.
	* simplify-rtx.c: Likewise.
	* stack-ptr-mod.c: Likewise.
	* statistics.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* streamer-hooks.c: Likewise.
	* stringpool.c: Likewise.
	* symtab.c: Likewise.
	* target-globals.c: Likewise.
	* targhooks.c: Likewise.
	* toplev.c: Likewise.
	* tracer.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-browser.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chkp-opt.c: Likewise.
	* tree-chkp.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-iterator.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-copyrename.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-loop-unswitch.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-scopedtables.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree-streamer.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tsan.c: Likewise.
	* ubsan.c: Likewise.
	* valtrack.c: Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vmsdbgout.c: Likewise.
	* vtable-verify.c: Likewise.
	* web.c: Likewise.
	* wide-int.cc: Likewise.
	* xcoffout.c: Likewise.
	* config/aarch64/aarch64-builtins.c: Likewise.
	* config/aarch64/aarch64.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/arc/arc.c: Likewise.
	* config/arm/aarch-common.c: Likewise.
	* config/arm/arm-builtins.c: Likewise.
	* config/arm/arm-c.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/avr/avr-c.c: Likewise.
	* config/avr/avr-log.c: Likewise.
	* config/avr/avr.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/c6x/c6x.c: Likewise.
	* config/cr16/cr16.c: Likewise.
	* config/cris/cris.c: Likewise.
	* config/darwin-c.c: Likewise.
	* config/darwin.c: Likewise.
	* config/default-c.c: Likewise.
	* config/epiphany/epiphany.c: Likewise.
	* config/epiphany/mode-switch-use.c: Likewise.
	* config/epiphany/resolve-sw-modes.c: Likewise.
	* config/fr30/fr30.c: Likewise.
	* config/frv/frv.c: Likewise.
	* config/ft32/ft32.c: Likewise.
	* config/glibc-c.c: Likewise.
	* config/h8300/h8300.c: Likewise.
	* config/i386/i386-c.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/i386/msformat-c.c: Likewise.
	* config/i386/winnt-cxx.c: Likewise.
	* config/i386/winnt-stubs.c: Likewise.
	* config/i386/winnt.c: Likewise.
	* config/ia64/ia64-c.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/iq2000/iq2000.c: Likewise.
	* config/lm32/lm32.c: Likewise.
	* config/m32c/m32c-pragma.c: Likewise.
	* config/m32c/m32c.c: Likewise.
	* config/m32r/m32r.c: Likewise.
	* config/m68k/m68k.c: Likewise.
	* config/mcore/mcore.c: Likewise.
	* config/mep/mep-pragma.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/microblaze/microblaze-c.c: Likewise.
	* config/microblaze/microblaze.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/mmix/mmix.c: Likewise.
	* config/mn10300/mn10300.c: Likewise.
	* config/moxie/moxie.c: Likewise.
	* config/msp430/msp430-c.c: Likewise.
	* config/msp430/msp430.c: Likewise.
	* config/nds32/nds32-cost.c: Likewise.
	* config/nds32/nds32-fp-as-gp.c: Likewise.
	* config/nds32/nds32-intrinsic.c: Likewise.
	* config/nds32/nds32-isr.c: Likewise.
	* config/nds32/nds32-md-auxiliary.c: Likewise.
	* config/nds32/nds32-memory-manipulation.c: Likewise.
	* config/nds32/nds32-pipelines-auxiliary.c: Likewise.
	* config/nds32/nds32-predicates.c: Likewise.
	* config/nds32/nds32.c: Likewise.
	* config/nios2/nios2.c: Likewise.
	* config/nvptx/nvptx.c: Likewise.
	* config/pa/pa.c: Likewise.
	* config/pdp11/pdp11.c: Likewise.
	* config/rl78/rl78-c.c: Likewise.
	* config/rl78/rl78.c: Likewise.
	* config/rs6000/rs6000-c.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/rx/rx.c: Likewise.
	* config/s390/s390-c.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/sh/sh-c.c: Likewise.
	* config/sh/sh-mem.cc: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/sh_optimize_sett_clrt.cc: Likewise.
	* config/sh/sh_treg_combine.cc: Likewise.
	* config/sol2-c.c: Likewise.
	* config/sol2-cxx.c: Likewise.
	* config/sol2-stubs.c: Likewise.
	* config/sol2.c: Likewise.
	* config/sparc/sparc-c.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/spu/spu-c.c: Likewise.
	* config/spu/spu.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/tilegx/mul-tables.c: Likewise.
	* config/tilegx/tilegx-c.c: Likewise.
	* config/tilegx/tilegx.c: Likewise.
	* config/tilepro/mul-tables.c: Likewise.
	* config/tilepro/tilepro-c.c: Likewise.
	* config/tilepro/tilepro.c: Likewise.
	* config/v850/v850-c.c: Likewise.
	* config/v850/v850.c: Likewise.
	* config/vax/vax.c: Likewise.
	* config/visium/visium.c: Likewise.
	* config/vms/vms-c.c: Likewise.
	* config/vms/vms.c: Likewise.
	* config/vxworks.c: Likewise.
	* config/winnt-c.c: Likewise.
	* config/xtensa/xtensa.c: Likewise.

ada
	* ada/gcc-interface/cuintp.c: Do not include input.h, line-map.h or
	is-a.h.
	* ada/gcc-interface/decl.c: Likewise.
	* ada/gcc-interface/misc.c: Likewise.
	* ada/gcc-interface/targtyps.c: Likewise.
	* ada/gcc-interface/trans.c: Likewise.
	* ada/gcc-interface/utils.c: Likewise.
	* ada/gcc-interface/utils2.c: Likewise.

c
	* c/c-array-notation.c: Do not include input.h, line-map.h or is-a.h.
	* c/c-aux-info.c: Likewise.
	* c/c-convert.c: Likewise.
	* c/c-decl.c: Likewise.
	* c/c-errors.c: Likewise.
	* c/c-lang.c: Likewise.
	* c/c-objc-common.c: Likewise.
	* c/c-parser.c: Likewise.
	* c/c-typeck.c: Likewise.

c-family
	* c-family/array-notation-common.c: Do not include input.h, line-map.h
	or is-a.h.
	* c-family/c-ada-spec.c: Likewise.
	* c-family/c-cilkplus.c: Likewise.
	* c-family/c-common.c: Likewise.
	* c-family/c-common.h: Likewise.
	* c-family/c-cppbuiltin.c: Likewise.
	* c-family/c-dump.c: Likewise.
	* c-family/c-format.c: Likewise.
	* c-family/c-gimplify.c: Likewise.
	* c-family/c-indentation.c: Likewise.
	* c-family/c-lex.c: Likewise.
	* c-family/c-omp.c: Likewise.
	* c-family/c-opts.c: Likewise.
	* c-family/c-pch.c: Likewise.
	* c-family/c-ppoutput.c: Likewise.
	* c-family/c-pragma.c: Likewise.
	* c-family/c-pretty-print.c: Likewise.
	* c-family/c-semantics.c: Likewise.
	* c-family/c-ubsan.c: Likewise.
	* c-family/cilk.c: Likewise.
	* c-family/stub-objc.c: Likewise.

common
	* common/common-target.h: Do not include input.h, line-map.h or is-a.h.
	* common/common-targhooks.c: Likewise.

cp
	* cp/call.c: Do not include input.h, line-map.h or is-a.h.
	* cp/class.c: Likewise.
	* cp/constexpr.c: Likewise.
	* cp/cp-array-notation.c: Likewise.
	* cp/cp-gimplify.c: Likewise.
	* cp/cp-lang.c: Likewise.
	* cp/cp-objcp-common.c: Likewise.
	* cp/cp-tree.h: Likewise.
	* cp/cp-ubsan.c: Likewise.
	* cp/cvt.c: Likewise.
	* cp/decl.c: Likewise.
	* cp/decl2.c: Likewise.
	* cp/dump.c: Likewise.
	* cp/error.c: Likewise.
	* cp/except.c: Likewise.
	* cp/expr.c: Likewise.
	* cp/friend.c: Likewise.
	* cp/init.c: Likewise.
	* cp/lambda.c: Likewise.
	* cp/lex.c: Likewise.
	* cp/mangle.c: Likewise.
	* cp/method.c: Likewise.
	* cp/name-lookup.c: Likewise.
	* cp/optimize.c: Likewise.
	* cp/parser.c: Likewise.
	* cp/pt.c: Likewise.
	* cp/ptree.c: Likewise.
	* cp/repo.c: Likewise.
	* cp/rtti.c: Likewise.
	* cp/search.c: Likewise.
	* cp/semantics.c: Likewise.
	* cp/tree.c: Likewise.
	* cp/typeck.c: Likewise.
	* cp/typeck2.c: Likewise.
	* cp/vtable-class-hierarchy.c: Likewise.

fortran
	* fortran/convert.c: Do not include input.h, line-map.h or is-a.h.
	* fortran/cpp.c: Likewise.
	* fortran/decl.c: Likewise.
	* fortran/f95-lang.c: Likewise.
	* fortran/gfortran.h: Likewise.
	* fortran/iresolve.c: Likewise.
	* fortran/match.c: Likewise.
	* fortran/module.c: Likewise.
	* fortran/options.c: Likewise.
	* fortran/target-memory.c: Likewise.
	* fortran/trans-array.c: Likewise.
	* fortran/trans-common.c: Likewise.
	* fortran/trans-const.c: Likewise.
	* fortran/trans-decl.c: Likewise.
	* fortran/trans-expr.c: Likewise.
	* fortran/trans-intrinsic.c: Likewise.
	* fortran/trans-io.c: Likewise.
	* fortran/trans-openmp.c: Likewise.
	* fortran/trans-stmt.c: Likewise.
	* fortran/trans-types.c: Likewise.
	* fortran/trans.c: Likewise.

go
	* go/go-backend.c: Do not include input.h, line-map.h or is-a.h.
	* go/go-gcc.cc: Likewise.
	* go/go-lang.c: Likewise.
	* go/go-system.h: Likewise.

java
	* java/boehm.c: Do not include input.h, line-map.h or is-a.h.
	* java/builtins.c: Likewise.
	* java/class.c: Likewise.
	* java/constants.c: Likewise.
	* java/decl.c: Likewise.
	* java/except.c: Likewise.
	* java/expr.c: Likewise.
	* java/java-gimplify.c: Likewise.
	* java/jcf-dump.c: Likewise.
	* java/jcf-io.c: Likewise.
	* java/jcf-parse.c: Likewise.
	* java/jvgenmain.c: Likewise.
	* java/lang.c: Likewise.
	* java/mangle.c: Likewise.
	* java/mangle_name.c: Likewise.
	* java/resource.c: Likewise.
	* java/typeck.c: Likewise.
	* java/verify-glue.c: Likewise.
	* java/verify-impl.c: Likewise.

jit
	* jit/dummy-frontend.c: Do not include input.h, line-map.h or is-a.h.
	* jit/jit-common.h: Likewise.
	* jit/jit-playback.c: Likewise.

lto
	* lto/lto-lang.c: Do not include input.h, line-map.h or is-a.h.
	* lto/lto-object.c: Likewise.
	* lto/lto-partition.c: Likewise.
	* lto/lto-symtab.c: Likewise.
	* lto/lto.c: Likewise.

objc
	* objc/objc-act.c: Do not include input.h, line-map.h or is-a.h.
	* objc/objc-encoding.c: Likewise.
	* objc/objc-gnu-runtime-abi-01.c: Likewise.
	* objc/objc-lang.c: Likewise.
	* objc/objc-map.c: Likewise.
	* objc/objc-next-runtime-abi-01.c: Likewise.
	* objc/objc-next-runtime-abi-02.c: Likewise.
	* objc/objc-runtime-shared-support.c: Likewise.

objcp
	* objcp/objcp-decl.c: Do not include input.h, line-map.h or is-a.h.
	* objcp/objcp-lang.c: Likewise.

From-SVN: r224562
2015-06-17 14:58:44 +00:00
Andre Vehreschild 1792349b0b re PR fortran/44672 ([F08] ALLOCATE with SOURCE and no array-spec)
gcc/testsuite/ChangeLog:

2015-06-15  Andre Vehreschild  <vehre@gmx.de>

	PR fortran/44672
	PR fortran/45440
	PR fortran/57307
	* gfortran.dg/allocate_with_source_3.f90: Removed check for
	unimplemented error.
	* gfortran.dg/allocate_with_source_7.f08: New test.
	* gfortran.dg/allocate_with_source_8.f08: New test.

gcc/fortran/ChangeLog:

2015-06-15  Andre Vehreschild  <vehre@gmx.de>

	PR fortran/44672
	PR fortran/45440
	PR fortran/57307
	* gfortran.h: Extend gfc_code.ext.alloc to carry a
	flag indicating that the array specification has to be
	taken from expr3.
	* resolve.c (resolve_allocate_expr): Add F2008 notify
	and flag indicating source driven array spec.
	(resolve_allocate_deallocate): Check for source driven
	array spec, when array to allocate has no explicit
	array spec.
	* trans-array.c (gfc_array_init_size): Get lower and
	upper bound from a tree array descriptor, except when
	the source expression is an array-constructor which is
	fixed to be one-based.
	(retrieve_last_ref): Extracted from gfc_array_allocate().
	(gfc_array_allocate): Enable allocate(array, source= 
	array_expression) as specified by F2008:C633.
	(gfc_conv_expr_descriptor): Add class tree expression
	into the saved descriptor for class arrays.
	* trans-array.h: Add temporary array descriptor to
	gfc_array_allocate ().
	* trans-expr.c (gfc_conv_procedure_call): Special handling
	for _copy() routine translation, that comes without an
	interface. Third and fourth argument are now passed by value.
	* trans-stmt.c (gfc_trans_allocate): Get expr3 array
	descriptor for temporary arrays to allow allocate(array,
	source = array_expression) for array without array
	specification.

From-SVN: r224477
2015-06-15 12:08:04 +02:00
Andrew MacLeod 13fdf2e2d5 coretypes.h: Include hash-table.h and hash-set.h for host files.
2015-06-08  Andrew MacLeod  <amacleod@redhat.com>

	* coretypes.h: Include hash-table.h and hash-set.h for host files.
	* ggc.h: Don't include statistics.h>
	* hash-map.h: Remove all includes.
	* hash-set.h: Likewise.
	* hash-table.h: Add statistics.h, inchash.h and hash-map-traits.h to
	the include list. Remove <new>.
	* inchash.h: Remove all includes.
	* mem-stats.h: Likewise.
	* vec.h: No special processing for generators or ggc.  
	* alias.c : Adjust include files.
	* alloc-pool.c : Likewise.
	* alloc-pool.h : Likewise.
	* asan.c : Likewise.
	* attribs.c : Likewise.
	* auto-inc-dec.c : Likewise.
	* auto-profile.c : Likewise.
	* bb-reorder.c : Likewise.
	* bitmap.c : Likewise.
	* bitmap.h : Likewise.
	* bt-load.c : Likewise.
	* builtins.c : Likewise.
	* caller-save.c : Likewise.
	* calls.c : Likewise.
	* ccmp.c : Likewise.
	* cfg.c : Likewise.
	* cfganal.c : Likewise.
	* cfgbuild.c : Likewise.
	* cfgcleanup.c : Likewise.
	* cfgexpand.c : Likewise.
	* cfghooks.c : Likewise.
	* cfgloop.c : Likewise.
	* cfgloop.h : Likewise.
	* cfgloopanal.c : Likewise.
	* cfgloopmanip.c : Likewise.
	* cfgrtl.c : Likewise.
	* cgraph.c : Likewise.
	* cgraphbuild.c : Likewise.
	* cgraphclones.c : Likewise.
	* cgraphunit.c : Likewise.
	* cilk-common.c : Likewise.
	* combine-stack-adj.c : Likewise.
	* combine.c : Likewise.
	* compare-elim.c : Likewise.
	* context.c : Likewise.
	* convert.c : Likewise.
	* coverage.c : Likewise.
	* cppbuiltin.c : Likewise.
	* cprop.c : Likewise.
	* cse.c : Likewise.
	* cselib.c : Likewise.
	* data-streamer-in.c : Likewise.
	* data-streamer-out.c : Likewise.
	* data-streamer.c : Likewise.
	* data-streamer.h : Likewise.
	* dbxout.c : Likewise.
	* dce.c : Likewise.
	* ddg.c : Likewise.
	* debug.c : Likewise.
	* df-core.c : Likewise.
	* df-problems.c : Likewise.
	* df-scan.c : Likewise.
	* df.h : Likewise.
	* dfp.c : Likewise.
	* dojump.c : Likewise.
	* dominance.c : Likewise.
	* domwalk.c : Likewise.
	* double-int.c : Likewise.
	* dse.c : Likewise.
	* dumpfile.c : Likewise.
	* dwarf2asm.c : Likewise.
	* dwarf2cfi.c : Likewise.
	* dwarf2out.c : Likewise.
	* emit-rtl.c : Likewise.
	* et-forest.c : Likewise.
	* except.c : Likewise.
	* except.h : Likewise.
	* explow.c : Likewise.
	* expmed.c : Likewise.
	* expr.c : Likewise.
	* final.c : Likewise.
	* fixed-value.c : Likewise.
	* fold-const.c : Likewise.
	* function.c : Likewise.
	* fwprop.c : Likewise.
	* gcc-plugin.h : Likewise.
	* gcc.c : Likewise.
	* gcse-common.c : Likewise.
	* gcse.c : Likewise.
	* genattrtab.c : Likewise.
	* genautomata.c : Likewise.
	* genconditions.c : Likewise.
	* genemit.c : Likewise.
	* generic-match-head.c : Likewise.
	* genextract.c : Likewise.
	* gengtype-state.c : Likewise.
	* gengtype.c : Likewise.
	* genhooks.c : Likewise.
	* genmatch.c : Likewise.
	* genmodes.c : Likewise.
	* genrecog.c : Likewise.
	* gensupport.c : Likewise.
	* ggc-common.c : Likewise.
	* ggc-internal.h : Likewise.
	* ggc-none.c : Likewise.
	* ggc-page.c : Likewise.
	* gimple-builder.c : Likewise.
	* gimple-expr.c : Likewise.
	* gimple-fold.c : Likewise.
	* gimple-iterator.c : Likewise.
	* gimple-low.c : Likewise.
	* gimple-match-head.c : Likewise.
	* gimple-pretty-print.c : Likewise.
	* gimple-ssa-isolate-paths.c : Likewise.
	* gimple-ssa-strength-reduction.c : Likewise.
	* gimple-ssa.h : Likewise.
	* gimple-streamer-in.c : Likewise.
	* gimple-streamer-out.c : Likewise.
	* gimple-streamer.h : Likewise.
	* gimple-walk.c : Likewise.
	* gimple.c : Likewise.
	* gimplify-me.c : Likewise.
	* gimplify.c : Likewise.
	* godump.c : Likewise.
	* graph.c : Likewise.
	* graphds.c : Likewise.
	* graphite-blocking.c : Likewise.
	* graphite-dependences.c : Likewise.
	* graphite-interchange.c : Likewise.
	* graphite-isl-ast-to-gimple.c : Likewise.
	* graphite-optimize-isl.c : Likewise.
	* graphite-poly.c : Likewise.
	* graphite-scop-detection.c : Likewise.
	* graphite-sese-to-poly.c : Likewise.
	* graphite.c : Likewise.
	* haifa-sched.c : Likewise.
	* hard-reg-set.h : Likewise.
	* hw-doloop.c : Likewise.
	* ifcvt.c : Likewise.
	* inchash.c : Likewise.
	* incpath.c : Likewise.
	* init-regs.c : Likewise.
	* input.c : Likewise.
	* internal-fn.c : Likewise.
	* ipa-chkp.c : Likewise.
	* ipa-comdats.c : Likewise.
	* ipa-cp.c : Likewise.
	* ipa-devirt.c : Likewise.
	* ipa-icf-gimple.c : Likewise.
	* ipa-icf.c : Likewise.
	* ipa-inline-analysis.c : Likewise.
	* ipa-inline-transform.c : Likewise.
	* ipa-inline.c : Likewise.
	* ipa-polymorphic-call.c : Likewise.
	* ipa-profile.c : Likewise.
	* ipa-prop.c : Likewise.
	* ipa-pure-const.c : Likewise.
	* ipa-ref.c : Likewise.
	* ipa-reference.c : Likewise.
	* ipa-split.c : Likewise.
	* ipa-utils.c : Likewise.
	* ipa-visibility.c : Likewise.
	* ipa.c : Likewise.
	* ira-build.c : Likewise.
	* ira-color.c : Likewise.
	* ira-conflicts.c : Likewise.
	* ira-costs.c : Likewise.
	* ira-emit.c : Likewise.
	* ira-lives.c : Likewise.
	* ira.c : Likewise.
	* jump.c : Likewise.
	* langhooks.c : Likewise.
	* lcm.c : Likewise.
	* libfuncs.h : Likewise.
	* lists.c : Likewise.
	* loop-doloop.c : Likewise.
	* loop-init.c : Likewise.
	* loop-invariant.c : Likewise.
	* loop-iv.c : Likewise.
	* loop-unroll.c : Likewise.
	* lower-subreg.c : Likewise.
	* lra-assigns.c : Likewise.
	* lra-coalesce.c : Likewise.
	* lra-constraints.c : Likewise.
	* lra-eliminations.c : Likewise.
	* lra-lives.c : Likewise.
	* lra-remat.c : Likewise.
	* lra-spills.c : Likewise.
	* lra.c : Likewise.
	* lto-cgraph.c : Likewise.
	* lto-compress.c : Likewise.
	* lto-opts.c : Likewise.
	* lto-section-in.c : Likewise.
	* lto-section-out.c : Likewise.
	* lto-streamer-in.c : Likewise.
	* lto-streamer-out.c : Likewise.
	* lto-streamer.c : Likewise.
	* lto-streamer.h : Likewise.
	* mcf.c : Likewise.
	* mode-switching.c : Likewise.
	* modulo-sched.c : Likewise.
	* omega.c : Likewise.
	* omp-low.c : Likewise.
	* optabs.c : Likewise.
	* opts-global.c : Likewise.
	* opts.h : Likewise.
	* passes.c : Likewise.
	* plugin.c : Likewise.
	* postreload-gcse.c : Likewise.
	* postreload.c : Likewise.
	* predict.c : Likewise.
	* print-rtl.c : Likewise.
	* print-tree.c : Likewise.
	* profile.c : Likewise.
	* read-md.c : Likewise.
	* read-md.h : Likewise.
	* read-rtl.c : Likewise.
	* real.c : Likewise.
	* realmpfr.c : Likewise.
	* recog.c : Likewise.
	* ree.c : Likewise.
	* reg-stack.c : Likewise.
	* regcprop.c : Likewise.
	* reginfo.c : Likewise.
	* regrename.c : Likewise.
	* regstat.c : Likewise.
	* reload.c : Likewise.
	* reload1.c : Likewise.
	* reorg.c : Likewise.
	* resource.c : Likewise.
	* rtl-chkp.c : Likewise.
	* rtl.c : Likewise.
	* rtl.h : Likewise.
	* rtlanal.c : Likewise.
	* rtlhash.c : Likewise.
	* rtlhash.h : Likewise.
	* rtlhooks.c : Likewise.
	* sanopt.c : Likewise.
	* sched-deps.c : Likewise.
	* sched-ebb.c : Likewise.
	* sched-rgn.c : Likewise.
	* sched-vis.c : Likewise.
	* sdbout.c : Likewise.
	* sel-sched-dump.c : Likewise.
	* sel-sched-ir.c : Likewise.
	* sel-sched-ir.h : Likewise.
	* sel-sched.c : Likewise.
	* sese.c : Likewise.
	* shrink-wrap.c : Likewise.
	* shrink-wrap.h : Likewise.
	* simplify-rtx.c : Likewise.
	* stack-ptr-mod.c : Likewise.
	* statistics.c : Likewise.
	* stmt.c : Likewise.
	* stor-layout.c : Likewise.
	* store-motion.c : Likewise.
	* stringpool.c : Likewise.
	* symtab.c : Likewise.
	* target-globals.c : Likewise.
	* targhooks.c : Likewise.
	* tlink.c : Likewise.
	* toplev.c : Likewise.
	* tracer.c : Likewise.
	* trans-mem.c : Likewise.
	* tree-affine.c : Likewise.
	* tree-affine.h : Likewise.
	* tree-browser.c : Likewise.
	* tree-call-cdce.c : Likewise.
	* tree-cfg.c : Likewise.
	* tree-cfgcleanup.c : Likewise.
	* tree-chkp-opt.c : Likewise.
	* tree-chkp.c : Likewise.
	* tree-chrec.c : Likewise.
	* tree-complex.c : Likewise.
	* tree-data-ref.c : Likewise.
	* tree-dfa.c : Likewise.
	* tree-diagnostic.c : Likewise.
	* tree-dump.c : Likewise.
	* tree-eh.c : Likewise.
	* tree-eh.h : Likewise.
	* tree-emutls.c : Likewise.
	* tree-hasher.h : Likewise.
	* tree-if-conv.c : Likewise.
	* tree-inline.c : Likewise.
	* tree-inline.h : Likewise.
	* tree-into-ssa.c : Likewise.
	* tree-iterator.c : Likewise.
	* tree-loop-distribution.c : Likewise.
	* tree-nested.c : Likewise.
	* tree-nrv.c : Likewise.
	* tree-object-size.c : Likewise.
	* tree-outof-ssa.c : Likewise.
	* tree-parloops.c : Likewise.
	* tree-phinodes.c : Likewise.
	* tree-predcom.c : Likewise.
	* tree-pretty-print.c : Likewise.
	* tree-profile.c : Likewise.
	* tree-scalar-evolution.c : Likewise.
	* tree-sra.c : Likewise.
	* tree-ssa-address.c : Likewise.
	* tree-ssa-alias.c : Likewise.
	* tree-ssa-ccp.c : Likewise.
	* tree-ssa-coalesce.c : Likewise.
	* tree-ssa-copy.c : Likewise.
	* tree-ssa-copyrename.c : Likewise.
	* tree-ssa-dce.c : Likewise.
	* tree-ssa-dom.c : Likewise.
	* tree-ssa-dse.c : Likewise.
	* tree-ssa-forwprop.c : Likewise.
	* tree-ssa-ifcombine.c : Likewise.
	* tree-ssa-live.c : Likewise.
	* tree-ssa-loop-ch.c : Likewise.
	* tree-ssa-loop-im.c : Likewise.
	* tree-ssa-loop-ivcanon.c : Likewise.
	* tree-ssa-loop-ivopts.c : Likewise.
	* tree-ssa-loop-manip.c : Likewise.
	* tree-ssa-loop-niter.c : Likewise.
	* tree-ssa-loop-prefetch.c : Likewise.
	* tree-ssa-loop-unswitch.c : Likewise.
	* tree-ssa-loop.c : Likewise.
	* tree-ssa-math-opts.c : Likewise.
	* tree-ssa-operands.c : Likewise.
	* tree-ssa-phiopt.c : Likewise.
	* tree-ssa-phiprop.c : Likewise.
	* tree-ssa-pre.c : Likewise.
	* tree-ssa-propagate.c : Likewise.
	* tree-ssa-reassoc.c : Likewise.
	* tree-ssa-sccvn.c : Likewise.
	* tree-ssa-scopedtables.c : Likewise.
	* tree-ssa-sink.c : Likewise.
	* tree-ssa-strlen.c : Likewise.
	* tree-ssa-structalias.c : Likewise.
	* tree-ssa-tail-merge.c : Likewise.
	* tree-ssa-ter.c : Likewise.
	* tree-ssa-threadedge.c : Likewise.
	* tree-ssa-threadupdate.c : Likewise.
	* tree-ssa-uncprop.c : Likewise.
	* tree-ssa-uninit.c : Likewise.
	* tree-ssa.c : Likewise.
	* tree-ssanames.c : Likewise.
	* tree-stdarg.c : Likewise.
	* tree-streamer-in.c : Likewise.
	* tree-streamer-out.c : Likewise.
	* tree-streamer.c : Likewise.
	* tree-streamer.h : Likewise.
	* tree-switch-conversion.c : Likewise.
	* tree-tailcall.c : Likewise.
	* tree-vect-data-refs.c : Likewise.
	* tree-vect-generic.c : Likewise.
	* tree-vect-loop-manip.c : Likewise.
	* tree-vect-loop.c : Likewise.
	* tree-vect-patterns.c : Likewise.
	* tree-vect-slp.c : Likewise.
	* tree-vect-stmts.c : Likewise.
	* tree-vectorizer.c : Likewise.
	* tree-vectorizer.h : Likewise.
	* tree-vrp.c : Likewise.
	* tree.c : Likewise.
	* tsan.c : Likewise.
	* ubsan.c : Likewise.
	* valtrack.c : Likewise.
	* valtrack.h : Likewise.
	* value-prof.c : Likewise.
	* var-tracking.c : Likewise.
	* varasm.c : Likewise.
	* varpool.c : Likewise.
	* vec.c: Likewise.
	* vmsdbgout.c : Likewise.
	* vtable-verify.c : Likewise.
	* vtable-verify.h : Likewise.
	* web.c : Likewise.
	* wide-int.cc : Likewise.
	* xcoffout.c : Likewise.
	* config/aarch64/aarch64-builtins.c : Likewise.
	* config/aarch64/aarch64.c : Likewise.
	* config/aarch64/cortex-a57-fma-steering.c : Likewise.
	* config/alpha/alpha.c : Likewise.
	* config/arc/arc.c : Likewise.
	* config/arm/aarch-common.c : Likewise.
	* config/arm/arm-builtins.c : Likewise.
	* config/arm/arm-c.c : Likewise.
	* config/arm/arm.c : Likewise.
	* config/avr/avr-c.c : Likewise.
	* config/avr/avr-log.c : Likewise.
	* config/avr/avr.c : Likewise.
	* config/bfin/bfin.c : Likewise.
	* config/c6x/c6x.c : Likewise.
	* config/cr16/cr16.c : Likewise.
	* config/cris/cris.c : Likewise.
	* config/darwin-c.c : Likewise.
	* config/darwin.c : Likewise.
	* config/default-c.c : Likewise.
	* config/epiphany/epiphany.c : Likewise.
	* config/epiphany/mode-switch-use.c : Likewise.
	* config/epiphany/resolve-sw-modes.c : Likewise.
	* config/fr30/fr30.c : Likewise.
	* config/frv/frv.c : Likewise.
	* config/ft32/ft32.c : Likewise.
	* config/glibc-c.c : Likewise.
	* config/h8300/h8300.c : Likewise.
	* config/i386/i386-c.c : Likewise.
	* config/i386/i386.c : Likewise.
	* config/i386/msformat-c.c : Likewise.
	* config/i386/winnt-cxx.c : Likewise.
	* config/i386/winnt-stubs.c : Likewise.
	* config/i386/winnt.c : Likewise.
	* config/ia64/ia64-c.c : Likewise.
	* config/ia64/ia64.c : Likewise.
	* config/iq2000/iq2000.c : Likewise.
	* config/lm32/lm32.c : Likewise.
	* config/m32c/m32c-pragma.c : Likewise.
	* config/m32c/m32c.c : Likewise.
	* config/m32r/m32r.c : Likewise.
	* config/m68k/m68k.c : Likewise.
	* config/mcore/mcore.c : Likewise.
	* config/mep/mep-pragma.c : Likewise.
	* config/mep/mep.c : Likewise.
	* config/microblaze/microblaze-c.c : Likewise.
	* config/microblaze/microblaze.c : Likewise.
	* config/mips/mips.c : Likewise.
	* config/mmix/mmix.c : Likewise.
	* config/mn10300/mn10300.c : Likewise.
	* config/moxie/moxie.c : Likewise.
	* config/msp430/msp430-c.c : Likewise.
	* config/msp430/msp430.c : Likewise.
	* config/nds32/nds32-cost.c : Likewise.
	* config/nds32/nds32-fp-as-gp.c : Likewise.
	* config/nds32/nds32-intrinsic.c : Likewise.
	* config/nds32/nds32-isr.c : Likewise.
	* config/nds32/nds32-md-auxiliary.c : Likewise.
	* config/nds32/nds32-memory-manipulation.c : Likewise.
	* config/nds32/nds32-pipelines-auxiliary.c : Likewise.
	* config/nds32/nds32-predicates.c : Likewise.
	* config/nds32/nds32.c : Likewise.
	* config/nios2/nios2.c : Likewise.
	* config/nvptx/nvptx.c : Likewise.
	* config/pa/pa.c : Likewise.
	* config/pdp11/pdp11.c : Likewise.
	* config/rl78/rl78-c.c : Likewise.
	* config/rl78/rl78.c : Likewise.
	* config/rs6000/rs6000-c.c : Likewise.
	* config/rs6000/rs6000.c : Likewise.
	* config/rx/rx.c : Likewise.
	* config/s390/s390-c.c : Likewise.
	* config/s390/s390.c : Likewise.
	* config/sh/sh-c.c : Likewise.
	* config/sh/sh-mem.cc : Likewise.
	* config/sh/sh.c : Likewise.
	* config/sh/sh_optimize_sett_clrt.cc : Likewise.
	* config/sh/sh_treg_combine.cc : Likewise.
	* config/sol2-c.c : Likewise.
	* config/sol2-cxx.c : Likewise.
	* config/sol2-stubs.c : Likewise.
	* config/sol2.c : Likewise.
	* config/sparc/sparc-c.c : Likewise.
	* config/sparc/sparc.c : Likewise.
	* config/spu/spu-c.c : Likewise.
	* config/spu/spu.c : Likewise.
	* config/stormy16/stormy16.c : Likewise.
	* config/tilegx/mul-tables.c : Likewise.
	* config/tilegx/tilegx-c.c : Likewise.
	* config/tilegx/tilegx.c : Likewise.
	* config/tilepro/mul-tables.c : Likewise.
	* config/tilepro/tilepro-c.c : Likewise.
	* config/tilepro/tilepro.c : Likewise.
	* config/v850/v850-c.c : Likewise.
	* config/v850/v850.c : Likewise.
	* config/vax/vax.c : Likewise.
	* config/visium/visium.c : Likewise.
	* config/vms/vms-c.c : Likewise.
	* config/vms/vms.c : Likewise.
	* config/vxworks.c : Likewise.
	* config/winnt-c.c : Likewise.
	* config/xtensa/xtensa.c : Likewise.

ada
2015-06-08  Andrew MacLeod  <amacleod@redhat.com>

	* gcc-interface/cuintp.c : Adjust include files.
	* gcc-interface/decl.c : Likewise.
	* gcc-interface/misc.c : Likewise.
	* gcc-interface/targtyps.c : Likewise.
	* gcc-interface/trans.c : Likewise.
	* gcc-interface/utils.c : Likewise.
	* gcc-interface/utils2.c : Likewise.
	
c
2015-06-08  Andrew MacLeod  <amacleod@redhat.com>

	* c-array-notation.c : Adjust include files.
	* c-aux-info.c : Likewise.
	* c-convert.c : Likewise.
	* c-decl.c : Likewise.
	* c-errors.c : Likewise.
	* c-lang.c : Likewise.
	* c-lang.h : Likewise.
	* c-objc-common.c : Likewise.
	* c-parser.c : Likewise.
	* c-typeck.c : Likewise.

cfamily
2015-06-08  Andrew MacLeod  <amacleod@redhat.com>

	* array-notation-common.c : Adjust include files.
	* c-ada-spec.c : Likewise.
	* c-cilkplus.c : Likewise.
	* c-common.c : Likewise.
	* c-common.h : Likewise.
	* c-cppbuiltin.c : Likewise.
	* c-dump.c : Likewise.
	* c-format.c : Likewise.
	* c-gimplify.c : Likewise.
	* c-indentation.c : Likewise.
	* c-lex.c : Likewise.
	* c-omp.c : Likewise.
	* c-opts.c : Likewise.
	* c-pch.c : Likewise.
	* c-ppoutput.c : Likewise.
	* c-pragma.c : Likewise.
	* c-pretty-print.c : Likewise.
	* c-semantics.c : Likewise.
	* c-ubsan.c : Likewise.
	* cilk.c : Likewise.
	* stub-objc.c : Likewise.

cp
2015-06-08  Andrew MacLeod  <amacleod@redhat.com>

	* call.c : Adjust include files.
	* class.c : Likewise.
	* constexpr.c : Likewise.
	* cp-array-notation.c : Likewise.
	* cp-cilkplus.c : Likewise.
	* cp-gimplify.c : Likewise.
	* cp-lang.c : Likewise.
	* cp-objcp-common.c : Likewise.
	* cp-tree.h : Likewise.
	* cp-ubsan.c : Likewise.
	* cvt.c : Likewise.
	* decl.c : Likewise.
	* decl2.c : Likewise.
	* dump.c : Likewise.
	* error.c : Likewise.
	* except.c : Likewise.
	* expr.c : Likewise.
	* friend.c : Likewise.
	* init.c : Likewise.
	* lambda.c : Likewise.
	* lex.c : Likewise.
	* mangle.c : Likewise.
	* method.c : Likewise.
	* name-lookup.c : Likewise.
	* optimize.c : Likewise.
	* parser.c : Likewise.
	* pt.c : Likewise.
	* ptree.c : Likewise.
	* repo.c : Likewise.
	* rtti.c : Likewise.
	* search.c : Likewise.
	* semantics.c : Likewise.
	* tree.c : Likewise.
	* typeck.c : Likewise.
	* typeck2.c : Likewise.
	* vtable-class-hierarchy.c : Likewise.

fortran
2015-06-08  Andrew MacLeod  <amacleod@redhat.com>

	* convert.c : Adjust include files.
	* cpp.c : Likewise.
	* decl.c : Likewise.
	* f95-lang.c : Likewise.
	* gfortran.h : Likewise.
	* iresolve.c : Likewise.
	* match.c : Likewise.
	* module.c : Likewise.
	* openmp.c : Likewise.
	* options.c : Likewise.
	* target-memory.c : Likewise.
	* trans-array.c : Likewise.
	* trans-common.c : Likewise.
	* trans-const.c : Likewise.
	* trans-decl.c : Likewise.
	* trans-expr.c : Likewise.
	* trans-intrinsic.c : Likewise.
	* trans-io.c : Likewise.
	* trans-openmp.c : Likewise.
	* trans-stmt.c : Likewise.
	* trans-types.c : Likewise.
	* trans.c : Likewise.


go
2015-06-08  Andrew MacLeod  <amacleod@redhat.com>

	* go-backend.c : Adjust include files.
	* go-gcc.cc : Likewise.
	* go-lang.c : Likewise.

java
2015-06-08  Andrew MacLeod  <amacleod@redhat.com>

	* boehm.c : Adjust include files.
	* builtins.c : Likewise.
	* class.c : Likewise.
	* constants.c : Likewise.
	* decl.c : Likewise.
	* except.c : Likewise.
	* expr.c : Likewise.
	* java-gimplify.c : Likewise.
	* java-tree.h : Likewise.
	* jcf-dump.c : Likewise.
	* jcf-io.c : Likewise.
	* jcf-parse.c : Likewise.
	* jcf-reader.c : Likewise.
	* jvgenmain.c : Likewise.
	* lang.c : Likewise.
	* mangle.c : Likewise.
	* mangle_name.c : Likewise.
	* resource.c : Likewise.
	* typeck.c : Likewise.
	* verify-glue.c : Likewise.
	* verify-impl.c : Likewise.

jit
2015-06-08  Andrew MacLeod  <amacleod@redhat.com>

	* dummy-frontend.c : Adjust include files.
	* jit-common.h : Likewise.
	* jit-playback.c : Likewise.

lto
2015-06-08  Andrew MacLeod  <amacleod@redhat.com>

	* lto-lang.c : Adjust include files.
	* lto-object.c : Likewise.
	* lto-partition.c : Likewise.
	* lto-partition.h : Likewise.
	* lto-symtab.c : Likewise.
	* lto.c : Likewise.
	* lto.h : Likewise.

objc
2015-06-08  Andrew MacLeod  <amacleod@redhat.com>

	* objc-act.c : Adjust include files.
	* objc-encoding.c : Likewise.
	* objc-gnu-runtime-abi-01.c : Likewise.
	* objc-lang.c : Likewise.
	* objc-map.c : Likewise.
	* objc-next-runtime-abi-01.c : Likewise.
	* objc-next-runtime-abi-02.c : Likewise.
	* objc-runtime-shared-support.c : Likewise.

objcp
2015-06-08  Andrew MacLeod  <amacleod@redhat.com>

	* objcp-decl.c : Adjust include files.
	* objcp-lang.c : Likewise.

From-SVN: r224250
2015-06-08 21:06:50 +00:00
Manuel López-Ibáñez fea70c9963 re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
gcc/fortran/ChangeLog:

2015-05-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR fortran/44054
	* gfortran.h (struct gfc_error_buf): Rename as
	gfc_error_buffer. Move closer to push, pop and free
	methods. Reimplement using an output_buffer.
	* error.c (errors, warnings, warning_buffer, cur_error_buffer):
	Delete everywhere in this file.
	(error_char): Delete all contents.
	(gfc_increment_error_count): Delete.
	(gfc_error_now): Update comment. Set error_buffer.flag.
	(gfc_warning_check): Do not handle warning_buffer.
	(gfc_error_1): Delete.
	(gfc_error_now_1): Delete.
	(gfc_error_check): Simplify.
	(gfc_move_error_buffer_from_to): Renamed from
	gfc_move_output_buffer_from_to.
	(gfc_push_error): Handle only gfc_error_buffer.
	(gfc_pop_error): Likewise.
	(gfc_free_error): Likewise.
	(gfc_get_errors): Remove warnings and errors.
	(gfc_diagnostics_init): Use static error_buffer.
	(gfc_error_1,gfc_error_now_1): Delete declarations.
	* symbol.c, decl.c, trans-common.c, data.c, expr.c, expr.c,
	frontend-passes.c, resolve.c, match.c, parse.c: Replace
	gfc_error_1 with gfc_error and gfc_error_now_1 with gfc_error_1
	everywhere.
	* f95-lang.c (gfc_be_parse_file): Do not update errorcount and
	warningcount here.
	* primary.c (match_complex_constant): Replace gfc_error_buf and
	output_buffer with gfc_error_buffer.

From-SVN: r223614
2015-05-23 23:02:52 +00:00
Manuel López-Ibáñez 2a2703a2bd re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
gcc/fortran/ChangeLog:

2015-05-16  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR fortran/44054

	Replace all calls to gfc_notify_std_1 with gfc_notify_std and
	gfc_warning_1 with gfc_warning.
	* decl.c (gfc_verify_c_interop_param): Here.
	* resolve.c (resolve_branch): Here.
	(resolve_fl_derived): Here.
	* dependency.c (gfc_check_argument_var_dependency):
	* scanner.c (preprocessor_line): Use gfc_warning_now_at. Fix line
	counter and locations before and after warning.
	* gfortran.h (gfc_warning_1, gfc_warning_now_1, gfc_notify_std_1):
	Delete.
	(gfc_warning_now_at): Declare.
	* error.c (gfc_warning_1): Delete.
	(gfc_notify_std_1): Delete.
	(gfc_warning_now_1): Delete.
	(gfc_format_decoder): Handle two locations.
	(gfc_diagnostic_build_prefix): Rename as
	gfc_diagnostic_build_kind_prefix.
	(gfc_diagnostic_build_locus_prefix): Take an expanded_location
	instead of diagnostic_info.
	(gfc_diagnostic_build_locus_prefix): Add overload that takes two
	expanded_location.
	(gfc_diagnostic_starter): Handle two locations.
	(gfc_warning_now_at): New.
	(gfc_diagnostics_init): Initialize caret_chars array.
	(gfc_diagnostics_finish): Reset caret_chars array to default.

gcc/cp/ChangeLog:

2015-05-16  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR fortran/44054
	* error.c (cp_diagnostic_starter): Use diagnostic_location
	function.
	(cp_print_error_function): Likewise.
	(cp_printer): Replace locus pointer with accessor function.

gcc/c/ChangeLog:

2015-05-16  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR fortran/44054
	* c-objc-common.c (c_tree_printer): Replace locus pointer with
	accessor function.

gcc/ChangeLog:

2015-05-16  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR fortran/44054
	* tree-pretty-print.c (percent_K_format): Replace locus pointer
	with accessor function.
	* tree-diagnostic.c (diagnostic_report_current_function): Use
	diagnostic_location function.
	(maybe_unwind_expanded_macro_loc): Likewise.
	(virt_loc_aware_diagnostic_finalizer): Likewise.
	(default_tree_printer): Replace locus pointer with accessor function.
	* diagnostic.c (diagnostic_initialize): Initialize caret_chars array.
	(diagnostic_set_info_translated): Initialize second location.
	(diagnostic_build_prefix): Use CARET_LINE_MARGIN.
	(diagnostic_show_locus): Handle two locations. Call
	diagnostic_print_caret_line.
	(diagnostic_print_caret_line): New.
	(default_diagnostic_starter): Use diagnostic_location function.
	(diagnostic_report_diagnostic): Use diagnostic_location function.
	(verbatim): Do not set text.locus.
	* diagnostic.h (struct diagnostic_info): Remove location field.
	(struct diagnostic_context): Make caret_chars an array of two.
	(diagnostic_location): New inline.
	(diagnostic_expand_location): Handle two locations.
	(diagnostic_same_line): New inline.
	(diagnostic_print_caret_line): Declare.
	(CARET_LINE_MARGIN): New constant.
	* pretty-print.c (pp_printf): Do not set text.locus.
	(pp_verbatim): Do not set text.locus.
	* pretty-print.h (MAX_LOCATIONS_PER_MESSAGE): New constant.
	(struct text_info): Replace locus pointer with locations
	array. Add accessor functions.

gcc/testsuite/ChangeLog:

2015-05-16  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR fortran/44054
	* lib/gfortran-dg.exp: Update regex to handle two locations for
	the same diagnostic without caret.
	* gfortran.dg/badline.f: Test also that line numbers are correct
	before and after "left but not entered" warning.

From-SVN: r223237
2015-05-16 12:31:00 +00:00
Thomas Koenig 9b7df66f80 re PR fortran/66041 (Matmul ICE)
2015-05-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/66041
	PR fortran/37131
	* gfortran.h (gfc_array_spec):  Add field resolved.
	* array.c (gfc_resolve_array_spec):  Resolve array spec
	only once.

From-SVN: r223031
2015-05-12 06:37:43 +00:00
Thomas Koenig f1abbf6901 re PR fortran/37131 (inline matmul for small matrix sizes)
2015-05-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/37131
	* gfortran.h (gfc_isym_id):  Add GFC_ISYM_FE_RUNTIME_ERROR.
	(gfc_intrinsic_sym):  Add vararg.
	* intrinsic.h (gfc_check_fe_runtime_error):  Add prototype.
	(gfc_resolve_re_runtime_error):  Likewise.
	Add prototype for gfc_is_reallocatable_lhs.
	* trans-array.h (gfc_is_reallocatable_lhs):  Remove prototype.
	* check.c (gfc_check_fe_runtime_error):  New function.
	* intrinsic.c (add_sym_1p):  New function.
	(make_vararg):  New function.
	(add_subroutines):  Add fe_runtime_error.
	(gfc_intrinsic_sub_interface): Skip sorting for variable number
	of arguments.
	* iresolve.c (gfc_resolve_fe_runtime_error):  New function.
	* lang.opt (inline-matmul-limit):  New option.
	(gfc_post_options): If no inline matmul limit has been set and
	BLAS is called externally, use the BLAS limit.
	* frontend-passes.c:  Include intrinsic.h.
	(var_num):  New global counter for naming temporary variablbles.
	(matrix_case):  Enum for differentiating the different matmul
	cases.
	(realloc_string_callback):  Add "trim" to the variable name.
	(create_var): Add optional argument vname as part of the name.
	Use var_num. Set dimension of result correctly. Split off block
	creation into
	(insert_block): New function.
	(cfe_expr_0): Use "fcn" as part of temporary variable name.
	(optimize_namesapce): Also set gfc_current_ns. Call
	inline_matmul_assign.
	(combine_array_constructor):  Use "constr" as part of
	temporary name.
	(get_array_inq_function):  New function.
	(build_logical_expr):  New function.
	(get_operand):  new function.
	(inline_limit_check):  New function.
	(runtime_error_ne):  New function.
	(matmul_lhs_realloc):  New function.
	(is_functino_or_op):  New function.
	(has_function_or_op):  New function.
	(freeze_expr):  New function.
	(freeze_references):  New function.
	(convert_to_index_kind):  New function.
	(create_do_loop):  New function.
	(get_size_m1):  New function.
	(scalarized_expr):  New function.
	(inline_matmul_assign):  New function.
	* simplify.c (simplify_bound):  Simplify the case of the
	lower bound of an assumed-shape argument.

2015-05-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/37131
	* gfortran.dg/dependency_26.f90: Add option to suppress inlining
	matmul.
	* gfortran.dg/function_optimize_1.f90:  Likewise.
	* gfortran.dg/function_optimize_2.f90:  Likewise.
	* gfortran.dg/function_optimize_5.f90:  Likewise.
	* gfortran.dg/function_optimize_7.f90:  Likewise.
	* gfortran.dg/inline_matmul_1.f90:  New test.
	* gfortran.dg/inline_matmul_2.f90:  New test.
	* gfortran.dg/inline_matmul_3.f90:  New test.
	* gfortran.dg/inline_matmul_4.f90:  New test.
	* gfortran.dg/inline_matmul_5.f90:  New test.
	* gfortran.dg/inline_matmul_6.f90:  New test.

From-SVN: r222864
2015-05-06 20:23:48 +00:00
Andre Vehreschild f3b0bb7a56 PF fortran/60322
gcc/testsuite/ChangeLog:

2015-04-23  Andre Vehreschild  <vehre@gmx.de>

	PF fortran/60322
	* gfortran.dg/class_allocate_19.f03: New test.
	* gfortran.dg/class_array_20.f03: New test.
	* gfortran.dg/class_array_21.f03: New test.
	* gfortran.dg/finalize_10.f90: Corrected scan-trees.
	* gfortran.dg/finalize_15.f90: Fixing comparision to model
	initialization correctly.
	* gfortran.dg/finalize_29.f08: New test.


gcc/fortran/ChangeLog:

2015-04-23  Andre Vehreschild  <vehre@gmx.de>

	PR fortran/60322
	* expr.c (gfc_lval_expr_from_sym): Code to select the regular
	or class array added.
	* gfortran.h: Add IS_CLASS_ARRAY macro.
	* trans-array.c (gfc_add_loop_ss_code): Treat class objects
	to be referenced always.
	(build_class_array_ref): Adapt retrieval of array descriptor.
	(build_array_ref): Likewise.
	(gfc_conv_array_ref): Hand the vptr or the descriptor to 
	build_array_ref depending whether the sym is class or not.
	(gfc_trans_array_cobounds):  Select correct gfc_array_spec for
	regular and class arrays.
	(gfc_trans_array_bounds): Likewise.
	(gfc_trans_dummy_array_bias): Likewise. 
	(gfc_get_dataptr_offset): Correcting call of build_array_ref.
	(gfc_conv_expr_descriptor): Set the array's offset to -1 when
	lbound in inner most dim is 1 and symbol non-pointer/assoc.
	* trans-decl.c (gfc_build_qualified_array): Select correct
	gfc_array_spec for regular and class arrays.
	(gfc_build_dummy_array_decl): Likewise.
	(gfc_get_symbol_decl): Get a dummy array for class arrays.
	(gfc_trans_deferred_vars): Tell conv_expr that the descriptor
	is desired.
	* trans-expr.c (gfc_class_vptr_get): Get the class descriptor
	from the correct location for class arrays.
	(gfc_class_len_get): Likewise.
	(gfc_conv_intrinsic_to_class): Add handling of _len component.
	(gfc_conv_class_to_class):  Prevent access to unset array data
	when the array is an optional argument. Add handling of _len
	component.
	(gfc_copy_class_to_class): Check that _def_init is non-NULL
	when used in _vptr->copy()
	(gfc_trans_class_init_assign): Ensure that the rank of
	_def_init is zero.
	(gfc_conv_component_ref): Get the _vptr along with _data refs.
	(gfc_conv_variable): Make sure the temp array descriptor is
	returned for class arrays, too, and that class arrays are
	dereferenced correctly.
	(gfc_conv_procedure_call): For polymorphic type initialization
	the initializer has to be a pointer to _def_init stored in a
	dummy variable, which then needs to be used by value.
	* trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Use the
	temporary array descriptor for class arrays, too.
	(gfc_conv_intrinsic_storage_size): Likewise.
	(gfc_conv_intrinsic_loc): Add ref to _data for BT_CLASS
	expressions.
	* trans-stmt.c (trans_associate_var): Use a temporary array for
	the associate variable of class arrays, too, making the array
	one-based (lbound == 1).
	* trans-types.c (gfc_is_nodesc_array): Use the correct
	array data.
	* trans.c (gfc_build_array_ref): Use the dummy array descriptor
	when present.
	* trans.h: Add class_vptr to gfc_se for storing a class ref's
	vptr.

From-SVN: r222361
2015-04-23 13:32:00 +02:00
Mikael Morin 44c57c2f90 re PR fortran/56674 (ICE in check_sym_interfaces)
PR fortran/56674
	PR fortran/58813
	PR fortran/59016
	PR fortran/59024
fortran/
	* symbol.c (save_symbol_data, gfc_save_symbol_data): Rename the
	former to the latter and make it non-static.  Update callers.
	* gfortran.h (gfc_save_symbol_data): New prototype.
	* decl.c (gfc_match_decl_type_spec): Call 'gfc_save_symbol_data'
	before modifying symbols 'sym' and 'dt_sym'.
testsuite/
	* gfortran.dg/used_types_27.f90: New.

From-SVN: r221972
2015-04-10 11:29:53 +00:00