Commit Graph

185824 Commits

Author SHA1 Message Date
Michael Forney 3a01d8eec2 [PATCH] config: Backport "Rely less on internal symbols" (serial 69) to gettext.m4
config

	* gettext.m4 (AM_GNU_GETTEXT): Skip checks for the internal
	symbols _nl_msg_cat_cntr, _nl_domain_bindings, and
	_nl_expand_alias, if __GNU_GETTEXT_SUPPORTED_REVISION is defined.
	Backport of gettext serial 68 patch.
2021-06-13 22:26:03 -04:00
GCC Administrator 4e70c34e5c Daily bump. 2021-06-14 00:16:35 +00:00
Uros Bizjak 681143b9b9 i386: Improve variable permutation insn avoidance [PR101021]
Emit constant permutation insn directly from expand_vec_perm_shufb.

2021-06-13  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	PR target/101021
	* config/i386/i386-expand.c (expand_vec_perm_pshufb):
	Emit constant permutation insn directly from here.
2021-06-13 21:51:33 +02:00
Jason Merrill 291cd193f8 c: adjust [[maybe_unused]] testcase
Another testcase update needed for my r12-1405 commit.

gcc/testsuite/ChangeLog:

	* gcc.dg/c2x-attr-maybe_unused-1.c: Expect no warnings.
2021-06-13 14:19:06 -04:00
Trevor Saunders 3f207ab314 use range based for loops to iterate over vec<>
This changes users of FOR_EACH_VEC_ELT to use range based for loops,
where the index variables are otherwise unused.  As such the index
variables are all deleted, producing shorter and simpler code.

Signed-off-by: Trevor Saunders <tbsaunde@tbsaunde.org>

gcc/analyzer/ChangeLog:

	* call-string.cc (call_string::call_string): Use range based for
	to iterate over vec<>.
	(call_string::to_json): Likewise.
	(call_string::hash): Likewise.
	(call_string::calc_recursion_depth): Likewise.
	* checker-path.cc (checker_path::fixup_locations): Likewise.
	* constraint-manager.cc (equiv_class::equiv_class): Likewise.
	(equiv_class::to_json): Likewise.
	(equiv_class::hash): Likewise.
	(constraint_manager::to_json): Likewise.
	* engine.cc (impl_region_model_context::on_svalue_leak):
	Likewise.
	(on_liveness_change): Likewise.
	(impl_region_model_context::on_unknown_change): Likewise.
	* program-state.cc (sm_state_map::set_state): Likewise.
	* region-model.cc (test_canonicalization_4): Likewise.

gcc/ChangeLog:

	* attribs.c (find_attribute_namespace): Iterate over vec<> with
	range based for.
	* auto-profile.c (afdo_find_equiv_class): Likewise.
	* gcc.c (do_specs_vec): Likewise.
	(do_spec_1): Likewise.
	(driver::set_up_specs): Likewise.
	* gimple-loop-jam.c (any_access_function_variant_p): Likewise.
	* gimple-ssa-store-merging.c (compatible_load_p): Likewise.
	(imm_store_chain_info::try_coalesce_bswap): Likewise.
	(imm_store_chain_info::coalesce_immediate_stores): Likewise.
	(get_location_for_stmts): Likewise.
	* graphite-poly.c (print_iteration_domains): Likewise.
	(free_poly_bb): Likewise.
	(remove_gbbs_in_scop): Likewise.
	(free_scop): Likewise.
	(dump_gbb_cases): Likewise.
	(dump_gbb_conditions): Likewise.
	(print_pdrs): Likewise.
	(print_scop): Likewise.
	* ifcvt.c (cond_move_process_if_block): Likewise.
	* lower-subreg.c (decompose_multiword_subregs): Likewise.
	* regcprop.c (pass_cprop_hardreg::execute): Likewise.
	* sanopt.c (sanitize_rewrite_addressable_params): Likewise.
	* sel-sched-dump.c (dump_insn_vector): Likewise.
	* store-motion.c (store_ops_ok): Likewise.
	(store_killed_in_insn): Likewise.
	* timevar.c (timer::named_items::print): Likewise.
	* tree-cfgcleanup.c (cleanup_control_flow_pre): Likewise.
	(cleanup_tree_cfg_noloop): Likewise.
	* tree-data-ref.c (dump_data_references): Likewise.
	(print_dir_vectors): Likewise.
	(print_dist_vectors): Likewise.
	(dump_data_dependence_relations): Likewise.
	(dump_dist_dir_vectors): Likewise.
	(dump_ddrs): Likewise.
	(create_runtime_alias_checks): Likewise.
	(free_subscripts): Likewise.
	(save_dist_v): Likewise.
	(save_dir_v): Likewise.
	(invariant_access_functions): Likewise.
	(same_access_functions): Likewise.
	(access_functions_are_affine_or_constant_p): Likewise.
	(find_data_references_in_stmt): Likewise.
	(graphite_find_data_references_in_stmt): Likewise.
	(free_dependence_relations): Likewise.
	(free_data_refs): Likewise.
	* tree-inline.c (copy_debug_stmts): Likewise.
	* tree-into-ssa.c (dump_currdefs): Likewise.
	(rewrite_update_phi_arguments): Likewise.
	* tree-ssa-propagate.c (clean_up_loop_closed_phi): Likewise.
	* tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr):
	Likewise.
	(vect_slp_analyze_node_dependences): Likewise.
	(vect_slp_analyze_instance_dependence): Likewise.
	(vect_record_base_alignments): Likewise.
	(vect_get_peeling_costs_all_drs): Likewise.
	(vect_peeling_supportable): Likewise.
	* tree-vectorizer.c (vec_info::~vec_info): Likewise.
	(vec_info::free_stmt_vec_infos): Likewise.

