Commit Graph

149724 Commits

Author SHA1 Message Date
Jason Merrill
559f2bbc36 CWG 2233 - default arg and parameter pack
* typeck.c (convert_arguments): Handle default arg followed by none.

From-SVN: r242350
2016-11-13 01:52:43 -05:00
Jason Merrill
dc8d2d00c5 Fix constexpr lvalue use of __real and __imag.
* constexpr.c (potential_constant_expression_1): REALPART_EXPR and
	IMAGPART_EXPR can be lvalues.

From-SVN: r242349
2016-11-13 01:52:15 -05:00
Jason Merrill
ba1e69c03f DR 374 - specialization in outer namespace
PR c++/56840
	* pt.c (check_specialization_namespace): Allow any enclosing
	namespace.
	(check_unqualified_spec_or_inst): New.
	(check_explicit_specialization): Call it.
	* parser.c (cp_parser_elaborated_type_specifier)
	(cp_parser_class_head): Call it.

From-SVN: r242348
2016-11-13 01:51:23 -05:00
GCC Administrator
478eca6464 Daily bump.
From-SVN: r242345
2016-11-13 00:16:21 +00:00
David Edelsohn
0e07583557 * g++.dg/pr78112.C: XFAIL AIX.
From-SVN: r242342
2016-11-12 18:11:04 -05:00
Jonathan Wakely
5485c81829 * src/filesystem/ops.cc (is_empty): Fix typo in exception message.
From-SVN: r242341
2016-11-12 20:28:55 +00:00
Jonathan Wakely
13908b4404 * include/std/future (future_error): Fix public typo to private.
From-SVN: r242340
2016-11-12 20:28:50 +00:00
Joseph Myers
90df67c791 * es.po: Update.
From-SVN: r242338
2016-11-12 18:51:17 +00:00
Segher Boessenkool
c0d6cb1a6f rs6000: Don't forget to initialize the TOC (PR77957)
The code generating traceback tables mistakenly does an early return
if !optional_tbtab, which causes it to miss the code generating the TOC
section.  This only matters if the TOC will be empty since otherwise
the section is created elsewhere.

This patch fixes it.


	PR target/77957
	* config/rs6000/rs6000.c (rs6000_output_function_epilogue): Don't
	return early if !optional_tbtab.

From-SVN: r242336
2016-11-12 16:13:14 +01:00
Janus Weil
b93d8a3f16 re PR fortran/77501 ([F03] ICE in gfc_match_generic, at fortran/decl.c:9429)
2016-11-12  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/77501
	* class.c (gfc_find_typebound_intrinsic_op): Remove an unnecessary
	assert and nullification.
	* decl.c (gfc_match_decl_type_spec): Use gfc_get_tbp_symtree,
	fix indentation.
	(gfc_match_generic): Remove an unnecessary assert.
	Use gfc_get_tbp_symtree to avoid ICE.

2016-11-12  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/77501
	* gfortran.dg/typebound_generic_16.f90: New test.

From-SVN: r242335
2016-11-12 10:25:47 +01:00
Jonathan Wakely
330cc73d98 Add std::future_error constructor from future_errc
* include/std/future (future_error): Make existing constructor
	private and add constructor from future_errc.

From-SVN: r242334
2016-11-12 03:40:24 +00:00
Jonathan Wakely
0f88f1f2ab Use shared_ptr<T>::element_type in hash specializations
* include/bits/shared_ptr.h (hash<shared_ptr<T>>): Use element_type.
	* include/bits/shared_ptr_base.h (hash<__shared_ptr<T, L>>): Likewise.

From-SVN: r242333
2016-11-12 03:24:34 +00:00
GCC Administrator
9eb97e61d8 Daily bump.
From-SVN: r242331
2016-11-12 00:16:18 +00:00
Jakub Jelinek
b8f70e67b8 re PR c++/71225 (Overeager instantiation of members of non-template class nested in class template)
PR c++/71225
	* g++.dg/cpp0x/pr71225.C: New test.

