Commit Graph

4736 Commits

Author SHA1 Message Date
Michael Matz fe37c7afd1 tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount.
* tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount.
	(SET_TYPE_ALIGN, SET_DECL_ALIGN): New.
	* tree-core.h (tree_type_common.align): Use bit-field.
	(tree_type_common.spare): New.
	(tree_decl_common.off_align): Make smaller.
	(tree_decl_common.align): Use bit-field.

	* expr.c (expand_expr_addr_expr_1): Use SET_TYPE_ALIGN.
	* omp-low.c (install_var_field): Use SET_DECL_ALIGN.
	(scan_sharing_clauses): Ditto.
	(finish_taskreg_scan): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
	(omp_finish_file): Ditto.
	* stor-layout.c (do_type_align): Use SET_DECL_ALIGN.
	(layout_decl): Ditto.
	(relayout_decl): Ditto.
	(finalize_record_size): Use SET_TYPE_ALIGN.
	(finalize_type_size): Ditto.
	(finish_builtin_struct): Ditto.
	(layout_type): Ditto.
	(initialize_sizetypes): Ditto.
	* targhooks.c (std_gimplify_va_arg_expr): Use SET_TYPE_ALIGN.
	* tree-nested.c (insert_field_into_struct): Use SET_TYPE_ALIGN.
	(lookup_field_for_decl): Use SET_DECL_ALIGN.
	(get_chain_field): Ditto.
	(get_trampoline_type): Ditto.
	(get_nl_goto_field): Ditto.
	* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use
	SET_DECL_ALIGN.
	(unpack_ts_type_common_value_fields): Use SET_TYPE_ALIGN.
	* gimple-expr.c (copy_var_decl): Use SET_DECL_ALIGN.
	* tree.c (make_node_stat): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
	(build_qualified_type): Use SET_TYPE_ALIGN.
	(build_aligned_type, build_range_type_1): Ditto.
	(build_atomic_base): Ditto.
	(build_common_tree_nodes): Ditto.
	* cfgexpand.c (align_local_variable): Use SET_DECL_ALIGN.
	(expand_one_stack_var_at): Ditto.
	* coverage.c (build_var): Use SET_DECL_ALIGN.
	* except.c (init_eh): Ditto.
	* function.c (assign_parm_setup_block): Ditto.
	* symtab.c (increase_alignment_1): Ditto.
	* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Ditto.
	* tree-vect-stmts.c (ensure_base_align): Ditto.
	* varasm.c (align_variable): Ditto.
	(assemble_variable): Ditto.
	(build_constant_desc): Ditto.
	(output_constant_def_contents): Ditto.

	* config/arm/arm.c (arm_relayout_function): Use SET_DECL_ALIGN.
	* config/avr/avr.c (avr_adjust_type_node): Use SET_TYPE_ALIGN.
	* config/mips/mips.c (mips_std_gimplify_va_arg_expr): Ditto.
	* config/msp430/msp430.c (msp430_gimplify_va_arg_expr): Ditto.
	* config/spu/spu.c (spu_build_builtin_va_list): Use SET_DECL_ALIGN.

ada/
	* gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN.
	(gnat_to_gnu_field): Ditto.
	(components_to_record): Ditto.
	(create_variant_part_from): Ditto.
	(copy_and_substitute_in_size): Ditto.
	(substitute_in_type): Ditto.
	* gcc-interface/utils.c (make_aligning_type): Use SET_TYPE_ALIGN.
	(make_packable_type): Ditto.
	(maybe_pad_type): Ditto.
	(finish_fat_pointer_type): Ditto.
	(finish_record_type): Ditto and use SET_DECL_ALIGN.
	(rest_of_record_type_compilation): Use SET_TYPE_ALIGN.
	(create_field_decl): Use SET_DECL_ALIGN.

c-family/
	* c-common.c (handle_aligned_attribute): Use SET_TYPE_ALIGN
	and SET_DECL_ALIGN.

