173135 Commits

Author SHA1 Message Date
Martin Jambor
68188fff88 ipa-cp: Avoid ICEs when looking at expanded thunks and unoptimized functions
2019-11-29  Martin Jambor  <mjambor@suse.cz>

	PR ipa/92476
	* ipa-cp.c (set_single_call_flag): Set node_calling_single_call in
	the summary only if the summary exists.
	(find_more_scalar_values_for_callers_subset): Check node_dead in
	the summary only if the summary exists.
	(ipcp_store_bits_results): Ignore nodes without lattices.
	(ipcp_store_vr_results): Likewise.
	* cgraphclones.c: Include ipa-fnsummary.h and ipa-prop.h and the
	header files required by them.
	(cgraph_node::expand_all_artificial_thunks): Analyze expanded thunks.

From-SVN: r278841
2019-11-29 14:29:35 +01:00
Richard Sandiford
3edaed3958 Don't pass booleans as mask types to simd clones (PR 92710)
In this PR we assigned a vector mask type to the result of a comparison
and then tried to pass that mask type to a simd clone, which expected
a normal (non-mask) type instead.

This patch simply punts on call arguments that have a mask type.
A better fix would be to pattern-match the comparison to a COND_EXPR,
like we would if the comparison was stored to memory, but doing that
isn't gcc 9 or 10 material.

Note that this doesn't affect x86_64-linux-gnu because the ABI promotes
bool arguments to ints.

2019-11-29  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR tree-optimization/92710
	* tree-vect-stmts.c (vectorizable_simd_clone_call): Reject
	vector mask arguments.

gcc/testsuite/
	PR tree-optimization/92710
	* gcc.dg/vect/pr92710.c: New test.

From-SVN: r278839
2019-11-29 13:04:56 +00:00
Tobias Burnus
337b04a446 gcc/testsuite/ChangeLog - fix date in date line
From-SVN: r278837
2019-11-29 13:24:27 +01:00
Tobias Burnus
18279486b8 Fix testcase - was missing -fopenacc
PR ipa/84963
        * gfortran.dg/goacc/pr84963.f90: Use dg-additional-options not
        dg-options as otherwise -fopenacc is not used.

From-SVN: r278836
2019-11-29 13:18:50 +01:00
Jan Hubicka
db51f624df profile-count.c (profile_count::to_cgraph_frequency, [...]): Check for compaibility of counts.
* profile-count.c (profile_count::to_cgraph_frequency,
	profile_count::to_sreal_scale): Check for compaibility of counts.
	* profile-count.h (compatible_p): Make public; add checking for
	global0 versus global types.
	* cgraph.c (cgraph_node::verify_node): Verify count compatibility.

From-SVN: r278835
2019-11-29 10:29:44 +00:00
Tamar Christina
60178a322b Testsuite: Turn off vect-epilogue-nomask for slp-rect-3
Without epiloque no mask it would only try HI modes, but thanks to the
epiloques nomask It tries QI mode as well which succeeds.  The xfail
then generates an xpass since the condition on it checks for HI to SI
and not QI.

So I disabled the epiloque mask since it seems to violate the conditions
the test actually wanted to test for.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/slp-reduc-3.c: Turn off epilogue-nomask.

From-SVN: r278834
2019-11-29 09:22:15 +00:00
Richard Biener
438d9c4afa re PR tree-optimization/92715 (error: position plus size exceeds size of referenced object in ‘bit_field_ref’)
2019-11-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92715
	* tree-ssa-forwprop.c (simplify_vector_constructor): Bail
	out for uniform vectors and source vectors with less elements
	than the destination.

	* gcc.dg/torture/pr92715.c: New testcase.