From-SVN: r242328
2016-11-12 00:42:25 +01:00
Eric Botcazou
8b287aea35 re PR rtl-optimization/59461 (missed zero-extension elimination in the combiner)
PR rtl-optimization/59461
	* doc/rtl.texi (paradoxical subregs): Add missing word.
	* combine.c (reg_nonzero_bits_for_combine): Do not discard results
	in modes with precision larger than that of last_set_mode.
	* rtlanal.c (nonzero_bits1) <SUBREG>: If WORD_REGISTER_OPERATIONS is
	set and LOAD_EXTEND_OP is appropriate, propagate results from inner
	REGs to paradoxical SUBREGs.
	(num_sign_bit_copies1) <SUBREG>: Likewise.  Check that the mode is not
	larger than a word before invoking LOAD_EXTEND_OP on it.

From-SVN: r242326
2016-11-11 22:38:33 +00:00
Joseph Myers
84971f1bad * fr.po: Update.
From-SVN: r242324
2016-11-11 22:08:25 +00:00
Uros Bizjak
76ee24d041 i386.md (*<shift_insn><mode>3_doubleword): Mark operand 0 as earlyclobber.
* config/i386/i386.md (*<shift_insn><mode>3_doubleword): Mark
	operand 0 as earlyclobber.
	(*ashl<mode>3_doubleword): Ditto for all operand 0 alternatives.

From-SVN: r242318
2016-11-11 20:38:20 +01:00
Michael Meissner
a9c1825cda re PR target/78243 (incorrect byte offset in vextractuh with -mcpu=power9)
2016-11-11  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/78243
	* config/rs6000/vsx.md (vsx_extract_<mode>_p9): Correct the
	element order for little endian ordering.

	* config/rs6000/altivec.md (reduc_plus_scal_<mode>): Use
	VECTOR_ELT_ORDER_BIG and not BYTES_BIG_ENDIAN to adjust element
	number.

From-SVN: r242317
2016-11-11 19:12:12 +00:00
Szabolcs Nagy
9d8f95deca [i386][musl] Add cpuinfo to static libgcc only on *-musl*
The __cpu_indicator_init and __cpu_model symbols are not safe to use
from shared libgcc_s.so from ifunc resolvers, so since gcc-6, only
the definitions from static libgcc.a are used, however the symbols
are kept in libgcc_s as well for backward compatibility (with
appropriate symbol version).  On targets without such backward
compatibility concern add cpuinfo to the static library only (this
avoids running the ctor, reduces libgcc_s size and elf abi concerns
about the versioned symbols).

libgcc/
2016-11-11  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* config.host (i[3456]86-*-musl*, x86_64-*-musl*): Use
	i386/t-cpuinfo-static instead of i386/t-cpuinfo.
	* config/i386/t-cpuinfo-static: New.

From-SVN: r242268
2016-11-11 17:31:07 +00:00
Uros Bizjak
c901bc0d8e re PR target/78310 (ICE: insn does not satisfy its constraints: {*bmi2_rorxdi3_1} with -mbmi2)
PR target/78310
	* config/i386/i386.md (rotate to rotatex splitter): Avoid overflow
	when calculating operand 2.
	(rotate to rotatex zext splitter): Ditto.

testsuite/ChangeLog:

	PR target/78310
	* gcc.target/i386/pr78310.c: New test.

From-SVN: r242076
2016-11-11 17:21:52 +01:00
Jeff Law
606f928d38 gimple-ssa-isolate-paths.c (is_divmod_with_given_divisor): New function.
* gimple-ssa-isolate-paths.c (is_divmod_with_given_divisor): New
	function.
	(stmt_uses_name_in_undefined_way): New function, extracted from
	find_implicit_erroneous_behavior and extended for div/mod case.
	(stmt_uses_0_or_null_in_undefined_way): New function, extracted from
	find_explicit_erroneous_behavior and extended for div/mod case.
	(find_implicit_erroneous_behavior): Use new helper function.
	(find_explicit_erroneous_behavior): Use new helper function.

	* gcc.dg/tree-ssa/isolate-6.c: New test.
	* gcc.dg/tree-ssa/isolate-7.c: New test.