c/
	* c-decl.c (merge_decls): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
	(grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN.

cp/
	* class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
	(layout_class_type): Ditto.
	(build_base_field): Use SET_DECL_ALIGN.
	(fixup_attribute_variants): Use SET_TYPE_ALIGN.
	* decl.c (duplicate_decls): Use SET_DECL_ALIGN.
	(record_unknown_type): Use SET_TYPE_ALIGN.
	(cxx_init_decl_processing): Ditto.
	(copy_type_enum): Ditto.
	(grokfndecl): Use SET_DECL_ALIGN.
	(copy_type_enum): Use SET_TYPE_ALIGN.
	* pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
	(tsubst): Ditto.
	* tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
	* lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
	* method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
	* rtti.c (emit_tinfo_decl): Ditto.

fortran/
	* trans-io.c (gfc_build_io_library_fndecls): Use SET_TYPE_ALIGN.
	* trans-common.c (build_common_decl): Use SET_DECL_ALIGN.
	* trans-types.c (gfc_add_field_to_struct): Use SET_DECL_ALIGN.

go/
	* go-gcc.cc (Gcc_backend::implicit_variable): Use SET_DECL_ALIGN.

java/
	* class.c (add_method_1): Use SET_DECL_ALIGN.
	(make_class_data): Ditto.
	(emit_register_classes_in_jcr_section): Ditto.
	* typeck.c (build_java_array_type): Ditto.

objc/
	* objc-act.c (objc_build_struct): Use SET_DECL_ALIGN.

libcc1/
	* plugin.cc (plugin_finish_record_or_union): Use SET_TYPE_ALIGN.

From-SVN: r235172
2016-04-18 20:36:27 +00:00
Dominique d'Humieres 5267cfcc82 re PR fortran/67039 (Documentation of pseudorandom number intrinsics is incorrect)
2016-04-13  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/67039
	* intrinsic.texi: Correct the documentation of pseudorandom
	number intrinsics.

From-SVN: r234946
2016-04-13 17:04:57 +02:00
Dominique d'Humieres 042c836476 re PR fortran/58000 (Accept OPEN( ... NAME=) with -std=legacy)
2016-04-13  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/58000
	* gfortran.texi: Document OPEN( ... NAME=) as not implemented
	in GNU Fortran

From-SVN: r234936
2016-04-13 15:17:45 +02:00
Jerry DeLisle a5edb32e6b re PR fortran/68566 (ICE on using unusable array in reshape (double free or corruption))
2016-04-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/68566
	* array.c (match_array_element_spec): Add check for non-integer.
	* simplify.c (gfc_simplify_reshape): If source shape is NULL return.

	PR fortran/68566
	* gfortran.dg/pr36192.f90: Update test.
	* gfortran.dg/pr36192_1.f90: Update test.
	* gfortran.dg/real_dimension_1.f: Update test.
	* gfortran.dg/parameter_array_init_7.f90: New test.

From-SVN: r234864
2016-04-09 19:09:02 +00:00
Patrick Palka 6b37bdaff1 Fix new -Wparentheses warnings encountered during bootstrap
gcc/ChangeLog:

	PR c/70436
	* gimplify.c (gimplify_omp_ordered): Add explicit braces to
	resolve a future -Wparentheses warning.
	* omp-low.c (scan_sharing_clauses): Likewise.
	* tree-parloops.c (eliminate_local_variables): Likewise.

gcc/cp/ChangeLog:

	PR c/70436
	* cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
	potentially generating a future -Wparentheses warning in its
	callers.

gcc/fortran/ChangeLog:

	PR c/70436
	* openmp.c (gfc_find_omp_udr): Add explicit braces to resolve a
	future -Wparentheses warning.

gcc/testsuite/ChangeLog:

	PR c/70436
	* g++.dg/plugin/pragma_plugin.c (handle_pragma_sayhello): Add
	explicit braces to resolve a future -Wparentheses warning.

From-SVN: r234801
2016-04-06 23:07:21 +00:00
Andre Vehreschild 7a85da896a re PR fortran/67538 (ICE with invalid source allocation)
gcc/fortran/ChangeLog:

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

	PR fortran/67538
	* resolve.c (resolve_allocate_expr): Emit error message when no
	array spec and no array valued source= expression is given in an
	F2008 allocate() for an array to allocate.

gcc/testsuite/ChangeLog:

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

	PR fortran/67538
	* gfortran.dg/allocate_with_source_19.f08: New test.

From-SVN: r234714
2016-04-04 12:32:32 +02:00
Andre Vehreschild de517e644a re PR fortran/65795 (Segfault (invalid write) for ALLOCATE statement involving COARRAYS)
gcc/fortran/ChangeLog:

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

	PR fortran/65795
	* trans-array.c (gfc_array_allocate): When the array is a coarray,
	do not nullyfing its allocatable components in array_allocate, because
	the nullify missed the array ref and nullifies the wrong component.
	Cosmetics.

gcc/testsuite/ChangeLog:

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

	PR fortran/65795
	* gfortran.dg/coarray_allocate_6.f08: New test.

From-SVN: r234710
2016-04-04 11:32:28 +02:00
Andre Vehreschild 728557fda2 re PR fortran/70397 (ice while allocating ultimate polymorphic)
gcc/fortran/ChangeLog:

2016-03-29  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/70397
	* trans-expr.c (gfc_class_len_or_zero_get): Add function to return a
	constant zero tree, when the class to get the _len component from is
	not unlimited polymorphic.
	(gfc_copy_class_to_class): Use the new function.
	* trans.h: Added interface of new function gfc_class_len_or_zero_get.

gcc/testsuite/ChangeLog:

2016-03-29  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/70397
	* gfortran.dg/unlimited_polymorphic_25.f90: New test.
	* gfortran.dg/unlimited_polymorphic_26.f90: New test.

From-SVN: r234528
2016-03-29 18:54:24 +02:00
Alessandro Fanfarillo 0daa7ed944 STOP managed by external library when coarrays are used
From-SVN: r234502
2016-03-28 03:05:01 -06:00
Jerry DeLisle 5803aa7c28 re PR fortran/69043 (Trying to include a directory causes an infinite loop)
2016-03-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/69043
	* scanner.c (load_file): Update to use S_ISREG macro.

From-SVN: r234352
2016-03-19 20:28:38 +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
Jerry DeLisle 44e66a7709 re PR fortran/69043 (Trying to include a directory causes an infinite loop)
2016-03-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Jim MacArthur  <jim.macarthur@codethink.co.uk>

	PR fortran/69043
	* scanner.c (load_file): Check that included file is regular.

	PR fortran/69043
	* gfortran.dg/include_9.f90: New test.

Co-Authored-By: Jim MacArthur <jim.macarthur@codethink.co.uk>

From-SVN: r234169
2016-03-13 17:38:07 +00:00
Jerry DeLisle a4c54bf2a7 re PR fortran/69520 (Implement reversal of -fcheck options)
2016-03-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Harold Anlauf  <anlauf@gmx.de>

	PR fortran/69520
	* invoke.texi: Explain use of the 'no-' construct within the
	-fcheck= option.
	* options.c (gfc_handle_runtime_check_option): Enable use of
	'no-' prefix for the various options with -fcheck= to allow
	negating previously enabled check options.

Co-Authored-By: Harald Anlauf <anlauf@gmx.de>

From-SVN: r234167
2016-03-13 00:19:08 +00:00
Paul Thomas 70112e2a64 re PR fortran/70031 (Error in recursive module subroutine declaration if declared as "module recursive")
2016-03-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/70031
	* decl.c (gfc_match_prefix): Treat the 'module' prefix in the
	same way as the others, rather than fixing it to come last.
	(gfc_match_function_decl, gfc_match_subroutine): After errors
	in 'copy_prefix', emit them immediately in the case of module
	procedures to prevent a later ICE.

	PR fortran/69524
	* decl.c (gfc_match_submod_proc): Permit 'module procedure'
	declarations within the contains section of modules as well as
	submodules.
	* resolve.c (resolve_fl_procedure): Likewise.
	*trans-decl.c (build_function_decl): Change the gcc_assert to
	allow all forms of module procedure declarations within module
	contains sections.

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

	PR fortran/70031
	* gfortran.dg/submodule_14.f08: New test

	PR fortran/69524
	* gfortran.dg/submodule_15.f08: New test

From-SVN: r234161
2016-03-12 13:59:10 +00:00
Thomas Koenig 7b201a88a3 re PR fortran/68147 (Potential incorrect code generation for string self-assignment)
2016-02-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/68147
	PR fortran/47674
	* frontend-passes.c (realloc_string_callback): Don't set
	walk_subtrees.

2016-02-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/68147
	PR fortran/47674
	* gfortran.dg/realloc_on_assign_26.f90:  New test case.

From-SVN: r233797
2016-02-28 22:27:55 +00:00
Thomas Koenig 3070e826ba dump-parse-tree.c (show_code_node): Print association list of a block if present.
2016-02-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* dump-parse-tree.c (show_code_node):  Print association
	list of a block if present.  Handle EXEC_END_BLOCK.

From-SVN: r233796
2016-02-28 22:24:27 +00:00
Harald Anlauf b2fd537394 re PR fortran/56007 (Remarkably bad error message with DO array=1,2)
2016-02-28  Harald Anlauf <anlauf@gmx.de>
	    Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/56007
	* match.c (gfc_match_iterator): Add diagnostic for array variable
	as do loop index.

	* gfortran.dg/coarray_8.f90: Adjust error message.
	* gfortran.dg/pr56007.f90: New test.
	* gfortran.dg/pr56007.f: New test.

Co-Authored-By: Jerry DeLisle <jvdelisle@gcc.gnu.org>

From-SVN: r233795
2016-02-28 19:07:42 +00:00
Jerry DeLisle 5fb67f8b59 2016-02-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Fix ChangeLogs

From-SVN: r233783
2016-02-27 22:04:08 +00:00
Jerry DeLisle dd1291e050 re PR fortran/69910 (ICE with NEWUNIT)
2016-02-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/69110
	* io.c (gfc_match_open): Check that open status is an expression
	constant before comparing string to 'scratch' with NEWUNIT.

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

Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>

From-SVN: r233782
2016-02-27 19:07:13 +00:00
Alessandro Fanfarillo 83aa73e7f8 Right size for events
From-SVN: r233779
2016-02-27 04:57:16 -07:00
Jerry DeLisle 7cc5ec657e re PR fortran/61156 (Internal compiler error for Fortran files when specifying a file instead of an include directory with -I)
2016-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/61156
	* scanner.c (add_path_to_list): If include path is not a directory,
	issue a fatal error.

	PR fortran/61156
	* gfortran.dg/include_6.f90: Update test.

From-SVN: r233649
2016-02-23 22:53:31 +00:00
Andre Vehreschild e457a6fc36 re PR fortran/67451 ([F08] ICE with sourced allocation from coarray.)
gcc/testsuite/ChangeLog:

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

	PR fortran/67451
	* gfortran.dg/coarray_allocate_5.f08: New test.


gcc/fortran/ChangeLog:

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

	PR fortran/67451
	* trans-array.c (gfc_array_allocate): Take the attributes from the
	expression to allocate and not from the source=-expression.

From-SVN: r233625
2016-02-23 11:29:26 +01:00
Paul Thomas ce1ff48e57 re PR fortran/69423 (Invalid optimization with deferred-length character)
2016-02-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69423
	* trans-decl.c (create_function_arglist): Deferred character
	length functions, with and without declared results, address
	the passed reference type as '.result' and the local string
	length as '..result'.
	(gfc_null_and_pass_deferred_len): Helper function to null and
	return deferred string lengths, as needed.
	(gfc_trans_deferred_vars): Call it, thereby reducing repeated
	code, add call for deferred arrays and reroute pointer function
	results. Avoid using 'tmp' for anything other that a temporary
	tree by introducing 'type_of_array' for the arrayspec type.

2016-02-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69423
	* gfortran.dg/deferred_character_15.f90 : New test.

From-SVN: r233589
2016-02-20 18:26:59 +00:00
Thomas Koenig 49a1164ae3 re PR fortran/69742 (ICE with -O3 and ASSOCIATE containing repeated expression)
2015-02-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/69742
	* frontend-passes.c (cfe-expr_0):  Don't register functions
	from within an ASSOCIATE statement.

2015-02-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/69742
	* gfortran.dg/associate_21.f90:  New test.

From-SVN: r233474
2016-02-16 21:10:00 +00:00
Thomas Koenig 1e6025b653 re PR fortran/60526 (Accepts-invalid: Variable name same as type name)
2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/60526
	* decl.c (build_sym):  If the name has already been defined as a
	type, it has a symtree with an upper case letter at the beginning.
	If such a symtree exists, issue an error and exit.  Don't do
	this if there is no corresponding upper case letter.


2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/60526
	* gfortran.dg/type_decl_4.f90:  Reinstated.

From-SVN: r233413
2016-02-14 17:08:44 +00:00
Thomas Koenig b7c5658195 re PR fortran/60526 (Accepts-invalid: Variable name same as type name)
2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/60526
	PR bootstrap/69816
	* decl.c (build_sym):  Reverted previous patch.

2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/60526
	PR bootstrap/69816
	* gfortran.dg/type_decl_4.f90:  Removed.

From-SVN: r233411
2016-02-14 15:13:39 +00:00
Thomas Koenig 60cb4ef555 re PR fortran/60526 (Accepts-invalid: Variable name same as type name)
2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/60526
	* decl.c (build_sym):  If the name has already been defined as a
	type, issue error and return false.

2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/60526
	* gfortran.dg/type_decl_4.f90:  New test.

From-SVN: r233410
2016-02-14 12:23:59 +00:00
David Malcolm 876217ae71 PR other/69554: avoid excessive source printing for widely-separated locations
gcc/ChangeLog:
	PR other/69554
	* diagnostic-show-locus.c (struct line_span): New struct.
	(layout::get_first_line): Delete.
	(layout::get_last_line): Delete.
	(layout::get_num_line_spans): New member function.
	(layout::get_line_span): Likewise.
	(layout::print_heading_for_line_span_index_p): Likewise.
	(layout::get_expanded_location): Likewise.
	(layout::calculate_line_spans): Likewise.
	(layout::m_first_line): Delete.
	(layout::m_last_line): Delete.
	(layout::m_line_spans): New field.
	(layout::layout): Update comment.  Replace m_first_line and
	m_last_line with m_line_spans, replacing their initialization
	with a call to calculate_line_spans.
	(diagnostic_show_locus): When printing source lines and
	annotations, rather than looping over a single span
	of lines, instead loop over each line_span within
	the layout, with an inner loop over the lines within them.
	Call the context's start_span callback when changing line spans.
	* diagnostic.c (diagnostic_initialize): Initialize start_span.
	(diagnostic_build_prefix): Break out the building of the location
	part of the string into...
	(diagnostic_get_location_text): ...this new function, rewriting
	it from nested ternary expressions to a sequence of "if"
	statements.
	(default_diagnostic_start_span_fn): New function.
	* diagnostic.h (diagnostic_start_span_fn): New typedef.
	(diagnostic_context::start_span): New field.
	(default_diagnostic_start_span_fn): New prototype.

gcc/fortran/ChangeLog:
	PR other/69554
	* error.c (gfc_diagnostic_start_span): New function.
	(gfc_diagnostics_init): Initialize global_dc's start_span.

gcc/testsuite/ChangeLog:
	PR other/69554
	* gcc.dg/pr69554-1.c: New test.
	* gfortran.dg/pr69554-1.F90: New test.
	* gfortran.dg/pr69554-2.F90: New test.
	* lib/gcc-dg.exp (proc dg-locus): New function.
	* lib/gfortran-dg.exp (proc gfortran-dg-test): Update comment to
	distinguish between the caret-printing and non-caret-printing
	cases.  If caret-printing has been explicitly enabled, bail out
	without attempting to fix up the output.

From-SVN: r233386
2016-02-12 19:18:03 +00: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
Jerry DeLisle c0f0e35a6d re PR fortran/50555 (synonymous namelist/statement function dummy argument not allowed (r178939))
2016-02-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/50555
	* primary.c (match_actual_arg): If symbol has attribute flavor of
	namelist, generate an error. (gfc_match_rvalue): Likewise return
	MATCH_ERROR.
	* resolve.c (resolve_symbol): Scan arument list of procedures and
	generate an error if a namelist is found.

	PR fortran/50555
	* gfortran.dg/namelist_args.f90: New test.

From-SVN: r233203
2016-02-07 20:15:55 +00:00
Mikael Morin 711d7c231f Fix fortran scalar elemental dependency mishandling
PR fortran/66089
gcc/fortran/
	* trans-expr.c (expr_is_variable, gfc_expr_is_variable): Rename
	the former to the latter and make it non-static.  Update callers.
	* gfortran.h (gfc_expr_is_variable): New declaration.
	(struct gfc_ss_info): Add field needs_temporary.
	* trans-array.c (gfc_scalar_elemental_arg_saved_as_argument):
	Tighten the condition on aggregate expressions with a check
	that the expression is a variable and doesn't need a temporary.
	(gfc_conv_resolve_dependency): Add intermediary reference variable.
	Set the needs_temporary field.
gcc/testsuite/
	* gfortran.dg/elemental_dependency_6.f90: New.

From-SVN: r233188
2016-02-05 21:41:15 +00:00
Andre Vehreschild 781d83d96d re PR fortran/67451 ([F08] ICE with sourced allocation from coarray.)
gcc/testsuite/ChangeLog:

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

	PR fortran/67451
	PR fortran/69418
	* gfortran.dg/coarray_allocate_2.f08: New test.
	* gfortran.dg/coarray_allocate_3.f08: New test.
	* gfortran.dg/coarray_allocate_4.f08: New test.


gcc/fortran/ChangeLog:

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

	PR fortran/67451
	PR fortran/69418
	* trans-expr.c (gfc_copy_class_to_class): For coarrays just the
	pointer is passed.  Take it as is without trying to deref the
	_data component.
	* trans-stmt.c (gfc_trans_allocate): Take care of coarrays as
	argument to source=-expression.

From-SVN: r233101
2016-02-03 11:39:09 +01:00
Nathan Sidwell b6adbb9faa nvptx.c (PTX_GANG_DEFAULT): New.
gcc/
	* config/nvptx/nvptx.c (PTX_GANG_DEFAULT): New.
	(nvptx_goacc_validate_dims): Extend to handle global defaults.
	* target.def (OACC_VALIDATE_DIMS): Extend documentation.
	* doc/tm.texti: Rebuilt.
	* doc/invoke.texi (fopenacc-dim): Document.
	* lto-wrapper.c (merge_and_complain): Add OPT_fopenacc_dim_ case.
	(append_compiler_options): Likewise.
	* omp-low.c (oacc_default_dims, oacc_min_dims): New.
	(oacc_parse_default_dims): New.
	(oacc_validate_dims): Add USED arg.  Select non-unity default when
	possible.
	(oacc_loop_fixed_partitions): Return mask of used partitions.
	(oacc_loop_auto_partitions): Emit dump info.
	(oacc_loop_partition): Return mask of used partitions.
	(execute_oacc_device_lower): Parse default dimension arg.  Adjust
	loop partitioning and validation calls.

	gcc/c-family/
	* c.opt (fopenacc-dim=): New option.

	gcc/fortran/
	* lang.opt (fopenacc-dim=): New option.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c: New.
	* testsuite/libgomp.oacc-fortran/routine-7.f90: Serialize loop.

From-SVN: r233041
2016-02-01 16:20:13 +00:00
Paul Thomas 0c221916d6 re PR fortran/67564 (Segfault on sourced allocattion statement with class(*) arrays)
2016-01-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/67564
	* trans-expr.c (gfc_conv_procedure_call): For the vtable copy
	subroutines, add a string length argument, when the actual
	argument is an unlimited polymorphic class object.

2016-01-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/67564
	* gfortran.dg/allocate_with_source_17.f03: New test.

From-SVN: r233016
2016-01-31 10:22:05 +00:00
Paul Thomas e520d5f02a re PR fortran/69566 ([OOP] Failure of SELECT TYPE with unlimited polymorphic function result)
2016-01-30  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69566
	* trans-expr.c (gfc_conv_procedure_call): Correct expression
	for 'ulim_copy', which was missing a test for 'comp'.

2016-01-30  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69566
	* gfortran.dg/unlimited_polymorphic_25.f03: New test.

From-SVN: r233011
2016-01-30 17:44:56 +00:00
Andre Vehreschild 874108a905 re PR fortran/62536 (ICE (segfault) for invalid END BLOCK statement)
gcc/fortran/ChangeLog:

2016-01-28  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/62536
	* decl.c (gfc_match_end): Only unnest and remove BLOCK namespaces
	when the END encountered does not match a BLOCK's end.

gcc/testsuite/ChangeLog:

2016-01-28  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/62536
	* gfortran.dg/block_15.f08: New test.
	* gfortran.dg/block_end_error_1.f90: Need to catch additional error
	on incorrectly closed BLOCK.

From-SVN: r232919
2016-01-28 12:34:03 +01:00
Paul Thomas 9a175e65bd correct ChangeLogs for PR69422
From-SVN: r232914
2016-01-28 06:52:15 +00:00
Janus Weil 124bdd23dc re PR fortran/69484 (documentation issue: -Wtabs and -Wall)
2016-01-27  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/69484
	* invoke.texi: Fix documentation of -Wall with respect to -Wtabs.

From-SVN: r232906
2016-01-27 23:32:52 +01:00
Paul Thomas 49847d759f [multiple changes]
2016-01-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69385
	* trans-expr.c (is_scalar_reallocatable_lhs): Remove the check
	for allocatable components, whilst checking if the symbol is a
	derived or class entity..

2015-01-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69385
	* gfortran.dg/alloc_comp_assign_15.f03: New test.

From-SVN: r232904
2016-01-27 21:24:01 +00:00
Paul Thomas a0909527ea [multiple changes]
2016-01-26  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69385
	* trans-expr.c (gfc_trans_assignment_1): Exclude initialization
	assignments from check on assignment of scalars to unassigned
	arrays and correct wrong code within the corresponding block.

2015-01-26  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69385
	* gfortran.dg/allocate_error_6.f90: New test.

From-SVN: r232850
2016-01-26 21:57:12 +00:00
David Malcolm 01e1dea37c PR other/69006: fix extra newlines after diagnostics
gcc/c-family/ChangeLog:
	PR other/69006
	* c-opts.c (c_diagnostic_finalizer): Replace invocation of
	pp_newline_and_flush with pp_flush.

gcc/cp/ChangeLog:
	PR other/69006
	* error.c (print_instantiation_partial_context_line): Add missing
	newlines from output for the t == NULL case.
	(print_instantiation_partial_context): Remove call to pp_newline.

gcc/ChangeLog:
	PR other/69006
	* diagnostic-show-locus.c (layout::print_source_line): Replace
	call to pp_newline with call to layout::print_newline.
	(layout::print_annotation_line): Likewise.
	(layout::move_to_column): Likewise.
	(layout::print_any_fixits): After printing any fixits, print a
	trailing newline, if necessary.
	(layout::print_newline): New method, resetting any colorization
	before a newline.
	(diagnostic_show_locus): Move the pp_newline to before the
	early bailout.  Remove dummy block enclosing the layout instance.
	* diagnostic.c (default_diagnostic_finalizer): Replace invocation
	of pp_newline_and_flush with pp_flush.
	(diagnostic_append_note): Delete use of pp_newline.
	(diagnostic_append_note_at_rich_loc): Delete.
	* diagnostic.h (diagnostic_append_note_at_rich_loc): Delete.
	* pretty-print.h (output_buffer_append_r): Reset buff->line_length
	when newline characters are added to the buffer.

gcc/fortran/ChangeLog:
	PR other/69006
	* error.c (gfc_diagnostic_starter): Delete use of pp_newline.

gcc/testsuite/ChangeLog:
	PR other/69006
	* g++.dg/ext/timevar1.C: Add dg-allow-blank-lines-in-output
	directive.
	* gcc.dg/plugin/diagnostic-test-show-locus-color.c: Update
	expected multiline output to reflect the colorization being
	disabled before newlines.
	* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
	(custom_diagnostic_finalizer): Replace call to
	pp_newline_and_flush with call to pp_flush.
	* gcc.dg/unroll-2.c: Add dg-allow-blank-lines-in-output directive.
	* gfortran.dg/implicit_class_1.f90: Likewise.
	* lib/gcc-dg.exp (allow_blank_lines): New global.
	(dg-allow-blank-lines-in-output): New procedure.
	(gcc-dg-prune): Complain about blank lines in the output, unless
	dg-allow-blank-lines-in-output was called.
	* lib/multiline.exp (_build_multiline_regex): Only support
	arbitrary followup text for non-blank-lines, not for blank lines.

From-SVN: r232837
2016-01-26 17:08:12 +00:00
Jerry DeLisle 1d10121630 [multiple changes]
2016-01-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/69397
	PR fortran/68442
	* interface.c (gfc_arglist_matches_symbol): Replace assert with
	a return false if not a procedure.
	* resolve.c (resolve_generic_f): Test if we are resolving an
	initialization expression and adjust error message accordingly.

2016-01-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/69397
	PR fortran/68442
	* gfortran.dg/interface_38.f90: New test.
	* gfortran.dg/interface_39.f90: New test.

From-SVN: r232780
2016-01-24 22:18:20 +00:00
Thomas Koenig a220f43d11 re PR fortran/66094 (Handle transpose(A) in inline matmul)
2016-01-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/66094
	* frontend-passes.c (matmul_lhs_realloc):  Add
	forgotten break statement.

From-SVN: r232779
2016-01-24 18:15:08 +00:00
Dominique d'Humieres 16acb1a8c7 [multiple changes]
2016-01-24  Dominique d'Humieres <dominiq@lps.ens.fr>

	PR fortran/68283
	* primary.c (gfc_variable_attr): revert revision r221955,
	call gfc_internal_error only if there is no error.

2016-01-24  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/68283
	gfortran.dg/pr68283.f90: New test.

From-SVN: r232775
2016-01-24 14:12:44 +01:00
Thomas Koenig 094773e8cb re PR fortran/66094 (Handle transpose(A) in inline matmul)
2016-01-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/66094
	* frontend-passes.c (enum matrix_case):  Add case A2B2T for
	MATMUL(A,TRANSPoSE(B)) where A and B are rank 2.
	(inline_limit_check):  Also add A2B2T.
	(matmul_lhs_realloc):  Handle A2B2T.
	(check_conjg_variable):  Rename to
	(check_conjg_transpose_variable):  and also count TRANSPOSE.
	(inline_matmul_assign):  Handle A2B2T.

2016-01-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/66094
	* gfortran.dg/inline_matmul_13.f90:  New test.
	* gfortran.dg/matmul_bounds_8.f90:  New test.
	* gfortran.dg/matmul_bounds_9.f90:  New test.
	* gfortran.dg/matmul_bounds_10.f90:  New test.

From-SVN: r232774
2016-01-24 09:11:50 +00:00
Jerry DeLisle 2423a75aed re PR fortran/65996 (gfortran ICE with -dH)
2016-01-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/65996
	* error.c (gfc_error): Save the state of abort_on_error and set
	it to false for buffered errors to allow normal processing.
	Restore the state before leaving.

2016-01-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/65996
	gfortran.dg/pr65996.f90: New test.

From-SVN: r232707
2016-01-21 21:08:00 +00:00
Martin Jambor b2b4005150 Merge of HSA
2016-01-19  Martin Jambor  <mjambor@suse.cz>
	    Martin Liska  <mliska@suse.cz>
	    Michael Matz <matz@suse.de>

libgomp/
	* plugin/Makefrag.am: Add HSA plugin requirements.
	* plugin/configfrag.ac (HSA_RUNTIME_INCLUDE): New variable.
	(HSA_RUNTIME_LIB): Likewise.
	(HSA_RUNTIME_CPPFLAGS): Likewise.
	(HSA_RUNTIME_INCLUDE): New substitution.
	(HSA_RUNTIME_LIB): Likewise.
	(HSA_RUNTIME_LDFLAGS): Likewise.
	(hsa-runtime): New configure option.
	(hsa-runtime-include): Likewise.
	(hsa-runtime-lib): Likewise.
	(PLUGIN_HSA): New substitution variable.
	Fill HSA_RUNTIME_INCLUDE and HSA_RUNTIME_LIB according to the new
	configure options.
	(PLUGIN_HSA_CPPFLAGS): Likewise.
	(PLUGIN_HSA_LDFLAGS): Likewise.
	(PLUGIN_HSA_LIBS): Likewise.
	Check that we have access to HSA run-time.
	* libgomp-plugin.h (offload_target_type): New element
	OFFLOAD_TARGET_TYPE_HSA.
	* libgomp.h (gomp_target_task): New fields firstprivate_copies and
	args.
	(bool gomp_create_target_task): Updated.
	(gomp_device_descr): Extra parameter of run_func and async_run_func,
	new field can_run_func.
	* libgomp_g.h (GOMP_target_ext): Update prototype.
	* oacc-host.c (host_run): Added a new parameter args.
	* target.c (calculate_firstprivate_requirements): New function.
	(copy_firstprivate_data): Likewise.
	(gomp_target_fallback_firstprivate): Use them.
	(gomp_target_unshare_firstprivate): New function.
	(gomp_get_target_fn_addr): Allow returning NULL for shared memory
	devices.
	(GOMP_target): Do host fallback for all shared memory devices.  Do not
	pass any args to plugins.
	(GOMP_target_ext): Introduce device-specific argument parameter args.
	Allow host fallback if device shares memory.  Do not remap data if
	device has shared memory.
	(gomp_target_task_fn): Likewise.  Also treat shared memory devices
	like host fallback for mappings.
	(GOMP_target_data): Treat shared memory devices like host fallback.
	(GOMP_target_data_ext): Likewise.
	(GOMP_target_update): Likewise.
	(GOMP_target_update_ext): Likewise.  Also pass NULL as args to
	gomp_create_target_task.
	(GOMP_target_enter_exit_data): Likewise.
	(omp_target_alloc): Treat shared memory devices like host fallback.
	(omp_target_free): Likewise.
	(omp_target_is_present): Likewise.
	(omp_target_memcpy): Likewise.
	(omp_target_memcpy_rect): Likewise.
	(omp_target_associate_ptr): Likewise.
	(gomp_load_plugin_for_device): Also load can_run.
	* task.c (GOMP_PLUGIN_target_task_completion): Free
	firstprivate_copies.
	(gomp_create_target_task): Accept new argument args and store it to
	ttask.
	* plugin/plugin-hsa.c: New file.

gcc/
	* Makefile.in (OBJS): Add new source files.
	(GTFILES): Add hsa.c.
	* common.opt (disable_hsa): New variable.
	(-Whsa): New warning.
	* config.in (ENABLE_HSA): New.
	* configure.ac: Treat hsa differently from other accelerators.
	(OFFLOAD_TARGETS): Define ENABLE_OFFLOADING according to
	$enable_offloading.
	(ENABLE_HSA): Define ENABLE_HSA according to $enable_hsa.
	* doc/install.texi (Configuration): Document --with-hsa-runtime,
	--with-hsa-runtime-include, --with-hsa-runtime-lib and
	--with-hsa-kmt-lib.
	* doc/invoke.texi (-Whsa): Document.
	(hsa-gen-debug-stores): Likewise.
	* lto-wrapper.c (compile_images_for_offload_targets): Do not attempt
	to invoke offload compiler for hsa acclerator.
	* opts.c (common_handle_option): Determine whether HSA offloading
	should be performed.
	* params.def (PARAM_HSA_GEN_DEBUG_STORES): New parameter.
	* builtin-types.def (BT_FN_VOID_UINT_PTR_INT_PTR): New.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): Removed.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): New.
	* gimple-low.c (lower_stmt): Also handle GIMPLE_OMP_GRID_BODY.
	* gimple-pretty-print.c (dump_gimple_omp_for): Also handle
	GF_OMP_FOR_KIND_GRID_LOOP.
	(dump_gimple_omp_block): Also handle GIMPLE_OMP_GRID_BODY.
	(pp_gimple_stmt_1): Likewise.
	* gimple-walk.c (walk_gimple_stmt): Likewise.
	* gimple.c (gimple_build_omp_grid_body): New function.
	(gimple_copy): Also handle GIMPLE_OMP_GRID_BODY.
	* gimple.def (GIMPLE_OMP_GRID_BODY): New.
	* gimple.h (enum gf_mask): Added GF_OMP_PARALLEL_GRID_PHONY,
	GF_OMP_FOR_KIND_GRID_LOOP, GF_OMP_FOR_GRID_PHONY and
	GF_OMP_TEAMS_GRID_PHONY.
	(gimple_statement_omp_single_layout): Updated comments.
	(gimple_build_omp_grid_body): New function.
	(gimple_has_substatements): Also handle GIMPLE_OMP_GRID_BODY.
	(gimple_omp_for_grid_phony): New function.
	(gimple_omp_for_set_grid_phony): Likewise.
	(gimple_omp_parallel_grid_phony): Likewise.
	(gimple_omp_parallel_set_grid_phony): Likewise.
	(gimple_omp_teams_grid_phony): Likewise.
	(gimple_omp_teams_set_grid_phony): Likewise.
	(gimple_return_set_retbnd): Also handle GIMPLE_OMP_GRID_BODY.
	* omp-builtins.def (BUILT_IN_GOMP_OFFLOAD_REGISTER): New.
	(BUILT_IN_GOMP_OFFLOAD_UNREGISTER): Likewise.
	(BUILT_IN_GOMP_TARGET): Updated type.
	* omp-low.c: Include symbol-summary.h, hsa.h and params.h.
	(adjust_for_condition): New function.
	(get_omp_for_step_from_incr): Likewise.
	(extract_omp_for_data): Moved parts to adjust_for_condition and
	get_omp_for_step_from_incr.
	(build_outer_var_ref): Handle GIMPLE_OMP_GRID_BODY.
	(fixup_child_record_type): Bail out if receiver_decl is NULL.
	(scan_sharing_clauses): Handle OMP_CLAUSE__GRIDDIM_.
	(scan_omp_parallel): Do not create child functions for phony
	constructs.
	(check_omp_nesting_restrictions): Handle GIMPLE_OMP_GRID_BODY.
	(scan_omp_1_op): Checking assert we are not remapping to
	ERROR_MARK.  Also also handle GIMPLE_OMP_GRID_BODY.
	(parallel_needs_hsa_kernel_p): New function.
	(expand_parallel_call): Register apprpriate parallel child
	functions as HSA kernels.
	(grid_launch_attributes_trees): New type.
	(grid_attr_trees): New variable.
	(grid_create_kernel_launch_attr_types): New function.
	(grid_insert_store_range_dim): Likewise.
	(grid_get_kernel_launch_attributes): Likewise.
	(get_target_argument_identifier_1): Likewise.
	(get_target_argument_identifier): Likewise.
	(get_target_argument_value): Likewise.
	(push_target_argument_according_to_value): Likewise.
	(get_target_arguments): Likewise.
	(expand_omp_target): Call get_target_arguments instead of looking
	up for teams and thread limit.
	(grid_expand_omp_for_loop): New function.
	(grid_arg_decl_map): New type.
	(grid_remap_kernel_arg_accesses): New function.
	(grid_expand_target_kernel_body): New function.
	(expand_omp): Call it.
	(lower_omp_for): Do not emit phony constructs.
	(lower_omp_taskreg): Do not emit phony constructs but create for them
	a temporary variable receiver_decl.
	(lower_omp_taskreg): Do not emit phony constructs.
	(lower_omp_teams): Likewise.
	(lower_omp_grid_body): New function.
	(lower_omp_1): Call it.
	(grid_reg_assignment_to_local_var_p): New function.
	(grid_seq_only_contains_local_assignments): Likewise.
	(grid_find_single_omp_among_assignments_1): Likewise.
	(grid_find_single_omp_among_assignments): Likewise.
	(grid_find_ungridifiable_statement): Likewise.
	(grid_target_follows_gridifiable_pattern): Likewise.
	(grid_remap_prebody_decls): Likewise.
	(grid_copy_leading_local_assignments): Likewise.
	(grid_process_kernel_body_copy): Likewise.
	(grid_attempt_target_gridification): Likewise.
	(grid_gridify_all_targets_stmt): Likewise.
	(grid_gridify_all_targets): Likewise.
	(execute_lower_omp): Call grid_gridify_all_targets.
	(make_gimple_omp_edges): Handle GIMPLE_OMP_GRID_BODY.
	* tree-core.h (omp_clause_code): Added OMP_CLAUSE__GRIDDIM_.
	(tree_omp_clause): Added union field dimension.
	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__GRIDDIM_.
	* tree.c (omp_clause_num_ops): Added number of arguments of
	OMP_CLAUSE__GRIDDIM_.
	(omp_clause_code_name): Added name of OMP_CLAUSE__GRIDDIM_.
	(walk_tree_1): Handle OMP_CLAUSE__GRIDDIM_.
	* tree.h (OMP_CLAUSE_GRIDDIM_DIMENSION): New.
	(OMP_CLAUSE_SET_GRIDDIM_DIMENSION): Likewise.
	(OMP_CLAUSE_GRIDDIM_SIZE): Likewise.
	(OMP_CLAUSE_GRIDDIM_GROUP): Likewise.
	* passes.def: Schedule pass_ipa_hsa and pass_gen_hsail.
	* tree-pass.h (make_pass_gen_hsail): Declare.
	(make_pass_ipa_hsa): Likewise.
	* ipa-hsa.c: New file.
	* lto-section-in.c (lto_section_name): Add hsa section name.
	* lto-streamer.h (lto_section_type): Add hsa section.
	* timevar.def (TV_IPA_HSA): New.
        * hsa-brig-format.h: New file.
	* hsa-brig.c: New file.
	* hsa-dump.c: Likewise.
	* hsa-gen.c: Likewise.
	* hsa.c: Likewise.
	* hsa.h: Likewise.
	* toplev.c (compile_file): Call hsa_output_brig.
	* hsa-regalloc.c: New file.

