Commit Graph

173263 Commits

Author SHA1 Message Date
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
Vladimir Makarov
864233f111 re PR rtl-optimization/90007 (ICE in extract_constrain_insn_cached, at recog.c:2223)
2019-11-27  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/90007
	* recog.c (constrain_operands): Permit hard registers too for
	memory when LRA is used.

2019-11-27  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/90007
	* gcc.target/i386/pr90007.c: New test.

From-SVN: r278770
2019-11-27 14:24:47 +00:00
Andrew Sutton
1906392b2c Diagnose certain constraint errors as hard errors, but otherwise treat them the same as normal SFINAE-type errors.
2019-11-27  Andrew Sutton  <asutton@lock3software.com>

	Diagnose certain constraint errors as hard errors, but otherwise treat
	them the same as normal SFINAE-type errors. Also, generally clean up
	the satisfaction functions.

gcc/cp/
	* constexpr.c (cxx_eval_constant_expression): Use
	evaluate_concept_check.
	* constraint.cc (normalize_concept_definition): Accept a diagnostic
	flag and only cache when not diagnosing errors.
	(decl_satisfied_cache): Map to trees instead of bools.
	(satisfy_atom): Guarantee a location for the errors, propagate complain
	flags to force_rvalue, and emit errors for non-boolean constraints.
	(get_normalized_constraints_and_args): New overloads. Factored out of
	satisfy_constraint_expression and satisfy_declaration_constraints.
	(satisfy_constraint_expression): Propagate diagnostic info to
	normalization.
	(satisfy_declaration_constraints): New. Factored out of
	constraints_satisfied_p.
	(constraint_satisfaction_value): New. Calls
	satisfy_constraint_expression or satisfy_declaration_constraints.
	(constraints_satisfied_p): Call constraint_satisfaction_value.
	(evaluate_concept_check): Don't take tsubst_falgs_t. Replay
	satisfaction if an error is encountered.
	(current_failed_constraint): Moved from pt.c.
	(diagnose_constraints): Call constraint_satisfaction_value.
	* cp-tree.h: Update declarations.
	* pt.c (current_failed_constraint): Moved to constraint.cc.
	* semantics.c (finish_id_expression_1): Remove a duplicate case.

gcc/testsuite/
	* g++.dg/concepts/pr84330.C: Update diagnostics.
	* g++.dg/cpp2a/concepts-requires2.C: Likewise.

From-SVN: r278768
2019-11-27 14:02:49 +00:00
Bernd Schmidt
45a454883e m68k.c (m68k_output_compare_fp): Restore differences between Coldfire and regular m68k.
* config/m68k/m68k.c (m68k_output_compare_fp): Restore differences
	between Coldfire and regular m68k.
	* config/m68k/m68k.md (cmp1_cf_constraints): Disallow constants.

From-SVN: r278767
2019-11-27 13:07:44 +00:00
Richard Biener
477daf831a target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove.
2019-11-27  Richard Biener  <rguenther@suse.de>

	* target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove.
	* targhooks.c (default_builtin_vectorized_conversion): Likewise.
	* targhooks.h (default_builtin_vectorized_conversion): Likewise.
	* optabs-tree.c (supportable_convert_operation): Do not call
	targetm.vectorize.builtin_conversion.  Remove unused decl parameter.
	* optabs-tree.h (supportable_convert_operation): Adjust.
	* doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove.
	* doc/tm.texi: Regenerate.
	* tree-ssa-forwprop.c (simplify_vector_constructor): Adjust.
	* tree-vect-generic.c (expand_vector_conversion): Likewise.
	* tree-vect-stmts.c (vect_gen_widened_results_half): Remove
	unused decl parameter and adjust.
	(vect_create_vectorized_promotion_stmts): Likewise.
	(vectorizable_conversion): Adjust.

From-SVN: r278765
2019-11-27 12:22:02 +00:00
Richard Biener
88feafba3c re PR tree-optimization/92690 (vector CTOR optimization performs invalid conversion)
2019-11-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92690
	* tree-ssa-forwprop.c (simplify_vector_constructor): Avoid
	converting elements not originally converted.

	* gcc.dg/torture/pr92690.c: New testcase.
	* gcc.dg/tree-ssa/forwprop-35.c: Adjust.

From-SVN: r278764
2019-11-27 12:16:54 +00:00
Jakub Jelinek
b7b848f5d7 re PR fortran/91944 (ICE in gfc_conv_array_initializer, at fortran/trans-array.c:6156)
PR fortran/91944
	* simplify.c (gfc_simplify_spread): Check gfc_init_expr_flag instead
	of gfc_current_ns->sym_root->n.sym->attr.flavor == FL_PARAMETER.

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