From-SVN: r242075
2016-11-11 09:00:47 -07:00
Bin Cheng
be2789903f re PR testsuite/78292 (test case gcc.dg/vect/vect-cond-2.c fails starting with r241967)
gcc/testsuite
	PR testsuite/78292
	* gcc.dg/vect/vect-cond-2.c: Only drop xfail for targets supporting
	vect_max_reduc.

From-SVN: r242073
2016-11-11 14:59:48 +00:00
Ian Lance Taylor
0f366729b9 libgo: fix GOARCH_INT64ALIGN for several targets
From Andreas Schwab.
    
    Reviewed-on: https://go-review.googlesource.com/33130

From-SVN: r242072
2016-11-11 14:52:35 +00:00
Jakub Jelinek
d9ab7525e5 re PR c++/72774 (ICE on invalid C++ code on x86_64-linux-gnu (tree check: expected tree that contains ‘decl minimal’ structure, have ‘tree_list’ in consider_binding_level, at cp/name-lookup.c:4721))
PR c++/72774
	* g++.dg/parse/pr72774.C: New test.

From-SVN: r242070
2016-11-11 14:39:06 +01:00
Richard Biener
4b7e0c7668 re PR tree-optimization/71575 ([graphite] internal compiler error: in copy_cond_phi_nodes, at graphite-isl-ast-to-gimple.c:2500)
2016-11-11  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71575
	* graphite-isl-ast-to-gimple.c (copy_cond_phi_nodes): Remove
	bogus assert.

	* gcc.dg/graphite/pr71575-1.c: New testcase.
	* gcc.dg/graphite/pr71575-2.c: Likewise.

From-SVN: r242069
2016-11-11 12:54:25 +00:00
Richard Biener
d07f8c591a re PR middle-end/78295 (Spurious -Wuninitialized warning for vector element assignment)
2016-11-11  Richard Biener  <rguenther@suse.de>

	PR middle-end/78295
	* tree-ssa-uninit.c (warn_uninitialized_vars): Do not warn
	about uninitialized destination arg of BIT_INSERT_EXPR.

	* gcc.dg/uninit-pr78295.c: New testcase.

From-SVN: r242068
2016-11-11 12:53:36 +00:00
GCC Administrator
495d8b0f03 Daily bump.
From-SVN: r242065
2016-11-11 00:16:19 +00:00
Sandra Loosemore
c47c721569 re PR c/37998 (Unclear documentation of -fno-common)
2016-11-10  Sandra Loosemore  <sandra@codesourcery.com>

	PR c/37998

	gcc/
	* doc/invoke.texi (Code Gen Options) [-fno-common]: Use correct
	terminology.  Expand to remove ambiguity.

From-SVN: r242062
2016-11-10 18:56:30 -05:00
Ian Lance Taylor
980f9a0a4b runtime: copy signal code from Go 1.7 runtime
Add a little shell script to auto-generate runtime.sigtable from the
    known signal names.
    
    Force the main package to always import the runtime package.  Otherwise
    some runtime package global variables may never be initialized.
    
    Set the syscallsp and syscallpc fields of g when entering a syscall, so
    that the runtime package knows when a g is executing a syscall.
    
    Fix runtime.funcPC to avoid dead store elimination of the interface
    value when the function is inlined.
    
    Reviewed-on: https://go-review.googlesource.com/33025

From-SVN: r242060
2016-11-10 22:53:23 +00:00
Segher Boessenkool
071af74db6 combine: Do not call simplify from inside change_zero_ext (PR78232)
When combine splits a three-insn combination into two instructions it
can reuse i2dest for the temporary result of the first new instruction.
However all information it has in reg_stat about that register will be
stale.  This results in the simplify_gen_binary calls in change_zero_ext
using out-of-date information, which makes it think one of the ANDs
generated there always results in 0, and it doesn't get better from there.