gcc/fortran/
	* types.def (BT_FN_VOID_UINT_PTR_INT_PTR): New.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): Removed.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): New.

gcc/lto/
	* lto-partition.c: Include "hsa.h"
	(add_symbol_to_partition_1): Put hsa implementations into the
	same partition as host implementations.

liboffloadmic/
	* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_async_run): New
	unused parameter.
	(GOMP_OFFLOAD_run): Likewise.

include/
	* gomp-constants.h (GOMP_DEVICE_HSA): New macro.
	(GOMP_VERSION_HSA): Likewise.
	(GOMP_TARGET_ARG_DEVICE_MASK): Likewise.
	(GOMP_TARGET_ARG_DEVICE_ALL): Likewise.
	(GOMP_TARGET_ARG_SUBSEQUENT_PARAM): Likewise.
	(GOMP_TARGET_ARG_ID_MASK): Likewise.
	(GOMP_TARGET_ARG_NUM_TEAMS): Likewise.
	(GOMP_TARGET_ARG_THREAD_LIMIT): Likewise.
	(GOMP_TARGET_ARG_VALUE_SHIFT): Likewise.
	(GOMP_TARGET_ARG_HSA_KERNEL_ATTRIBUTES): Likewise.

From-SVN: r232549
2016-01-19 11:35:10 +01:00
Paul Thomas afbc5ae887 re PR fortran/64324 (Deferred character specific functions not permitted in generic operator interface)
2016-01-15  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/64324
	* resolve.c (check_uop_procedure): Prevent deferred length
	characters from being trapped by assumed length error.

	PR fortran/49630
	PR fortran/54070
	PR fortran/60593
	PR fortran/60795
	PR fortran/61147
	PR fortran/64324
	* trans-array.c (gfc_conv_scalarized_array_ref): Pass decl for
	function as well as variable expressions.
	(gfc_array_init_size): Add 'expr' as an argument. Use this to
	correctly set the descriptor dtype for deferred characters.
	(gfc_array_allocate): Add 'expr' to the call to
	'gfc_array_init_size'.
	* trans.c (gfc_build_array_ref): Expand logic for setting span
	to include indirect references to character lengths.
	* trans-decl.c (gfc_get_symbol_decl): Ensure that deferred
	result char lengths that are PARM_DECLs are indirectly
	referenced both for directly passed and by reference.
	(create_function_arglist): If the length type is a pointer type
	then store the length as the 'passed_length' and make the char
	length an indirect reference to it.
	(gfc_trans_deferred_vars): If a character length has escaped
	being set as an indirect reference, return it via the 'passed
	length'.
	* trans-expr.c (gfc_conv_procedure_call): The length of
	deferred character length results is set TREE_STATIC and set to
	zero.
	(gfc_trans_assignment_1): Do not fix the rse string_length if
	it is a variable, a parameter or an indirect reference. Add the
	code to trap assignment of scalars to unallocated arrays.
	* trans-stmt.c (gfc_trans_allocate): Remove 'def_str_len' and
	all references to it. Instead, replicate the code to obtain a
	explicitly defined string length and provide a value before
	array allocation so that the dtype is correctly set.
	trans-types.c (gfc_get_character_type): If the character length
	is a pointer, use the indirect reference.