From-SVN: r278762
2019-11-27 11:00:50 +01:00
Tobias Burnus
90ca6847bb PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0
PR middle-end/92463
        * configure.ac: Use MPFR_RNDN instead of GMP's MP_RNDN.
        * configure: Regenerate

        gcc/
        PR middle-end/92463
        * builtins.c (do_mpfr_ckconv, do_mpc_ckconv, do_mpfr_remquo,
        do_mpfr_lgamma_r, do_mpc_arg2): Use MPFR_RNDx instead of GMP_RNDx,
        mpfr_rnd_t instead of mp_rnd_t.
        * fold-const-call.c (do_mpfr_ckconv, do_mpfr_arg1, do_mpfr_sincos,
        do_mpfr_arg2, do_mpfr_arg3, do_mpc_arg1, do_mpc_arg2): Likewise.
        * gimple-ssa-sprintf.c (format_floating_max, format_floating):
        Use mpfr_exp_t instead of mp_exp_t.
        * real.c (real_from_string, dconst_e_ptr, dconst_sqrt2_ptr): Use
        MPFR_RNDx instead of GMP_RNDx.
        * realmpfr.c (real_from_mpfr, mpfr_from_real): Use mpfr_rnd_t and
        mpfr_exp_t instead mp_rnd_t and mp_exp_t, respectively.
        * realmpfr.h (real_from_mpfr, mpfr_from_real): Use mpfr_rnd_t instead
        of mp_rnd_t and remove MPFR_RNDx poisoning.
        * ubsan.c (ubsan_instrument_float_cast): MPFR_RNDx instead of GMP_RNDx.

        fortran/
        PR middle-end/92463
        * arith.c (gfc_check_real_range): Replace mp_exp_t by mpfr_exp_t.

From-SVN: r278761
2019-11-27 10:16:24 +01:00
Kewen Lin
1f9fae2809 [PATCH] Fix PR91790 by considering different first_stmt_info for realign
As PR91790 exposed, when we have one slp node whose first_stmt_info_for_drptr
is different from first_stmt_info, it's possible that the first_stmt DR isn't
initialized yet before stmt SLP_TREE_SCALAR_STMTS[0] of slp node. So we
shouldn't use first_stmt_info for vect_setup_realignment, instead we can use
the one based on first_stmt_info_for_drptr DR with additional adjustment by
bumping the distance from first_stmt DR.

gcc/ChangeLog

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

    PR tree-optimization/91790
    * gcc/tree-vect-stmts.c (vectorizable_load): Use the adjusted DR for
    vect_setup_realignment when first_stmt_info is different from
    first_stmt_info_for_drptr.

From-SVN: r278760
2019-11-27 09:08:20 +00:00
Jakub Jelinek
66143cdfd1 re PR c++/92524 (ICE in short program with constexpr and std::array)
PR c++/92524
	* tree.c (replace_placeholders_r): Don't walk constructor elts with
	RANGE_EXPR indexes.

	* g++.dg/cpp0x/pr92524.C: New test.

From-SVN: r278759
2019-11-27 10:04:40 +01:00
Richard Biener
1fa715db54 re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang)
2019-11-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92645
	* tree-ssa-forwprop.c (simplify_vector_constructor): Handle
	CTORs with just a subset of the original vectors.

	* gcc.target/i386/pr92645-2.c: New testcase.
	* gcc.target/i386/pr92645-3.c: Likewise.

From-SVN: r278758
2019-11-27 08:56:23 +00:00
Richard Biener
cd3f923b0d re PR lto/92674 (ICE in gimple_phi_arg, at gimple.h:4406 since r240291)
2019-11-27  Richard Biener  <rguenther@suse.de>

	PR middle-end/92674
	* tree-inline.c (expand_call_inline): Delay purging EH/abnormal
	edges and instead record blocks in bitmap.
	(gimple_expand_calls_inline): Adjust.
	(fold_marked_statements): Delay EH cleanup until all folding is
	done.
	(optimize_inline_calls): Do EH/abnormal cleanup for calls after
	inlining finished.

From-SVN: r278757
2019-11-27 08:52:17 +00:00
Bernd Schmidt
af2f620578 Allow autoinc in jumps, but only when using reload.
* auto-inc-dec.c (merge_in_block): Allow autoinc in jumps unless
	LRA is enabled.
	* combine.c (can_combine_p): Disallow autoinc in jumps unless LRA is
	disabled.