This can also happen if a splitter in the MD uses nonzero_bits (for
example).  I tried to make the splitting code in combine save and restore
the i2dest reg_stat info, but that causes one of the acats tests to fail.

This whole reg_stat thing needs an overhaul, and/or we shouldn't reuse
i2dest for unrelated purposes when splitting.

This patch changes change_zero_ext to do the expected simplifications
itself and not call simplify_gen_*.


	PR rtl-optimization/78232
	* combine.c (try_combine): Add a big comment about why reusing i2dest
	is undesirable.
	(change_zero_ext): Do not call simplify_gen_binary, do the
	simplifications manually.

From-SVN: r242059
2016-11-10 23:45:39 +01:00
Fritz O. Reese
9490321264 Fix ICE and improve errors for invalid anonymous structure declarations.
PR fortran/78277
	* gcc/fortran/decl.c (gfc_match_data_decl): Gracefully handle bad
	anonymous structure declarations.

	PR fortran/78277
	* gcc/testsuite/gfortran.dg/dec_structure_17.f90: New test.

From-SVN: r242058
2016-11-10 21:57:13 +00:00
Fritz O. Reese
05b8fcb4d2 Fix some whitespace.
gcc/fortran/
	* decl.c (get_struct_decl, gfc_match_map, gfc_match_union): Fix
	whitespace.
	* interface.c (gfc_compare_union_types): Likewise.

From-SVN: r242057
2016-11-10 21:54:48 +00:00
Jason Merrill
f065303fcf PR c++/77337 - auto return and lambda
* pt.c (tsubst_friend_function): Don't set DECL_INITIAL.
	(instantiate_decl): It's OK to defer a constexpr function.
	* cp-tree.h (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION): Check
	DECL_LANG_SPECIFIC.
	* decl2.c (decl_defined_p): Use it.  No longer static.
	* decl.c (redeclaration_error_message): Use decl_defined_p.
	* constexpr.c (cxx_eval_call_expression): Set input_location around
	call to instantiate_decl.

From-SVN: r242056
2016-11-10 16:42:36 -05:00
François Dumont
28d1bf4464 debug.cc (format_word): Delete.
2016-11-10  François Dumont  <fdumont@gcc.gnu.org>

	* src/c++11/debug.cc (format_word): Delete.
	(print_literal): New. Replace call to print_word for literals.