gcc/cp/ChangeLog:

	* constexpr.c (cxx_eval_call_expression): Iterate over vec<>
	with range based for.
	(cxx_eval_store_expression): Likewise.
	(cxx_eval_loop_expr): Likewise.
	* decl.c (wrapup_namespace_globals): Likewise.
	(cp_finish_decl): Likewise.
	(cxx_simulate_enum_decl): Likewise.
	* parser.c (cp_parser_postfix_expression): Likewise.
2021-06-13 12:08:01 -04:00
Jeff Law 8a7d54b1e1 [committed] More improvements to H8 logicals for test/compare elimination
gcc/
	* config/h8300/logical.md (<code>qi3_1<cczn>): New pattern.
	(andqi3_1<cczn>): Removed.
	(<ors>qi3_1): Do not split for IOR/XOR a single bit.
	(H8/SX bit logicals): Split out from other patterns.
	* config/h8300/multiply.md (mulqihi3_const<cczn>): Renamed from
	mulqihi3_const_clobber_flags.
	(mulqihi3<cczn>, mulhisi3_const<cczn>, mulhisi3<cczn>): Similarly
2021-06-13 11:18:14 -04:00
H.J. Lu 3f04e37825 x86: Replace ix86_red_zone_size with ix86_red_zone_used
Add red_zone_used to machine_function to track if red zone is used.
When expanding function prologue, set red_zone_used to true if red
zone is used.

gcc/

	PR target/101023
	* config/i386/i386.c (ix86_expand_prologue): Set red_zone_used
	to true if red zone is used.
	(ix86_output_indirect_jmp): Replace ix86_red_zone_size with
	ix86_red_zone_used.
	* config/i386/i386.h (machine_function): Add red_zone_used.
	(ix86_red_zone_size): Removed.
	(ix86_red_zone_used): New.
	* config/i386/i386.md (peephole2 patterns): Replace
	ix86_red_zone_size with ix86_red_zone_used.

gcc/testsuite/

	PR target/101023
	* g++.target/i386/pr101023a.C: New test.
	* g++.target/i386/pr101023b.C: Likewise.
2021-06-13 05:15:24 -07:00
Tobias Burnus d554f43c98 contrib/gcc-changelog: Check that PR in subject is in changelog
This patch checks that a '[PRnnnn]' and '(PRnnnn)' also appears as PR in the
changelog part of the commit message.  And it does likewise for 'PR comp/nnnn'
except that then also the component name is checked.  (Note that the reverse
is permitted, i.e. PR(s) only appearing in the changelog.)
To avoid false positives, PR numbers in the subject line are ignored,
if 'revert' appears.
Additionally, reject commits with a nonempty second line.

contrib/ChangeLog:

	* gcc-changelog/git_commit.py (pr_regex): Add ?P<pr> for group('pr').
	(subject_pr_regex, subject_pr2_regex): New.
	(GitInfo.__init__, GitCommit.parse_changelog): Check subject PRs.
	* gcc-changelog/git_email.py (SUBJECT_PREFIX, subject_patch_regex): New.
	(GitEmail.__init__): Parse 'Subject:' and pass it to GitInfo.
	* gcc-changelog/test_email.py (test_pr_only_in_subject,
	test_wrong_pr_comp_in_subject, test_copyright_years): New.
	* gcc-changelog/test_patches.txt (0030-PR-c-92746, pr-check1.patch):
	Update to avoid triggering the new check.
	(0001-rs6000-Support-doubleword, pr-wrong-comp.patch,
	copyright-years.patch): New.
2021-06-13 07:46:54 +02:00
GCC Administrator 8b8c391279 Daily bump. 2021-06-13 00:16:35 +00:00
David Edelsohn d64584d2fb testsuite: fix AIX testsuite failures
* g++.dg/ext/builtin-shufflevector-2.C: Ignore psabi warning.
	* gcc.dg/uninit-pr93100.c: Skip on AIX.
	* gcc.target/powerpc/pr100085.c: Require int128 and float128.
2021-06-12 14:34:05 -04:00
Jason Merrill c0f769fa31 c-family: don't warn for [[maybe_unused]] on data member
The C++17 standard (and C2x) says that [[maybe_unused]] may be applied to a
non-static data member, so we shouldn't warn about it.  And I don't see a
reason not to handle a FIELD_DECL the same as any other decl, by setting
TREE_USED on it.  It doesn't look like anything yet cares about that flag on
a FIELD_DECL, but setting it shouldn't hurt.

gcc/c-family/ChangeLog:

	* c-attribs.c (handle_unused_attribute): Handle FIELD_DECL.

gcc/testsuite/ChangeLog:

	* g++.dg/ext/attrib62.C: No longer warn.
	* g++.dg/diagnostic/maybe_unused1.C: New test.

gcc/ChangeLog:

	* doc/extend.texi (unused variable attribute): Applies to
	structure fields as well.
2021-06-12 12:46:28 -04:00
Jason Merrill 08e1ff9d6e c++: constexpr and array[0] [PR101029]
build_vec_init_elt exits early if we're initializing a zero-element array,
so build_vec_init needs to do the same to avoid trying to instantiate things
after we've already started throwing important bits away.

	PR c++/101029