From-SVN: r278833
2019-11-29 09:18:48 +00:00
Jakub Jelinek
52702016ad re PR c++/60228 (ICE using lambda in #pragma omp declare reduction)
PR c++/60228
	* parser.c (cp_parser_omp_declare_reduction_exprs): If
	processing_template_decl, wrap the combiner or initializer
	into EXPR_STMT.
	* decl.c (start_preparsed_function): Don't start a lambda scope
	for DECL_OMP_DECLARE_REDUCTION_P functions.
	(finish_function): Don't finish a lambda scope for
	DECL_OMP_DECLARE_REDUCTION_P functions, nor cp_fold_function
	them nor cp_genericize them.
	* mangle.c (decl_mangling_context): Look through
	DECL_OMP_DECLARE_REDUCTION_P functions.
	* semantics.c (expand_or_defer_fn_1): For DECL_OMP_DECLARE_REDUCTION_P
	functions, use tentative linkage, don't keep their bodies with
	-fkeep-inline-functions and return false at the end.

	* g++.dg/gomp/openmp-simd-2.C: Don't expect bodies for
	DECL_OMP_DECLARE_REDUCTION_P functions.

	* testsuite/libgomp.c++/udr-20.C: New test.
	* testsuite/libgomp.c++/udr-21.C: New test.

From-SVN: r278832
2019-11-29 10:10:44 +01:00
Jakub Jelinek
b3f44388f3 re PR c++/60228 (ICE using lambda in #pragma omp declare reduction)
PR c++/60228
	* parser.c (cp_parser_omp_declare_reduction_exprs): If
	processing_template_decl, wrap the combiner or initializer
	into EXPR_STMT.
	* decl.c (start_preparsed_function): Don't start a lambda scope
	for DECL_OMP_DECLARE_REDUCTION_P functions.
	(finish_function): Don't finish a lambda scope for
	DECL_OMP_DECLARE_REDUCTION_P functions, nor cp_fold_function
	them nor cp_genericize them.
	* mangle.c (decl_mangling_context): Look through
	DECL_OMP_DECLARE_REDUCTION_P functions.
	* semantics.c (expand_or_defer_fn_1): For DECL_OMP_DECLARE_REDUCTION_P
	functions, use tentative linkage, don't keep their bodies with
	-fkeep-inline-functions and return false at the end.

	* g++.dg/gomp/openmp-simd-2.C: Don't expect bodies for
	DECL_OMP_DECLARE_REDUCTION_P functions.

	* testsuite/libgomp.c++/udr-20.C: New test.
	* testsuite/libgomp.c++/udr-21.C: New test.

From-SVN: r278831
2019-11-29 10:08:46 +01:00
Martin Liska
efeeda7576 Check for TYPE_NAME in type_with_linkage_p.
2019-11-29  Martin Liska  <mliska@suse.cz>

	PR lto/91574
	* ipa-devirt.c (types_same_for_odr): Check for existence
	of TYPE_NAMEs first.
2019-11-29  Martin Liska  <mliska@suse.cz>

	PR lto/91574
	* g++.dg/lto/pr91574_0.C: New test.

From-SVN: r278829
2019-11-29 09:03:25 +00:00
Richard Biener
d5e82c9f68 re PR tree-optimization/92704 (ICE: Segmentation fault (in process_bb))
2019-11-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92704
	* tree-if-conv.c (combine_blocks): Deal with virtual PHIs
	in loops performing only loads.

	* gcc.dg/torture/pr92704.c: New testcase.

From-SVN: r278828
2019-11-29 08:05:03 +00:00
Joseph Myers
34b43828f8 Handle C2x attributes in Objective-C.
When adding the initial support for C2x attributes, I deferred the
unbounded lookahead support required to support such attributes in
Objective-C (except for the changes to string literal handling, which
were the riskier piece of preparation for such lookahead support).
This patch adds that remaining ObjC support.

For C, the parser continues to work exactly as it did before.  For
ObjC, however, when checking for whether '[[' starts attributes, it
lexes however many tokens are needed to check for a matching ']]', but
in a raw mode that omits all the context-sensitive processing that
c_lex_with_flags normally does, so that that processing can be done
later when the right context-sensitive flags are set.  Those tokens
are saved in a separate raw_tokens vector in the parser, and normal
c_lex_one_token calls will get tokens from there and perform the
remaining processing on them, if any tokens are found there, so all
parsing not using the new interfaces gets the same tokens as it did
before.  (For C, this raw lexing never occurs and the vector of raw
tokens is always NULL.)

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

gcc/c:
	* c-parser.c (struct c_parser): Add members raw_tokens and
	raw_tokens_used.
	(c_lex_one_token): Add argument raw.  Handle lexing raw tokens and
	using previously-lexed raw tokens.
	(c_parser_peek_nth_token_raw)
	(c_parser_check_balanced_raw_token_sequence): New functions.
	(c_parser_nth_token_starts_std_attributes): Use
	c_parser_check_balanced_raw_token_sequence for Objective-C.

gcc/testsuite:
	* objc.dg/attributes/gnu2x-attr-syntax-1.m: New test.

From-SVN: r278827
2019-11-29 01:06:57 +00:00
Julian Brown
70ce1ab9fd Remove unused decimal floating-point pointer types
gcc/
	* builtin-types.def (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR,
	BT_DFLOAT128_PTR) Remove.
	* tree-core.h (TI_DFLOAT32_PTR_TYPE, TI_DFLOAT64_PTR_TYPE,
	TI_DFLOAT128_PTR_TYPE): Remove.
	* tree.c (build_common_type_nodes): Remove dfloat32_ptr_type_node,
	dfloat64_ptr_type_node and dfloat128_ptr_type_node initialisation.
	* tree.h (dfloat32_ptr_type_node, dfloat64_ptr_type_node,
	dfloat128_ptr_type_node): Remove macros.

	gcc/jit/
	* jit-builtins.c (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR):
	Remove commented-out cases.

Reviewed-by: Joseph Myers <joseph@codesourcery.com>

From-SVN: r278826
2019-11-29 00:58:35 +00:00
GCC Administrator
19f9ca88fe Daily bump.
From-SVN: r278825
2019-11-29 00:16:20 +00:00
Segher Boessenkool
3049ccbb8e rs6000: Fix formatting of *mov{si,di}_internal.*
* config/rs6000/rs6000.md (*movsi_internal1): Fix formatting.  Improve
	formatting.
	(*movdi_internal64): Ditto.

From-SVN: r278822
2019-11-29 00:50:06 +01:00
Segher Boessenkool
2538ff0d24 rs6000: Use memory_operand for all simple {l,st}*brx instructions
We run fwprop before combine, very early even in the case of fwprop1;
and fwprop1 will change memory addressing to what it considers cheaper.
After the "common" change, it now changes the indexed store instruction
in the testcase to be to a constant address.  But that is not an
improvement at all: the byte reverse instructions only exist in the
indexed form, so they will not match anymore.

This patch changes the patterns for the byte reverse instructions to
allow plain memory_operand, letting reload fix this up.


	PR target/92602
	* config/rs6000/rs6000.md (bswap<mode>2_load for HSI): Change the
	indexed_or_indirect_operand to be memory_operand.
	(bswap<mode>2_store for HSI): Ditto.
	(bswapdi2_load): Ditto.
	(bswapdi2_store): Ditto.

From-SVN: r278821
2019-11-28 23:28:59 +01:00
Martin Liska
03df119db4 Translate header for -fdbg-cnt-list.
2019-11-28  Martin Liska  <mliska@suse.cz>

	PR debug/46558
	* dbgcnt.c (dbg_cnt_list_all_counters): Mark table
	headers for translation.

From-SVN: r278820
2019-11-28 20:56:51 +00:00
Martin Liska
2fb2966c19 Properly use TYPE_MAIN_VARIANT in warn_types_mismatch.
2019-11-28  Martin Liska  <mliska@suse.cz>

	PR lto/92609
	* ipa-devirt.c (warn_types_mismatch): Use TYPE_MAIN_VARIANT
	consistently.
2019-11-28  Martin Liska  <mliska@suse.cz>

	PR lto/92609
	* g++.dg/lto/pr92609_0.C: New test.
	* g++.dg/lto/pr92609_1.C: New test.

From-SVN: r278819
2019-11-28 20:56:23 +00:00
Iain Sandoe
3a95e31b34 [Darwin, X86, testsuite] Update tests for common section use.
The switch to default of no-common means that we no longer
indirect the accesses to 'xxx' in this test.  Adjust the scan-
assembler tests to reflect this.

gcc/testsuite/ChangeLog:

2019-11-28  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/i386/pr32219-2.c: Adjust scan-assembler entries
	for revised common default.

From-SVN: r278818
2019-11-28 19:41:55 +00:00
Jerry DeLisle
68c28e37e4 re PR libfortran/90374 (Fortran 2018: Support d0.d, e0.d, es0.d, en0.d, g0.d and ew.d e0 edit descriptors for output)
PR fortran/90374
	* io.c (check_format): Allow zero width expoenent with e0.

	* io/format.c (parse_format_list): Relax format checking to allow
	e0 exponent specifier.

	* gfortran.dg/fmt_zero_width.f90: Update test.

From-SVN: r278817
2019-11-28 18:33:20 +00:00
Jan Hubicka
9c28689a99 Remove leftover optimize checks.
* ipa-inline.c (want_early_inline_function_p): Remove leftover optimize
	checks.

From-SVN: r278816
2019-11-28 17:51:40 +00:00
Jan Hubicka
b225a29b8c profile-count.c (profile_count::combine_with_ipa_count): Return uninitialized count if called on ininitialized count.
* profile-count.c (profile_count::combine_with_ipa_count): Return
	uninitialized count if called on ininitialized count.

From-SVN: r278815
2019-11-28 17:04:41 +00:00
Jan Hubicka
c3f1ae8a30 Prevent inconsistent profiles to be created in inlin_transform
* ipa-inline-transform.c (inline_transform): Scale profile before
	redirecting.

From-SVN: r278814
2019-11-28 16:59:43 +00:00
Jan Hubicka
97dd1ee8de profile-count.h (profile_count::max): Work on profiles of different type.
* profile-count.h (profile_count::max): Work on profiles of different
	type.
	(profile_count::apply_scale): Be sure that ret is not local or global0
	type if num is global.

From-SVN: r278813
2019-11-28 16:58:24 +00:00
Martin Jambor
2dfd63ded8 cgraph: ifunc resolvers cannot be made local (PR 92697)
2019-11-28  Martin Jambor  <mjambor@suse.cz>

	PR ipa/92697
	* cgraph.c (cgraph_node_cannot_be_local_p_1): Return true for
	ifunc_resolvers.
	* symtab.c (symtab_node::dump_base): Dump ifunc_resolver flag.
	Removed trailig whitespace.

	testsuite/
	* g++.dg/ipa/pr92697.C: New.

From-SVN: r278812
2019-11-28 16:39:48 +01:00
Jan Hubicka
e01857197b Fix previous commit (that included unrelated changes)
This patch fixes profile updates while cloning.  When new clone is produced
its global profile is subtracted from the original function.  If the original
function profile drops to 0 we want to switch from global profiles to global0
profiles which is implemented by combine_with_ipa_count_within.

However this is done on all edges independnetly and it may happen that we end
up combining global and globa0 profiles in one functions which is not a good
idea.

This implements profile_count::combine_with_ipa_count_within which is able
to take into account that the counter is inside function with a given count.

	* profile-count.h (profile_count::combine_with_ipa_count_within):
	Declare.
	* profile-count.c (profile_count::combine_with_ipa_count_within):
	New.
	* cgraphclones.c (cgraph_edge::clone, cgraph_node::create_clone): Use
	it.

From-SVN: r278811
2019-11-28 14:50:19 +00:00
Jan Hubicka
b49d29d73a Fix profile adjusments while cloning
This patch fixes profile updates while cloning.  When new clone is produced
its global profile is subtracted from the original function.  If the original
function profile drops to 0 we want to switch from global profiles to global0
profiles which is implemented by combine_with_ipa_count_within.

However this is done on all edges independnetly and it may happen that we end
up combining global and globa0 profiles in one functions which is not a good
idea.

This implements profile_count::combine_with_ipa_count_within which is able
to take into account that the counter is inside function with a given count.

	* profile-count.h (profile_count::combine_with_ipa_count_within):
	Declare.
	* profile-count.c (profile_count::combine_with_ipa_count_within):
	New.
	* cgraphclones.c (cgraph_edge::clone, cgraph_node::create_clone): Use
	it.

From-SVN: r278810
2019-11-28 14:44:08 +00:00
Jan Hubicka
eb081fd0e2 ipa-utils.c (ipa_merge_profiles): Be sure that all type transtions of counters are done same way.
* ipa-utils.c (ipa_merge_profiles): Be sure that all type transtions
	of counters are done same way.

From-SVN: r278809
2019-11-28 14:21:08 +00:00
Jan Hubicka
2e7fd86780 * ipa-cp.c (update_profiling_info): Fix scaling.
From-SVN: r278808
2019-11-28 14:16:29 +00:00
Richard Biener
68578d6efa re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang)
2019-11-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92645
	* tree-inline.c (remap_gimple_stmt): When the return value
	is not wanted, elide GIMPLE_RETURN.

	* gcc.dg/tree-ssa/inline-12.c: New testcase.

From-SVN: r278807
2019-11-28 12:26:50 +00:00
Richard Biener
78307657cf re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang)
2019-11-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92645
	* tree-ssa-forwprop.c (get_bit_field_ref_def): Also handle
	conversions inside a mode class.  Remove restriction on
	preserving the element size.
	(simplify_vector_constructor): Deal with the above and for
	identity permutes also try using VEC_UNPACK_[FLOAT_]LO_EXPR
	and VEC_PACK_TRUNC_EXPR.

	* gcc.target/i386/pr92645-4.c: New testcase.