From-SVN: r242055
2016-11-10 21:29:43 +00:00
Michael Meissner
456f0dfa1c rs6000.c (rs6000_hard_regno_mode_ok): If ISA 3.0...
[gcc]
2016-11-10  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_hard_regno_mode_ok): If ISA 3.0,
	enable HImode and QImode to go in vector registers by default if
	the -mvsx-small-integer option is enabled.
	(rs6000_secondary_reload_simple_move): Likewise.
	(rs6000_preferred_reload_class): Don't force integer constants to
	be loaded into vector registers that we can easily make into
	memory (or being created in the GPRs and moved over with direct
	move).
	* config/rs6000/vsx.md (UNSPEC_P9_MEMORY): Delete, no longer
	used.
	(vsx_extract_<mode>): Rework V4SImode, V8HImode, and V16QImode
	vector extraction on ISA 3.0 when the scalar integer can be
	allocated in vector registers.  Generate the VEC_SELECT directy,
	and don't use UNSPEC's to avoid having the scalar type in a vector
	register.  Make the expander target registers, and let the
	combiner fold in results storing to memory, if the machine
	supports stores.
	(vsx_extract_<mode>_di): Likewise.
	(vsx_extract_<mode>_p9): Likewise.
	(vsx_extract_<mode>_di_p9): Likewise.
	(vsx_extract_<mode>_store_p9): Likewise.
	(vsx_extract_si): Likewise.
	(vsx_extract_<mode>_p8): Likewise.
	(p9_lxsi<wd>zx): Delete, no longer used.
	(p9_stxsi<wd>x): Likewise.
	* config/rs6000/rs6000.md (INT_ISA3): New mode iterator for
	integers in vector registers for ISA 3.0.
	(QHI): Update comment.
	(zero_extendqi<mode>2): Add support for ISA 3.0 scalar load or
	vector extract instructions in sign/zero extend.
	(zero_extendhi<mode>): Likewise.
	(extendqi<mode>): Likewise.
	(extendhi<mode>2): Likewise.
	(HImode splitter for load/sign extend in vector register):
	Likewise.
	(float<QHI:mode><FP_ISA3:mode>2): Eliminate old method of
	optimizing floating point conversions to/from small data types and
	rewrite it to support QImode/HImode being allowed in vector
	registers on ISA 3.0.
	(float<QHI:mode><FP_ISA3:mode>2_internal): Likewise.
	(floatuns<QHI:mode><FP_ISA3:mode>2): Likewise.
	(floatuns<QHI:mode><FP_ISA3:mode>2_internal): Likewise.
	(fix_trunc<SFDF:mode><QHI:mode>2): Likewise.
	(fix_trunc<SFDF:mode><QHI:mode>2_internal): Likewise.
	(fixuns_trunc<SFDF:mode><QHI:mode>2): Likewise.
	(fixuns_trunc<SFDF:mode><QHI:mode>2_internal): Likewise.
	VSPLITISW on ISA 2.07.
	(movhi_internal): Combine movhi_internal and movqi_internal into
	one mov<mode>_internal with an iterator.  Add support for QImode
	and HImode being allowed in vector registers.  Make large number
	of attributes and constraints easier to read.
	(movqi_internal): Likewise.
	(mov<mode>_internal): Likewise.
	(movdi_internal64): Fix constraint to allow loading -16..15 with
	VSPLITISW on ISA 2.07.
	(integer XXSPLTIB splitter): Add support for QI, HI, and SImode as
	well as DImode.

[gcc/testsuite]
2016-11-10  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* gcc.target/powerpc/vsx-qimode.c: New test for QImode, HImode
	being allowed in vector registers.
	* gcc.target/powerpc/vsx-qimode2.c: Likewise.
	* gcc.target/powerpc/vsx-qimode3.c: Likewise.
	* gcc.target/powerpc/vsx-himode.c: Likewise.
	* gcc.target/powerpc/vsx-himode2.c: Likewise.
	* gcc.target/powerpc/vsx-himode3.c: Likewise.
	* gcc.target/powerpc/p9-extract-1.c: Change MFVSRD to just MFVSR,
	to allow matching MFVSRD or MFVSRW.

From-SVN: r242048
2016-11-10 19:38:33 +00:00
Pat Haugen
8d34bfa865 re PR rtl-optimization/78241 (wrong code with -funroll-loops)
PR rtl-optimization/78241
	* loop-unroll.c (unroll_loop_runtime_iterations): Don't adjust 'niter', but
	emit initial peel copy if niter expr is not reliable.

	* gcc.dg/pr78241.c: New test.

From-SVN: r242047
2016-11-10 18:55:57 +00:00
Segher Boessenkool
a156669665 dwarf2cfi: Dump row differences before asserting
If maybe_record_trace_start fails because the CFI is inconsistent on two
paths into a block it currently just ICEs.  This changes it to also dump
the CFI on those two paths in the dump file; debugging it without that
information is hopeless.


	* dwarf2cfi.c (dump_cfi_row): Add forward declaration.
	(maybe_record_trace_start): If the CFI is different on the new and
	old paths, print out both to the dump file before ICEing.

From-SVN: r242046
2016-11-10 18:43:02 +01:00
Jakub Jelinek
8ebd1b3182 cpp.c (cpp_define_builtins): Define _OPENMP to 201511 instead of 201307.
gcc/fortran/
	* cpp.c (cpp_define_builtins): Define _OPENMP to 201511 instead
	of 201307.
	* gfortran.texi: Mention partial OpenMP 4.5 support.
	* intrinsic.texi: Update for OpenMP 4.5.