gcc/cp/ChangeLog:

	* init.c (build_vec_init): Shortcut [0] case.

gcc/testsuite/ChangeLog:

	* g++.dg/ext/array4.C: New test.
2021-06-12 12:34:36 -04:00
Jason Merrill c4e50e500d c++: speed up looking up the current class
While looking at template instantiation tracing, I noticed that we were
frequently looking up a particular class template instance while
instantiating it.  This patch shortcuts that lookup, and speeds up compiling
stdc++.h with my (checking/unoptimized) compiler by about 3%.

gcc/cp/ChangeLog:

	* pt.c (lookup_template_class_1): Shortcut current_class_type.
2021-06-12 00:58:11 -04:00
GCC Administrator f16f65f836 Daily bump. 2021-06-12 00:16:27 +00:00
Eugene Rozenfeld 23691ddd3a Fix a typo in an AutoFDO error string
gcc/ChangeLog:

	* auto-profile.c (read_profile): fix a typo in an error string
2021-06-11 17:07:48 -07:00
Carl Love 2c4115ba9c Fix effective target for check-builtin-vec_rlnm-runnable.c test
The effective target for a Power 9 runnable test should be
p9vector_hw.

2021-06-11  Carl Love  <cel@us.ibm.com>

gcc/testsuite/ChangeLog

	* gcc.target/powerpc/check-builtin-vec_rlnm-runnable.c
	(dg-require-effective-target): Change target to p9vector_hw.
2021-06-11 17:46:18 -05:00
Thomas Schwinge 2973090c4c For 'OMP_CLAUSE' in 'dump_generic_node', dump the whole OMP clause chain
... instead of just the first clause.

	gcc/
	* tree-pretty-print.h (dump_omp_clauses): Add 'bool = true'
	default argument.
	* tree-pretty-print.c (dump_omp_clauses): Update.
	(dump_generic_node) <OMP_CLAUSE>: Use it.
	gcc/testsuite/
	* gcc.dg/gomp/simd-clones-2.c: Enhance.
2021-06-12 00:06:01 +02:00
Patrick Palka b0d73a66ae c++: Substitute into function parms in lexical order [PR96560]
This makes tsubst_arg_types substitute into a function's parameter types
in left-to-right instead of right-to-left order, in accordance with DR 1227.

	DR 1227
	PR c++/96560

gcc/cp/ChangeLog:

	* pt.c (tsubst_arg_types): Rearrange so that we substitute into
	TYPE_ARG_TYPES in forward order while short circuiting
	appropriately.  Adjust formatting.

gcc/testsuite/ChangeLog:

	* g++.dg/template/sfinae-dr1227.C: New test.
2021-06-11 16:00:52 -04:00
Jonathan Wakely 1e690757d3 libstdc++: Fix filesystem::path comparisons for C++23
In C++23 there is a basic_string_view(Range&&) constructor, which is
constrained to take a range (specifically, a contiguous_range). When the
filesystem::path comparison operators call lhs.compare(rhs) the overload
taking a string_view is considered, which means checking whether path
satisfies the range concept. That satisfaction result changes depending
whether path::iterator is complete, which is ill-formed; no diagnostic
required. To avoid the problem, this change ensures that the overload
resolution is performed in a context where path::iterator is complete
and the range concept is satisfied. (The result of overload resolution
is always that the compare(const path&) overload is the best match, but
we still have to consider the compare(basic_string_view<value_type>) one
to decide if it even participates in overload resolution).

For std::filesystem::path we can't define the comparison operators later
in the file, because they are hidden friends, so a new helper is
introduced that gets defined when everything else is complete.

For std::experimental::filesystem::path we can just move the definitions
of the comparison operators later in the file.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/bits/fs_path.h (operator==, operator<=>): Use new
	_S_compare function.
	(path::_S_compare): New function to call path::compare in a
	context where path::iterator is complete.
	* include/experimental/bits/fs_path.h (operator<, operator==):
	Define after path::iterator is complete.
	* testsuite/27_io/filesystem/path/native/conv_c++23.cc: New
	test.
	* testsuite/experimental/filesystem/path/native/conv_c++23.cc:
	New test.
2021-06-11 19:18:11 +01:00
Iain Buclaw 68f46862d3 d: foreach over a tuple doesn't work on 16-bit targets (PR100999)
Improves semantic passes in the front-end around the `foreach' and
`static foreach' statements to be more resilient to compiling in a
minimal D runtime environment.  Checking of the index type has been
improved as well so now there won't be needless compiler errors when
using 8 or 16-bit integers as index types when the size fits the
expected loop range.

gcc/d/ChangeLog:

	PR d/100999
	* dmd/MERGE: Merge upstream dmd 7a3808254.

libphobos/ChangeLog:

	PR d/100999
	* src/MERGE: Merge upstream phobos 55bb17543.
2021-06-11 19:42:13 +02:00
Srinath Parvathaneni b13f297f01 arm: Fix polymorphic variants failing with undefined reference to `__ARM_undef` error.
This patch fixes the issue mentioned in PR101016, which is mve polymorphic variants
failing at linking with undefined reference to "__ARM_undef" error.

gcc/ChangeLog:

2021-06-11  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/101016
	* config/arm/arm_mve.h (__arm_vld1q): Change __ARM_mve_coerce(p0,
	int8_t const *) to __ARM_mve_coerce1(p0, int8_t *) in the argument for
	the polymorphic variants matching code.
	(__arm_vld1q_z): Likewise.
	(__arm_vld2q): Likewise.
	(__arm_vld4q): Likewise.
	(__arm_vldrbq_gather_offset): Likewise.
	(__arm_vldrbq_gather_offset_z): Likewise.

gcc/testsuite/ChangeLog:

2021-06-11  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/101016
	* gcc.target/arm/mve/intrinsics/pr101016.c: New test.
2021-06-11 18:12:08 +01:00
Roger Sayle a761829ae0 [PATCH] PR tree-optimization/96392 Optimize x+0.0 if x is an integer
Doh! Wrong patch version.  Sorry for the inconvenience.

2020-06-11  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	PR tree-optimization/96392
	* fold-const.h (tree_expr_maybe_real_minus_zero_p): Fix prototype.
2021-06-11 17:42:14 +01:00
Roger Sayle 5b02ed4b87 [PATCH] PR tree-optimization/96392 Optimize x+0.0 if x is an integer
The patch implements a missed optimization enhancement.  Under usual
IEEE rules, x+0.0 can't be simplified to x when x might potentially
be an IEEE minus zero (-0.0).  The current logic in the middle-end
checks whether the type of x should honor signed zeros, but with this
patch we introduce tree_expr_maybe_real_minus_zero_p that allows us
to confirm that the value can't possibly be -0.0, for example, the result
of a conversion from an integer type, or the result of fabs (or has a
type that doesn't honor signed zero).

Whilst modifying match.pd, I also converted some additional folding
transformations from "testing the type" to "testing the value".

2020-06-10  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	PR tree-optimization/96392
	* fold-const.c (fold_real_zero_addition_p): Take both arguments
	of the addition or subtraction, not just the zero.  Use this
	other argument in tests for signaling NaNs and signed zeros.
	(tree_expr_maybe_real_minus_zero_p): New predicate.
	* fold-const.h (fold_real_zero_addition_p): Update prototype.
	(tree_expr_maybe_real_minus_zero_p): New function prototype.
	* match.pd: Update calls to fold_real_zero_addition_p.
	Replace HONOR_NANS with tree_expr_maybe_nan_p.
	Replace HONOR_SIGNED_ZEROS with tree_expr_maybe_real_minus_zero_p.
	Replace HONOR_SNANS with tree_expr_maybe_signaling_nan_p.
	* tree-ssa-reassoc.c (eliminate_using_constants): Update
	call to fold_real_zero_addition_p.

gcc/testsuite/ChangeLog
	PR tree-optimization/96392
	* gcc.dg/pr96392.c: New test.
2021-06-11 17:17:58 +01:00
Richard Biener b8b80b8aa3 tree-optimization/101025 - fix store-motion dependence checking
This plugs a hole in store-motion where it fails to perform dependence
checking on conditionally executed but not store-motioned refs.

2021-06-11  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101025
	* tree-ssa-loop-im.c (sm_seq_valid_bb): Make sure to process
	all refs that require dependence checking.

	* gcc.dg/torture/pr101025.c: New testcase.
2021-06-11 18:12:30 +02:00
Srinath Parvathaneni c5ed014834 arm: Fix the mve multilib for the broken cmse support (pr99939).
The current CMSE support in the multilib build for
"-march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=auto" is broken
as specified in PR99939 and this patch fixes the issue.

gcc/testsuite/ChangeLog:

2021-06-11  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/99939
	* gcc.target/arm/cmse/cmse-18.c: Add separate scan-assembler
	directives check for target is v8.1-m.main+mve or not before
	comparing the assembly output.
	* gcc.target/arm/cmse/cmse-20.c: New test.

libgcc/ChangeLog:

2021-06-11  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/99939
	* config/arm/cmse_nonsecure_call.S: Add	__ARM_FEATURE_MVE
	macro.
	* config/arm/t-arm: To link cmse.o and cmse_nonsecure_call.o
	on passing -mcmse option.
2021-06-11 15:56:48 +01:00
Jakub Jelinek 117c642664 c++: Add C++23 consteval if support - P1938R3 [PR100974]
The following patch implements consteval if support.
There is a new IF_STMT_CONSTEVAL_P flag on IF_STMT and IF_COND is
boolean_false_node to match the non-manifestly constant evaluation
behavior, while constexpr evaluation special-cases it.  Perhaps cleaner
would be to set the condition to __builtin_is_constant_evaluated () call
but we need the IF_STMT_CONSTEVAL_P flag anyway and the IL would be larger.

And I'm not changing the libstdc++ side, where perhaps we could change
std::is_constant_evaluated definition for
 #ifdef __cpp_if_consteval
case to if consteval { return true; } else { return false; }
but we need to keep it defined to __builtin_is_constant_evaluated ()
for C++20 or older.

2021-06-11  Jakub Jelinek  <jakub@redhat.com>

	PR c++/100974
gcc/c-family/
	* c-cppbuiltin.c (c_cpp_builtins): Predefine __cpp_if_consteval for
	-std=c++2b for P1938R3 consteval if support.
gcc/cp/
	* cp-tree.h (struct saved_scope): Add consteval_if_p
	member.  Formatting fix for the discarded_stmt comment.
	(in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
	* parser.c (cp_parser_lambda_expression): Temporarily disable
	in_consteval_if_p when parsing lambda body.
	(cp_parser_selection_statement): Parse consteval if.
	* decl.c (struct named_label_entry): Add in_consteval_if member.
	(level_for_consteval_if): New function.
	(poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
	consteval if.
	* constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
	why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
	for !ctx->manifestly_const_eval.
	(cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
	condition as if it was __builtin_is_constant_evaluated call.
	(potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
	recurse on both branches.
	* cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
	as the else branch.
	* pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
	Temporarily set in_consteval_if_p when recursing on
	IF_STMT_CONSTEVAL_P then branch.
	(tsubst_lambda_expr): Temporarily disable
	in_consteval_if_p when instantiating lambda body.
	* call.c (immediate_invocation_p): Return false when
	in_consteval_if_p.
gcc/testsuite/
	* g++.dg/cpp23/consteval-if1.C: New test.
	* g++.dg/cpp23/consteval-if2.C: New test.
	* g++.dg/cpp23/consteval-if3.C: New test.
	* g++.dg/cpp23/consteval-if4.C: New test.
	* g++.dg/cpp23/consteval-if5.C: New test.
	* g++.dg/cpp23/consteval-if6.C: New test.
	* g++.dg/cpp23/consteval-if7.C: New test.
	* g++.dg/cpp23/consteval-if8.C: New test.
	* g++.dg/cpp23/consteval-if9.C: New test.
	* g++.dg/cpp23/consteval-if10.C: New test.
	* g++.dg/cpp23/feat-cxx2b.C: Add __cpp_if_consteval tests.
2021-06-11 15:52:23 +02:00
David Malcolm 9d20ec9747 analyzer: tweak priority of callstrings in worklist::key_t::cmp
While debugging another issue I noticed that the analyzer could fail to
merge nodes for control flow in which one path had called a function
and another path hadn't:

        BB
       /  \
      /    \
 fn call   no fn call
      \    /
       \  /
     join BB

The root cause was that the worklist sort function wasn't prioritizing
call strings, and thus it was fully exploring the "no function called"
path to the exit BB, and only then exploring the "within the function call"
parts of the "funcion called" path.

This patch prioritizes call strings when sorting the worklist so that
the nodes with deeper call strings are processed before those with shallower
call strings, thus allowing such nodes to be merged at the joinpoint.

gcc/analyzer/ChangeLog:
	* engine.cc (worklist::key_t::cmp): Move sort by call_string to
	before SCC.

gcc/testsuite/ChangeLog:
	* gcc.dg/analyzer/loop-0-up-to-n-by-1-with-iter-obj.c: Update
	expected number of enodes after the loop.
	* gcc.dg/analyzer/paths-8.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2021-06-11 09:30:33 -04:00
Richard Biener b9ec5ebb60 tree-optimization/101028 - fix endless SLP reassoc discovery
This fixes a missing clearing of mismatched lanes from the
fatal fail path in SLP reassoc discovery in the most conservative
way.

2021-06-11  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101028
	* tree-vect-slp.c (vect_build_slp_tree_2): When SLP
	reassoc discovery fails fatally, mark appropriate lanes
	in matches[] so.

	* gcc.dg/pr101028.c: New testcase.
2021-06-11 13:43:18 +02:00
Richard Biener fbd8a80412 tree-optimization/101026 - fix SLP re-association
Since we cannot yet encode the operation in the SLP node itself
but need a representative stmt require an existing one for now
to avoid the need to build a fake GIMPLE stmt.

2021-06-11  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101026
	* tree-vect-slp.c (vect_build_slp_tree_2): Make sure we
	have a representative for the associated chain nodes.

	* gfortran.dg/pr101026.f: New testcase.
2021-06-11 13:35:31 +02:00
Jakub Jelinek 4bdcdd8fa8 simplify-rtx: Fix up simplify_logical_relational_operation for vector IOR [PR101008]
simplify_relational_operation callees typically return just const0_rtx
or const_true_rtx and then simplify_relational_operation attempts to fix
that up if the comparison result has vector mode, or floating mode,
or punt if it has scalar mode and vector mode operands (it doesn't know how
exactly to deal with the scalar masks).
But, simplify_logical_relational_operation has a special case, where
it attempts to fold (x < y) | (x >= y) etc. and if it determines it is
always true, it just returns const_true_rtx, without doing the dances that
simplify_relational_operation does.
That results in an ICE on the following testcase, where such folding happens
during expansion (of debug stmts into DEBUG_INSNs) and we ICE because
all of sudden a VOIDmode rtx appears where it expects a vector (V4SImode)
rtx.

The following patch fixes that by moving the adjustement into a separate
helper routine and using it from both simplify_relational_operation and
simplify_logical_relational_operation.

2021-06-11  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/101008
	* simplify-rtx.c (relational_result): New function.
	(simplify_logical_relational_operation,
	simplify_relational_operation): Use it.

	* gcc.dg/pr101008.c: New test.
2021-06-11 12:59:43 +02:00
Jakub Jelinek a984da88a3 i386: Fix up *vec_concat<mode>_0_1 [PR101007]
On Fri, Apr 23, 2021 at 12:53:58PM +0800, Hongtao Liu via Gcc-patches wrote:
> -(define_insn "*vec_concatv4si_0"
> -  [(set (match_operand:V4SI 0 "register_operand"       "=v,x")
> -     (vec_concat:V4SI
> -       (match_operand:V2SI 1 "nonimmediate_operand" "vm,?!*y")
> -       (match_operand:V2SI 2 "const0_operand"       " C,C")))]
> +(define_insn "*vec_concat<mode>_0"
> +  [(set (match_operand:VI124_128 0 "register_operand"       "=v,x")
> +     (vec_concat:VI124_128
> +       (match_operand:<ssehalfvecmode> 1 "nonimmediate_operand" "vm,?!*y")
> +       (match_operand:<ssehalfvecmode> 2 "const0_operand"       " C,C")))]
>    "TARGET_SSE2"
>    "@
>     %vmovq\t{%1, %0|%0, %1}
> @@ -22154,6 +22157,24 @@ (define_insn "avx_vec_concat<mode>"
>     (set_attr "prefix" "maybe_evex")
>     (set_attr "mode" "<sseinsnmode>")])
>
> +(define_insn_and_split "*vec_concat<mode>_0"
> +  [(set (match_operand:V 0 "register_operand")
> +     (vec_select:V
> +       (vec_concat:<ssedoublevecmode>
> +         (match_operand:V 1 "nonimmediate_operand")
> +         (match_operand:V 2 "const0_operand"))
> +       (match_parallel 3 "movq_parallel"
> +         [(match_operand 4 "const_int_operand")])))]
> +  "ix86_pre_reload_split ()"
> +  "#"
> +  "&& 1"
> +  [(set (match_dup 0)
> +     (vec_concat:V (match_dup 1) (match_dup 5)))]
> +{
> +  operands[1] = gen_lowpart (<ssehalfvecmode>mode, operands[1]);
> +  operands[5] = CONST0_RTX (<ssehalfvecmode>mode);
> +})

This regressed the following testcase with -msse -mno-sse2.
The define_insn_and_split splits the permutation into *vec_concat<mode>_0
or *vec_concatv2di_0 insns which both have TARGET_SSE2 in their
conditions (for the former you can see it above), but the
define_insn_and_split matches always when the V mode's condition do,
which for V16QI/V8HI/V4SI/V2DI/V4SF modes is always (well, when those
modes are valid, which is TARGET_SSE).

2021-06-11  Jakub Jelinek  <jakub@redhat.com>

	PR target/101007
	* config/i386/sse.md (*vec_concat<mode>_0_1): Require TARGET_SSE2.

	* gcc.target/i386/sse-pr101007.c: New test.
2021-06-11 12:58:22 +02:00
Uros Bizjak 1fa991d1d7 i386: Try to avoid variable permutation instruction [PR101021]
Some permutations can be implemented without costly PSHUFB instruction, e.g.:

{ 8,9,10,11,12,13,14,15, 0,1,2,3,4,5,6,7 } with PALIGNR,

{ 0,1,2,3, 4,5,6,7, 4,5,6,7, 12,13,14,15 } with PSHUFD,

{ 0,1, 2,3, 2,3, 6,7, 8,9,10,11,12,13,14,15 } with PSHUFLW and

{ 0,1,2,3,4,5,6,7, 8,9, 10,11, 10,11, 14,15 } with PSHUFHW.

All these instructions have constant shuffle control mask and do not
need to load shuffle mask from a memory to a temporary XMM register.

2021-06-11  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	PR target/101021
	* config/i386/i386-expand.c (expand_vec_perm_pshufb): Return
	false if the permutation can be implemented with constant
	permutation instruction in wider mode.
	(canonicalize_vector_int_perm): Move above expand_vec_perm_pshufb.
	Handle V8QImode and V4HImode.

gcc/testsuite/

	PR target/101021
	* gcc.target/i386/pr101021-1.c: New test.
	* gcc.target/i386/pr101021-2.c: Ditto.
2021-06-11 12:32:40 +02:00
Martin Liska 8bf728aecc Introduce -Wcoverage-invalid-line-number
PR gcov-profile/100788

gcc/ChangeLog:

	* common.opt: Add new option.
	* coverage.c (coverage_begin_function): Emit warning instead on
	the internal compiler error.
	* doc/invoke.texi: Document the option.
	* toplev.c (process_options): Enable it by default.

gcc/testsuite/ChangeLog:

	* gcc.dg/pr100788.c: New test.
2021-06-11 11:58:20 +02:00
Martin Liska 36943c6bdd Add missing ChangeLog entry. 2021-06-11 11:36:58 +02:00
Richard Biener 336c41dbcb middle-end/101009 - fix distance vector recording
This fixes recording of distance vectors in case the DDR has just
constant equal indexes.  In that case we expect distance vectors
with zero distances to be recorded which is what was done when
any distance was computed for affine indexes.

2021-06-11  Richard Biener  <rguenther@suse.de>

	PR middle-end/101009
	* tree-data-ref.c (build_classic_dist_vector_1): Make sure
	to set *init_b to true when we encounter a constant equal
	index pair.
	(compute_affine_dependence): Also dump the actual DR_REF.

	* gcc.dg/torture/pr101009.c: New testcase.
2021-06-11 11:26:10 +02:00
GCC Administrator 43c35d0d90 Daily bump. 2021-06-11 09:09:28 +00:00
Martin Liska e01874cdae gcc-changelog: Ignore one more commit.
contrib/ChangeLog:

	* gcc-changelog/git_update_version.py: Ignore commit that
	violates rules and was somehow pushed.
2021-06-11 10:13:54 +02:00
Kewen Lin 2f5ab546e2 rs6000: Support more short/char to float conversion
For some cases that when we load unsigned char/short values from
the appropriate unsigned char/short memories and convert them to
double/single precision floating point value, there would be
implicit conversions to int first.  It makes GCC not leverage the
P9 instructions lxsibzx/lxsihzx.  This patch is to add the related
define_insn_and_split to support this kind of scenario.

Bootstrapped/regtested on powerpc64le-linux-gnu P9 and
powerpc64-linux-gnu P8.

gcc/ChangeLog:

	* config/rs6000/rs6000.md
	(floatsi<SFDF:mode>2_lfiwax_<QHI:mode>_mem_zext): New
	define_insn_and_split.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/p9-fpcvt-3.c: New test.
2021-06-11 02:43:40 -05:00
Richard Biener e9d322ced1 Use stablesort for sorting association chain
This should preserve the original association order as much as possible
for the initial SLP discovery attempt and also improve consistency.

2021-06-11  Richard Biener  <rguenther@suse.de>

	* tree-vect-slp.c (vect_build_slp_tree_2): Use stablesort
	to sort operands of the associative chain.
2021-06-11 09:29:35 +02:00
Richard Biener 367f52dcc2 Expose stable sort algorithm to gcc_sort_r and add vec::stablesort
This makes it possible to apply GCCs stable sort algorithm to vec<>
and also use it with the qsort_r compatible interface.

2021-06-10  Richard Biener  <rguenther@suse.de>

	* system.h (gcc_stablesort_r): Declare.
	* sort.cc (gcc_sort_r): Support stable sort.
	(gcc_stablesort_r): Define.
	* vec.h (vec<>::stablesort): Add.
2021-06-11 09:29:35 +02:00
Marek Polacek 26dbe85a37 c++: Extend std::is_constant_evaluated in if warning [PR100995]
Jakub pointed me at
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1938r3.html#compiler-warnings>
which shows that our existing warning could be extended to handle more
cases.  This patch implements that.

A minor annoyance was handling macros, in libstdc++ we have

  reference operator[](size_type __pos) {
      __glibcxx_assert(__pos <= size());
      ...
  }

wherein __glibcxx_assert expands to

  if (__builtin_is_constant_evaluated() && !bool(__pos <= size())
    ...

but I'm of a mind to not warn on that.

Once consteval if makes it in, we should tweak this warning one more
time.

	PR c++/100995

gcc/cp/ChangeLog:

	* constexpr.c (maybe_constexpr_fn): New.
	* cp-tree.h (maybe_constexpr_fn): Declare.
	* semantics.c (find_std_constant_evaluated_r): New.
	(maybe_warn_for_constant_evaluated): New.
	(finish_if_stmt_cond): Call it.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/is-constant-evaluated9.C: Add dg-warning.
	* g++.dg/cpp2a/is-constant-evaluated12.C: New test.
2021-06-10 22:32:21 -04:00
Patrick Palka edec2660ff c++: matching deduced template template parameters [PR67829]
During deduction, when the template of the argument for a bound ttp
is a template template parameter, we need to consider the
TEMPLATE_TEMPLATE_PARAMETER for matching rather than the TEMPLATE_DECL
thereof, because the canonical form of a template template parameter as
a template argument is the former tree, not the latter.

	PR c++/67829

gcc/cp/ChangeLog:

	* pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
	the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
	a template template parameter, adjust to the
	TEMPLATE_TEMPLATE_PARAMETER before falling through.

gcc/testsuite/ChangeLog:

	* g++.dg/template/ttp34.C: New test.
	* g++.dg/template/ttp34a.C: New test.
	* g++.dg/template/ttp34b.C: New test.
2021-06-10 18:31:21 -04:00
Patrick Palka 206db06ee3 c++: normalization of non-templated return-type-req [PR100946]
Here the satisfaction cache is conflating the satisfaction value of the
two return-type-requirements because the corresponding constrained
'auto's have level 2, but they capture an empty current_template_parms.
This ultimately causes the satisfaction cache to think the type
constraint doesn't depend on the deduced type of the expression.

When normalizing the constraints on an 'auto', the assumption made by
normalize_placeholder_type_constraints is that the level of the 'auto'
is one greater than the depth of the captured current_template_parms, an
assumption which is not holding here.  So this patch just makes n_p_t_c
adjust the normalization context appropriately in this situation.

	PR c++/100946

gcc/cp/ChangeLog:

	* constraint.cc (normalize_placeholder_type_constraints): When
	normalizing a non-templated return-type-requirement, add a dummy
	level to initial_parms.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/concepts-return-req3.C: New test.
2021-06-10 18:31:18 -04:00
Peter Bergner a325bdd195 i386: Add V8QI and other 64bit vector permutations [PR89021]
In addition to V8QI permutations, several other missing permutations are
added for 64bit vector modes for TARGET_SSSE3 and TARGET_SSE4_1 targets.

2021-06-10  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	PR target/89021
	* config/i386/i386-expand.c (ix86_split_mmx_punpck):
	Handle V2SF mode.  Emit SHUFPS to fixup unpack-high for V2SF mode.
	(expand_vec_perm_blend): Handle 64bit modes for TARGET_SSE4_1.
	(expand_vec_perm_pshufb): Handle 64bit modes for TARGET_SSSE3.
	(expand_vec_perm_pblendv): Handle 64bit modes for TARGET_SSE4_1.
	(expand_vec_perm_interleave2): Handle 64bit modes.
	(expand_vec_perm_even_odd_pack): Handle V8QI mode.
	(expand_vec_perm_even_odd_1): Ditto.
	(ix86_vectorize_vec_perm_const): Ditto.
	* config/i386/i386.md (UNSPEC_PSHUFB): Move from ...
	* config/i386/sse.md: ... here.
	* config/i386/mmx.md (*vec_interleave_lowv2sf):
	New insn_and_split pattern.
	(*vec_interleave_highv2sf): Ditto.
	(mmx_pshufbv8qi3): New insn pattern.
	(*mmx_pblendw): Ditto.
2021-06-10 23:55:24 +02:00
Ian Lance Taylor ee52bf609b libgo: update to Go1.16.5 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/326772
2021-06-10 14:41:23 -07:00
Peter Bergner 00d07ec6e1 rs6000: Add new __builtin_vsx_build_pair and __builtin_mma_build_acc built-ins
The __builtin_vsx_assemble_pair and __builtin_mma_assemble_acc built-ins
currently assign their first source operand to the first VSX register
in a pair/quad, their second operand to the second register in a pair/quad, etc.
This is not endian friendly and forces the user to generate different calls
depending on endianness.  In agreement with the POWER LLVM team, we've
decided to lightly deprecate the assemble built-ins and replace them with
"build" built-ins that automatically handle endianness so the same built-in
call and be used for both little-endian and big-endian compiles.  We are not
removing the assemble built-ins, since there is code in the wild that use
them, but we are removing their documentation to encourage the use of the
new "build" variants.

gcc/
	* config/rs6000/rs6000-builtin.def (build_pair): New built-in.
	(build_acc): Likewise.
	* config/rs6000/rs6000-call.c (mma_expand_builtin): Swap assemble
	source operands in little-endian mode.
	(rs6000_gimple_fold_mma_builtin): Handle VSX_BUILTIN_BUILD_PAIR.
	(mma_init_builtins): Likewise.
	* config/rs6000/rs6000.c (rs6000_split_multireg_move): Handle endianness
	ordering for the MMA assemble and build source operands.
	* doc/extend.texi (__builtin_vsx_build_acc, __builtin_mma_build_pair):
	Document.
	(__builtin_mma_assemble_acc, __builtin_mma_assemble_pair): Remove
	documentation.

gcc/testsuite/
	* gcc.target/powerpc/mma-builtin-4.c (__builtin_vsx_build_pair): Add
	tests.  Update expected counts.
	* gcc.target/powerpc/mma-builtin-5.c (__builtin_mma_build_acc): Add
	tests.  Update expected counts.
2021-06-10 13:56:27 -05:00
Iain Buclaw 5ae4a73057 d: Fix ICE in TypeInfoDeclaration, at dmd/declaration.c (PR100967)
Generate a stub TypeInfo class even if the root Object class is missing.
The front-end will take care of issuing an error and abort the
compilation when running semantic on constructed TypeInfo objects.

The errors issued by the code generation pass relating to missing or
disabled RTTI has been consolidated into a single function, so that a
meaningful error will be emitted before the front-end terminates.

gcc/d/ChangeLog:

	PR d/100967
	* d-frontend.cc (getTypeInfoType): Move TypeInfo checks to
	check_typeinfo_type and call new function.
	* d-tree.h (check_typeinfo_type): Declare.
	* typeinfo.cc: Include dmd/scope.h.
	(create_frontend_tinfo_types): Generate front-end types even if Object
	is missing.
	(build_typeinfo): Move TypeInfo checks to check_typeinfo_type and call
	new function.
	(check_typeinfo_type): New function.

gcc/testsuite/ChangeLog:

	PR d/100967
	* gdc.dg/pr100967.d: New test.
2021-06-10 20:19:39 +02:00
Segher Boessenkool 7a89595509 rs6000: Fix *TItype_ppc
The *TItype_ppc definitions are guarded by _ARCH_PPC64, so all
declarations using it should do so as well.

2021-06-10  Segher Boessenkool  <segher@kernel.crashing.org>
libgcc/
	* config/rs6000/quad-float128.h: Guard all uses of [U]TItype_ppc by
	_ARCH_PPC64 .
2021-06-10 15:20:09 +00:00
Aldy Hernandez 04a040d907 Use auto_vec in ssa_equiv_stack.
There is a mismatch between the new and the delete for the
ssa_equiv_stack class.  The correct idiom should have been delete[].
It has been pointed out that perhaps a better alternative is to use
an auto_vec which does everything automatically.  Plus, it is more
consistent with m_stack which is already an auto_vec.

This patch fixes the issue in PR100984.

Tested on x86-64 Linux.

gcc/ChangeLog:

        PR tree-optimization/100984
	* gimple-ssa-evrp.c  (ssa_equiv_stack): Use auto_vec for
	replacements table.
	(ssa_equiv_stack::~ssa_equiv_stack): Remove.
2021-06-10 17:03:27 +02:00
Jeff Law 6fcba9ef23 Use memory loads and extensions to eliminate redundant test/compare insns
gcc/

	* config/h8300/h8300.c (select_cc_mode): Handle MEM.  Use
	REG_P.
	* config/h8300/extensions.md: Replace _clobber_flags patterns
	with <cczn>.
2021-06-10 09:57:51 -04:00