From-SVN: r278806
2019-11-28 12:22:04 +00:00
Georg-Johann Lay
09f8027ce5 Must use push insn to pass varargs arguments of DFmode because otherwise the middle-end generates wrong code.
Must use push insn to pass varargs arguments of DFmode because
	otherwise the middle-end generates wrong code.
	PR target/92055
	* config/avr/avr.md (MPUSH) [DF, DC]: Add modes to mode iterator.

From-SVN: r278805
2019-11-28 10:29:30 +00:00
Christophe Lyon
d68f5edfaf [testsuite][arm] Force use of -mfloat-abi=softfp in asm-flag-4.c
The asm-flag-4.c test forces the generation of Thumb code for armv4t,
which is not supported when using the 'hard' FP ABI. This patch
ensures the test uses -mfloat-abi=softfp safely, to avoid irrelevant
failures.

2019-11-28  Christophe Lyon  <christophe.lyon@linaro.org>

	* gcc.target/arm/asm-flag-4.c: Use -mfloat-abi=softfp.

From-SVN: r278804
2019-11-28 10:16:55 +01:00
Jakub Jelinek
79d2e61495 re PR tree-optimization/92691 (ICE in strlen_dom_walker::before_dom_children at gcc/tree-ssa-strlen.c:5177 since r274933)
PR tree-optimization/92691
	* tree-ssa-strlen.c (handle_store): Clarify return value meaning
	in function comment.
	(strlen_check_and_optimize_call): Likewise.  For handle_printf_call
	calls, return !handle_printf_call rather than always returning true.
	(check_and_optimize_stmt): Describe return value meaning in function
	comment.  Formatting fix.

	* gcc.dg/tree-ssa/builtin-snprintf-10.c: New test.