gcc/testsuite/
	* gfortran.dg/openmp-define-3.f90: Expect 201511 instead of
	201307.
libgomp/
	* omp_lib.f90.in (openmp_version): Change to 201511 from 201307.
	* omp_lib.h.in (openmp_version): Likewise.
	* testsuite/libgomp.fortran/openmp_version-1.f: Expect 201511 instead
	of 201307.
	* testsuite/libgomp.fortran/openmp_version-2.f90: Likewise.

From-SVN: r242044
2016-11-10 18:05:18 +01:00
Vladimir Makarov
e93f30a65f target.def (additional_allocno_class_p): New.
2016-11-10  Vladimir Makarov  <vmakarov@redhat.com>

	* target.def (additional_allocno_class_p): New.
	* hooks.h (hook_bool_reg_class_t_false): New prototype.
	* hooks.c (hook_bool_reg_class_t_false): New.
	* ira.c (setup_allocno_and_important_classes): Use the new hook.
	* doc/tm.texi.in (TARGET_ADDITIONAL_ALLOCNO_CLASS_P): Add it.
	* doc/tm.texi: Update.

From-SVN: r242043
2016-11-10 17:04:31 +00:00
Jakub Jelinek
0569479efa mangle.c (mangle_decl): Only emit -Wc++1z-compat warnings for public or external symbols.
* mangle.c (mangle_decl): Only emit -Wc++1z-compat warnings for
	public or external symbols.

	* g++.dg/cpp1z/noexcept-type14.C: New test.
	* g++.dg/asan/asan_test.C: Remove -Wno-c++1z-compat from dg-options.

From-SVN: r242042
2016-11-10 18:04:06 +01:00
James Greenhalgh
37a16493e4 [Patch testsuite] Check range of exponent for tests added in r241817
gcc/ChangeLog

2016-11-10  James Greenhalgh  <james.greenhalgh@arm.com>

	* gcc.dg/torture/fp-int-convert.h (M_OK2): New, use it in
	WVAL0S tests added in r241817.

From-SVN: r242041
2016-11-10 16:53:58 +00:00
Jason Merrill
98a32a4c84 gengtype.c (new_structure): Append to structures list.
* gengtype.c (new_structure): Append to structures list.

	(find_structure): Likewise.

From-SVN: r242040
2016-11-10 11:49:08 -05:00
Jim Wilson
dd18c8c32a Fix loop distribution bug with merging edges that creates too many edges.
gcc/
	* tree-loop-distribution.c (pg_add_dependence_edges): Return 2 if
	this_dir is 2.  Check for this_dir non-zero before dir != this_dir
	check.

From-SVN: r242038
2016-11-10 07:20:59 -08: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
Martin Liska
86bc850653 Create live_switch_vars conditionally (PR sanitizer/78270)
PR sanitizer/78270
	* gcc.dg/asan/pr78270.c: New test.
	PR sanitizer/78270
	* gimplify.c (gimplify_switch_expr): Create live_switch_vars
	only when SWITCH_BODY is a BIND_EXPR.

From-SVN: r242036
2016-11-10 11:21:03 +00:00
Pierre-Marie de Rodat
ed5fdfba23 debug/78112: remove recent duplicates for DW_TAG_subprogram attributes
Disable unnecessary calls to dwarf2out_decl for the parents of nested
functions. This fixes a libstdc++ build regression on
x86_64-apple-darwin, as these calls used to add duplicate attributes
(for instance DW_AT_inline and DW_AT_object_pointer) to the
corresponding DW_TAG_subprogram DIE.

Bootstrapped and regtested on x86_64-linux.

gcc/
	PR debug/78112
	* dwarf2out.c (dwarf2out_early_global_decl): Call dwarf2out_decl
	on the context only when it has no DIE yet.