From-SVN: r278756
2019-11-27 03:31:24 +00:00
Jason Merrill
6821245b3f Remember the location of a variable template-id.
I noticed that tsubst of a TEMPLATE_ID_EXPR was losing the location
information from its EXPR_LOCATION.  Then I noticed that
cxx_eval_constant_expression was also throwing away location information for
variable references.

	* pt.c (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Remember the
	location of a variable template-id.
	* constexpr.c (cxx_eval_constant_expression): Get expr location
	before stripping location wrappers.
	(non_const_var_error): Take location argument.

From-SVN: r278755
2019-11-26 22:14:33 -05:00
Jakub Jelinek
88b34a4811 re PR debug/92664 (Wrong .debug_line section information when compiling stdin input with -g3)
PR debug/92664
	* dwarf2out.c (lookup_filename): Use "<stdin>" instead of "".

From-SVN: r278752
2019-11-27 01:23:39 +01:00
GCC Administrator
b592c0ea86 Daily bump.
From-SVN: r278751
2019-11-27 00:16:19 +00:00
Paolo Carlini
24243b5a8a typeck.c (cp_build_unary_op): Consistently use the accurate location in seven additional diagnostic messages.
/cp
2019-11-26  Paolo Carlini  <paolo.carlini@oracle.com>

	* typeck.c (cp_build_unary_op): Consistently use the accurate
	location in seven additional diagnostic messages.
	(cp_build_compound_expr): Use cp_expr_loc_or_input_loc in one place.

/testsuite
2019-11-26  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/cpp1z/bool-increment1.C: Test location(s) too.
	* g++.dg/expr/bitfield3.C: Likewise.
	* g++.dg/expr/bitfield4.C: Likewise.
	* g++.dg/expr/bitfield5.C: Likewise.
	* g++.dg/expr/bitfield6.C: Likewise.
	* g++.dg/expr/bool1.C: Likewise.
	* g++.dg/expr/bool2.C: Likewise.
	* g++.dg/expr/bool3.C: Likewise.
	* g++.dg/expr/bool4.C: Likewise.
	* g++.dg/expr/lval3.C: Likewise.
	* g++.dg/other/error18.C: Likewise.
	* g++.dg/warn/Wpointer-arith-1.C: Likewise.
	* g++.old-deja/g++.bugs/900212_01.C: Likewise.
	* g++.old-deja/g++.bugs/900428_02.C: Likewise.
	* g++.old-deja/g++.jason/rfg14.C: Likewise.
	* g++.old-deja/g++.other/overload11.C: Likewise.

From-SVN: r278743
2019-11-27 00:00:35 +00:00
Martin Sebor
d86d8b35dd PR tree-optimization/92683 - strncmp incorrect result with equal substrings and non-const bound
gcc/testsuite/ChangeLog:

	PR tree-optimization/92683
	* gcc.dg/strcmpopt_8.c: New test.
	* gcc.dg/strcmpopt_9.c: New test.

gcc/ChangeLog:

	PR tree-optimization/92683
	* gimple-fold.c (gimple_fold_builtin_string_compare): Restore a test
	inadvertently removed in a previous change.  Rename local variable
	for clarity.

From-SVN: r278742
2019-11-26 16:56:22 -07:00
Joel Hutton
e4c935cb98 Update vect_char_add target selector to use its own cache
This patch updates the vect_char_add target selector to use its own
cache instead of the vect_int cache.

This was causing a situation where bb-slp-40.c would fail on sparc when
run after other tests that use the vect_int target selector, but pass
when run on its own.

2019-11-26  Joel Hutton  <Joel.Hutton@arm.com>

gcc/testsuite/
	PR testsuite/92391
	* lib/target-supports.exp (check_effective_target_vect_char_add):
	Use a separate cache entry from vect_int.

From-SVN: r278738
2019-11-26 22:11:39 +00:00
Jakub Jelinek
4e4a8c28f3 re PR c++/92648 (Handling of unknown attributes)
PR c++/92648
	* parser.c (cp_parser_std_attribute): For unknown attributes,
	skip balanced token seq instead of trying to parse
	attribute-argument-clause as expression list.  Formatting fix.

	* g++.dg/cpp0x/gen-attrs-71.C: New test.

From-SVN: r278737
2019-11-26 22:58:22 +01:00
Jakub Jelinek
05d6cb1a85 re PR c++/61414 (enum class bitfield size-checking needs a separate warning flag controlling it)
PR c++/61414
	* c-attribs.c (handle_mode_attribute): Add mode attribute to
	ENUMERAL_TYPEs.

	* class.c (enum_to_min_precision): New hash_map.
	(enum_min_precision): New function.
	(check_bitfield_decl): Use it.

	* g++.dg/cpp0x/enum23.C: Remove xfail.
	* g++.dg/cpp0x/enum28.C: New test.

From-SVN: r278736
2019-11-26 22:57:27 +01:00
Jerry DeLisle
1f7ed00ebf Insert missed log entry.
From-SVN: r278735
2019-11-26 21:29:30 +00:00
Jerry DeLisle
bfbafcb6b2 Remove entry committed to wrong log.
From-SVN: r278734
2019-11-26 21:28:14 +00:00