From-SVN: r278803
2019-11-28 09:36:06 +01:00
Jakub Jelinek
99150b053e re PR c++/92695 (P1064R0 - virtual constexpr fails if object taken from array)
PR c++/92695
	* decl2.c (mark_used): Don't call note_vague_linkage_fn for pure
	virtual functions, even if they are declared inline.

	* g++.dg/warn/inline3.C: New test.

From-SVN: r278802
2019-11-28 09:06:09 +01:00
Jan Hubicka
f160cd13fb Handle correctly global0 and global counters in profile_count::to_sreal_scale
This patch fixes problem in profile_count::to_sreal_scale.  We our porfile
counters can be function local, global (ipa) or function local but globally 0.
The last is used to hold static estimates for functions executed 0 times in
profile.  Now only one 64bit value is stored and if we compute frequency
of global0 counter in global counter we mix them up and return non-zero value
incorrectly.

I also implemented unit test, but will commit sanity checking separately from
fixes: there are multiple bugs in this area I tracked down.

	* profile-count.c (profile_count::to_sreal_scale): Handle correctly
	combination of globa0 and global counters..

From-SVN: r278801
2019-11-28 07:31:26 +00:00
Kewen Lin
34b7ae1dd5 [rs6000] Fix PR92566 by checking VECTOR_UNIT_NONE_P
As Segher pointed out in PR92566, we shouldn't offer some vector modes which
aren't supported under current setting.  This patch is to make it check by
VECTOR_UNIT_NONE_P which is initialized as current architecture masks.