testsuite/
	PR debug/78112
	* g++.dg/pr78112.C: New testcase

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r242035
2016-11-10 11:06:32 +00:00
Richard Earnshaw
b854516cc1 [ARM] Remove duplicated enum type for CPU identifiers
* arm.h (target_cpus): Delete.
	* arm-opts.h (enum processor_type): Prefix entires with TARGET_CPU_.
	* arm.c (all_cores): Prefix IDENT with TARGET_CPU_.
	(all_architectures): Likewise.
	(arm_option_override): Adjust use of CPU enums.
	(arm_sched_reorder): Likewise.
	* vfp.md (movdi_vfp, movdi_vfp_cortexa8): Likewise.
	* arm.opt (mcpu, mtune): Adjust use of CPU enums.
	* arm/genopt.sh (processor_type): Prefix enumeration entries with
	TARGET_CPU_.
	* arm-tables.opt: Regenerated.

From-SVN: r242034
2016-11-10 10:38:03 +00:00
Siddhesh Poyarekar
35d2bec045 [ARM/AArch64] Add Falkor CPU support.
2016-11-10  Siddhesh Poyarekar  <siddhesh.poyarekar@linaro.org>

	* config/aarch64/aarch64-cores.def (qdf24xx): Update part
	number.
	(falkor): New core.
	* config/aarch64/aarch64-tune.md: Regenerated.
	* config/arm/arm-cores.def (falkor): New core.
	* config/arm/arm-tables.opt: Regenerated.
	* config/arm/arm-tune.md: Regenerated.
	* config/arm/bpabi.h (BE8_LINK_SPEC): Add falkor support.
	* config/arm/t-aprofile (MULTILIB_MATCHES): Likewise.
	* doc/invoke.texi (AArch64 Options/-mtune): Document it.
	(ARM Options/-mtune): Likewise.

From-SVN: r242033
2016-11-10 10:24:53 +00:00
Kugan Vivekanandarajah
e32d2c92d9 revert: ipa-cp.c (ipa_get_jf_pass_through_result): Handle unary expressions.
2016-11-10  Kugan Vivekanandarajah  <kuganv@linaro.org>

	Revert
	2016-11-09  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* ipa-cp.c (ipa_get_jf_pass_through_result): Handle unary expressions.
	(propagate_vr_accross_jump_function): Likewise.
	* ipa-prop.c (ipa_set_jf_unary_pass_through): New.
	(load_from_param_1): New.
	(load_from_unmodified_param): Factor common part into load_from_param_1.
	(load_from_param): New.
	(compute_complex_assign_jump_func): Handle unary expressions.
	(ipa_write_jump_function): Likewise.
	(ipa_read_jump_function): Likewise.

From-SVN: r242032
2016-11-10 07:13:39 +00:00
Segher Boessenkool
a62436c0a5 simplify-rtx: Transform (xor (and (xor A B) C) B) with C const
match.pd transforms (A&C)|(B&~C) to ((A^B)&C)^B, which is fewer
operations if C is not const (and it is not on simple tests at least,
this transform is done very early already).

Various processors have "insert" instructions that can do this, but
combine cannot build those from the xor-and-xor, especially it has no
chance at all to do that if A or B or multiple instructions as well
(on PowerPC, the rl[wd]imi instructions can do this with together with
a rotate, or a simple shift with appropriate C; other ISAs have similar
insns).

This patch makes RTL simplify transform (xor (and (xor A B) C) B) back
to (ior (and A C) (and B ~C)) for constant C (and similar with A instead
of B for that last term).


	* simplify-rtx.c (simplify_binary_operation_1): Simplify
	(xor (and (xor A B) C) B) to (ior (and A C) (and B ~C)) and
	(xor (and (xor A B) C) A) to (ior (and A ~C) (and B C)) if C
	is a const_int.

From-SVN: r242031
2016-11-10 01:32:43 +01:00