2016-01-15  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/49630
	* gfortran.dg/deferred_character_13.f90: New test for the fix
	of comment 3 of the PR.

	PR fortran/54070
	* gfortran.dg/deferred_character_8.f90: New test
	* gfortran.dg/allocate_error_5.f90: New test

	PR fortran/60593
	* gfortran.dg/deferred_character_10.f90: New test

	PR fortran/60795
	* gfortran.dg/deferred_character_14.f90: New test

	PR fortran/61147
	* gfortran.dg/deferred_character_11.f90: New test

	PR fortran/64324
	* gfortran.dg/deferred_character_9.f90: New test

From-SVN: r232450
2016-01-15 20:33:58 +00:00
Thomas Koenig fd42eed899 re PR fortran/69154 (ICE in gfc_trans_where_2, at fortran/trans-stmt.c:5005 on *-linux)
2016-01-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/69154
	* frontend-passes.c (in_where):  New variable.
	(inline_matmul_assign):  Don't try this if we are within
	a WHERE statement.
	(gfc_code_walker):  Keep track of in_where.

2016-01-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/69154
	* gfortran.dg/inline_matmul_12.f90:  New test.

From-SVN: r232201
2016-01-10 13:18:54 +00:00
Paul Thomas 4f90ee6c77 re PR fortran/67779 (Strange ordering with strings in extended object)
2016-01-10  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/67779
	* trans_array.c (gfc_conv_scalarized_array_ref): Add missing
	se->use_offset from condition for calculation of 'base'.

2016-01-10  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/67779
	* gfortran.dg/actual_array_offset_1: New test.

From-SVN: r232200
2016-01-10 12:56:28 +00:00