2019-11-28  Kewen Lin  <linkw@gcc.gnu.org>

    PR target/92566
    * gcc/config/rs6000/rs6000.c (rs6000_preferred_simd_mode): Check by
    VECTOR_UNIT_NONE_P instead.

From-SVN: r278800
2019-11-28 06:34:31 +00:00
Hongtao Liu
9c9cb582fc sse.md (avx512f_maskcmp<mode>3): Refine VF to VF_AVX512VL.
* gcc/config/i386/sse.md (avx512f_maskcmp<mode>3):
	 Refine VF to VF_AVX512VL.

From-SVN: r278799
2019-11-28 05:20:37 +00:00
GCC Administrator
349cf87f10 Daily bump.
From-SVN: r278794
2019-11-28 00:16:21 +00:00
Michael Meissner
db3e062515 Reformat movdi_internal64.
2019-11-26  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000.md (movdi_internal64): Reformat.

From-SVN: r278788
2019-11-28 00:11:28 +00:00
Michael Meissner
4a54de9dbd Reformat movsi_internal.
2019-11-27  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000.md (movsi_internal): Reformat.

From-SVN: r278787
2019-11-27 23:04:04 +00:00
Jason Merrill
1a29110638 Implement P1814R0, CTAD for alias templates.
This patch implements C++20 class template argument deduction for alias
templates, which works by a moderately arcane transformation of the
deduction guides for the underlying class template.  When implementing it,
it seemed that I could simplify the rules in the draft a bit and get
essentially the same effect; I'll be emailing the committee to that effect
soon.

gcc/cp/
	* pt.c (rewrite_tparm_list): Factor out of build_deduction_guide.
	(maybe_aggr_guide): Check for copy-init here.
	(alias_ctad_tweaks, deduction_guides_for): New.
	(ctor_deduction_guides_for): Factor out of do_class_deduction.
	(ctad_template_p): New.
	* parser.c (cp_parser_simple_type_specifier): Use it.
	* constraint.cc (append_constraint): New.
gcc/c-family/
	* c-cppbuiltin.c (c_cpp_builtins): Update __cpp_deduction_guides.

From-SVN: r278786
2019-11-27 17:05:53 -05:00
Jason Merrill
1f41df916c Fix constrained alias template transparency.
A constrained alias template can't be treated as equivalent to its
underlying template/type for much the same reason that an alias template
like void_t can't; we're relying on checking during substitution.

	* cxx-pretty-print.c (pp_cxx_unqualified_id): Handle alias
	template-id.
	* pt.c (complex_alias_template_p): True if constraints.
	(get_underlying_template, tsubst): Check alias constraints.
	(push_template_decl_real): Set alias constraints here.
	* parser.c (cp_parser_alias_declaration): Not here.
	* constraint.cc (get_constraints): Take const_tree.

From-SVN: r278785
2019-11-27 17:05:47 -05:00
Jason Merrill
96cbfa7ff8 PR c++/92206 - ICE with typedef to dependent alias.
rsandifo's patch for 92206 demonstrated a problem with the existing checking
for alias template specializations: they were returning false for a typedef
to an alias template specialization.  Which is sometimes what the caller
wants, and sometimes not: Sometimes we're interested in whether the type was
written as an alias template-id, and sometimes whether it represents one.

The testcase illustrates a case that remained wrong with the earlier patch:
if the typedef is itself an alias template specialization, we can't strip an
underlying dependent alias.

	* pt.c (dependent_alias_template_spec_p)
	(alias_template_specialization_p): Add transparent_typedefs
	parameter.
	(iterative_hash_template_arg, any_template_parm_r)
	(primary_template_specialization_p, tsubst, dependent_type_p_r):
	Adjust.
	* decl.c (check_elaborated_type_specifier): Adjust.
	* error.c (dump_template_bindings, dump_aggr_type): Adjust.

From-SVN: r278784
2019-11-27 17:05:41 -05:00
Peter Bergner
a92cc0da1c Do not define DFP builtin functions, if DFP has been disabled.
PR bootstrap/92661
	* config/rs6000/rs6000-call.c: (def_builtin): Do not define the
	builtin if we don't have an actual type.
	(builtin_function_type): If the builtin function uses a DFP type
	and decimal float has been disabled, then return NULL_TREE.

From-SVN: r278783
2019-11-27 14:55:56 -06:00
Thomas Schwinge
b1a73b4894 Fix 'libgomp.fortran/target-print-1.f90', 'libgomp.oacc-fortran/print-1.f90' for offload target nvptx
libgomp/
	* testsuite/lib/libgomp.exp
	(check_effective_target_offload_target_nvptx): New proc.
	* testsuite/libgomp.fortran/target-print-1.f90: Use it with
	'dg-skip-if'.
	* testsuite/libgomp.oacc-fortran/print-1.f90: Likewise.
	* testsuite/libgomp.fortran/target-print-1-nvptx.f90: New file.
	* testsuite/libgomp.oacc-fortran/print-1-nvptx.f90: Likewise.

From-SVN: r278779
2019-11-27 18:50:55 +01:00
Jakub Jelinek
fa21363375 re PR rtl-optimization/92510 (ICE in native_encode_rtx, at simplify-rtx.c:6272)
PR rtl-optimization/92510
	* combine.c (gen_lowpart_for_combine): Only transform lowpart subreg
	of comparison into a comparison with different mode if both imode and
	omode are scalar integral modes.

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

From-SVN: r278777
2019-11-27 17:32:54 +01:00
Andrew Sutton
861d4af8d8 re PR c++/92236 ([concepts] Explain non-satisfaction in static_assert)
2019-11-27  Andrew Sutton  <asutton@lock3software.com>

	PR c++/92236
	Defer evaluation of concept checks so that static assertions can
	emit more detailed diagnostics.

gcc/cp/
	* constexpr.c (cxx_eval_call_expression): Handle concept checks.
	(cxx_eval_constant_expression): Diagnose misuse of function concepts
	as template-id expressions. Follow the usual return path for results.
	(cxx_eval_outermost_constant_expr): Avoid calling
	cp_get_callee_fndecl_nofold for function concepts.
	* constraint.cc (build_function_check): Fully type the concept check
	so that we don't ICE in conversions.
	* cp-gimplify.c (cp_genericize_r) [CALL_EXPR]: Handle concept checks.
	[TEMPLATE_ID_EXPR] Likewise.
	* cvt.c (convert_to_void): Always evaluate concept checks so we don't
	accidentally ignore them. Substitution during satisfaction can make
	a program ill-formed (example in g++.dg/cpp2a/concepts6.C).
	* pt.c (tsubst_copy_and_build): [CALL_EXPR]: Don't evaluate concepts.
	[TEMPLATE_ID_EXPR]: Likewise.
	* semantics.c (finish_call_expr): Don't evaluate concepts.
	(finish_id_expression_1): Likewise.
	(finish_static_assert): Preserve the original condition so we can
	diagnose concept errors when a check returns false.

gcc/testsuite/
	* g++.dg/cpp2a/concepts-iconv1.C: Update diagnostics.
	* g++.dg/cpp2a/concepts-requires5.C: Likewise.
	* g++.dg/cpp2a/concepts6.C: New test.

From-SVN: r278775
2019-11-27 15:23:02 +00:00
Andrew Sutton
50e0c6e429 re PR c++/92439 ([concepts] trunk crashes on constraint satisfaction failure)
2019-11-27  Andrew Sutton  <asutton@lock3software.com>

	PR c++/92439
	Improve quality of diagnostics for subexpressions that need parens.

gcc/cp/
	* parser.c (cp_parser_requires_clause_opt): Add a flag to indicate
	when parsing a requires-clause before lambda parameters, and...
	(cp_parser_lambda_declarator_opt): ... use that here ...
	(cp_parser_type_parameter): ... and here ...
	(cp_parser_late_return_type_opt): ... and here ...
	(cp_parser_explicit_template_declaration): ... and here.
	(cp_parser_diagnose_ungrouped_constraint_plain): Adjust the message
	because this can apply to subexpressions that are not immediately
	after a requires-clause.
	(cp_parser_diagnose_ungrouped_constraint_rich): Likewise.
	(primary_constraint_error): New.
	(cp_parser_constraint_requires_parens): New.
	(cp_parser_unary_constraint_requires_parens): New.
	(cp_parser_constraint_primary_expression): Check for unary expressions
	before parsing the primary expression. Also check for binary and
	postfix operators after a successful parse of the primary expression.
	Force a re-parse if the result would form a lower-precedence string.
	(cp_parser_constraint_logical_and_expression): Propagate lambda flag;
	move checks for ill-formed constraints into the constraint primary
	expression.
	(cp_parser_constraint_logical_or_expression): Likewise.
	(cp_parser_requires_clause_expression): Propagate lambda flag.

gcc/testsuite/
	* g++.dg/cpp2a/concepts-requires20.C: New.

From-SVN: r278774
2019-11-27 15:16:37 +00:00
Andrew Sutton
72479e3243 re PR c++/88395 (ICE: Segmentation fault signal terminated program cc1plus, with -std=c++2a -fconcepts)
2019-11-27  Andrew Sutton  <asutton@lock3software.com>

	PR c++/88395
	Prevent recursive satisfaction by adding requests to the instantiation
	stack.

gcc/cp/
	* constraint.cc (satisfy_declaration_constraints): Push tinst levels
	around satisfaction.

gcc/testsuite/
	* g++.dg/cpp2a/concepts-pr88395.C: New.
	* g++.dg/cpp2a/concepts-recursive-sat1.C: New.
	* g++.dg/cpp2a/concepts-recursive-sat2.C: New.
	* g++.dg/cpp2a/concepts-recursive-sat3.C: New.

From-SVN: r278773
2019-11-27 15:09:22 +00:00