2019-05-21 Richard Biener <rguenther@suse.de>
PR middle-end/90510
* fold-const.c (fold_read_from_vector): New function.
* fold-const.h (fold_read_from_vector): Declare.
* match.pd (VEC_PERM_EXPR): Build BIT_INSERT_EXPRs for
single-element insert permutations. Canonicalize selector
further and fix issue with last commit.
* gcc.target/i386/pr90510.c: New testcase.
From-SVN: r271463
gcc/ChangeLog:
* tree-cfg.h (split_critical_edges): Add for_edge_insertion_p
parameter with default value false to declaration.
(split_edges_for_insertion): New inline function. Wrapper for
split_critical_edges with for_edge_insertion_p = true.
* tree-cfg.c (split_critical_edges): Don't split non-critical
edges if for_edge_insertion_p is false. Fix whitespace.
* tree-ssa-pre.c (pass_pre::execute): Call
split_edges_for_insertion instead of split_critical_edges.
* gcc/tree-ssa-tail-merge.c (tail_merge_optimize): Ditto.
* gcc/tree-ssa-sink.c (pass_sink_code::execute): Ditto.
(pass_data_sink_code): Update function name in the comment.
From-SVN: r271461
* tree-ssa-uninit.c (value_sat_pred_p): This new function is a wrapper
around is_value_included_in that knows how to handle BIT_AND_EXPR.
(is_pred_expr_subset_of): Use the new function. Handle more cases where
code1 == EQ_EXPR and where code1 == BIT_AND_EXPR and thus fix some false
positives.
testsuite/
* gcc.dg/uninit-28-gimple.c: New test.
* gcc.dg/uninit-29-gimple.c: New test.
* gcc.dg/uninit-30-gimple.c: New test.
* gcc.dg/uninit-31-gimple.c: New test.
From-SVN: r271460
Due to the python 3 conversion, files should be opened in text mode,
matching stdin/stdout.
2019-05-21 Janne Blomqvist <jb@gcc.gnu.org>
* mklog: Open files in text mode.
From-SVN: r271459
c-family/
* c-ada-spec.h (enum cpp_operation): Add IS_ASSIGNMENT_OPERATOR.
* c-ada-spec.c (print_assignment_operator): New function.
(dump_ada_declaration) <FUNCTION_DECL>: Call it do dump explicit copy
assignment operators declared as methods and filter out the others.
cp/
* decl2.c (cpp_check) <IS_ASSIGNMENT_OPERATOR>: New case.
From-SVN: r271457
Upstream will drop support for Python 2.x on January 1, 2020. This
patch converts the contrib/mklog script to Python 3. The process for
the conversion was as follows.
- Use the futurize tool (https://python-future.org ) to apply the
print_with_import, except, and dict transformations.
- Remove the "from __future__ import print_function".
- Change the shebang line to search for python3 in the environment.
- Modify the run() function to return a str instead of bytes.
- Update the copyright year.
contrib/ChangeLog:
2019-05-21 Janne Blomqvist <jb@gcc.gnu.org>
* mklog: Convert to Python 3.
From-SVN: r271456
PR testsuite/90503
* gcc.target/i386/pr22076.c (dg-options): Add -mno-sse2.
Remove -flax-vector-conversions.
(dg-additional-options): Remove.
(test): Change to void. Declare m0 and m1 as __m64 and
cast initializer in a proper way. Do not return result.
(dg-final): Scan for 2 instances of movq.
From-SVN: r271445
* gfortran.texi: Remove reference to the ASSIGN statement, capitalise
complex, state that padding is with spaces and modify the Hollerith
constant examples.
From-SVN: r271441
Only include the Networking headers for targets with Gthreads, so that
the uses of std::mutex and std::condition_variable don't cause errors.
* testsuite/experimental/names.cc: Only include Networking TS headers
on targets with the necessary Gthreads support.
From-SVN: r271437
PR c++/85679
* tree.c (trivially_copyable_p): Don't check CP_TYPE_VOLATILE_P for
scalar types.
* g++.dg/ext/is_trivially_constructible1.C: Change the expected result
for volatile int.
* g++.dg/ext/is_trivially_copyable.C: New test.
* testsuite/20_util/is_trivially_copyable/value.cc: Change the expected
result for volatile int.
From-SVN: r271435
* pt.c (convert_template_argument): Add a diagnostic for the
[temp.arg]/2 ambiguity case.
* g++.dg/cpp2a/nontype-class17.C: New test.
From-SVN: r271431
Defining 'ptr' fails on Solaris because it's used in <netdb.h>.
Including the Filesystem TS header fails if the TS support wasn't
enabled by configure.
* testsuite/17_intro/names.cc: Do not check 'ptr' on Solaris.
* testsuite/experimental/names.cc: Include <experimental/filesystem>
conditionally.
From-SVN: r271421
* tree-ssa-alias.c (refs_may_alias_p_2): Break out from ...
(refs_may_alias_p_1): ... here; update stats.
(refs_may_alias_p): Do not update stats here.
From-SVN: r271419
Darwin doesn't emit a .file directive by default
and one of the scan-asm hits for ELF targets comes from
this directive. Adjust for Darwin and explain.
2019-05-20 Iain Sandoe <iain@sandoe.co.uk>
PR testsuite/58321
* gcc.target/i386/memcpy-strategy-3.c: Adjust count for Darwin and
add a comment as to the reason for the difference.
* gcc.target/i386/memset-strategy-1.c: Likewise.
From-SVN: r271415
2019-05-20 Richard Biener <rguenther@suse.de>
* tree-ssa-structalias.c (find_func_aliases): POINTER_DIFF_EXPR
doesn't produce pointers.
{TRUNC,CEIL,FLOOR,ROUND,EXACT}_{DIV,MOD}_EXPR points to what
the first operand points to.
From-SVN: r271414
* tree-ssa-alias.c (compare_sizes): New function.
(sompare_type_sizes): New function
(aliasing_component_refs_p): Use it.
(indirect_ref_may_alias_decl_p): Likewise.
From-SVN: r271413
An array of an unknown bound is an incomplete type, so no object of such
a type can be constructed. This means __is_constructible should always
be false for an array of unknown bound.
This patch also changes the std::is_default_constructible trait to use
std::is_constructible, which now gives the right answer for arrays of
unknown bound.
gcc/cp:
PR c++/90532 Ensure __is_constructible(T[]) is false
* method.c (is_xible_helper): Return error_mark_node for construction
of an array of unknown bound.
gcc/testsuite:
PR c++/90532 Ensure __is_constructible(T[]) is false
* g++.dg/ext/90532.C: New test.
libstdc++-v3:
PR c++/90532 Ensure __is_constructible(T[]) is false
* include/std/type_traits (__do_is_default_constructible_impl)
(__is_default_constructible_atom, __is_default_constructible_safe):
Remove.
(is_default_constructible): Use is_constructible.
* testsuite/20_util/is_constructible/value.cc: Check int[] case.
* testsuite/20_util/is_default_constructible/value.cc: Likewise.
* testsuite/20_util/is_trivially_constructible/value.cc: Likewise.
* testsuite/20_util/is_trivially_default_constructible/value.cc:
Likewise.
From-SVN: r271412
Pass the size to the allocator so that it may optimize deallocation.
This was seen to significantly reduce the work required in jemalloc,
with about 40% reduction in CPU cycles in the free path.
Note jemalloc >= 5.2 is required to fix a crash with 0 sizes.
2019-05-20 Pádraig Brady <pbrady@fb.com>
* libstdc++-v3/include/ext/new_allocator.h (deallocate): Pass the size
to the deallocator with -fsized-deallocation.
From-SVN: r271409
* cfgloop.h (struct loop): Add simdlen member.
* cfgloopmanip.c (copy_loop_info): Copy simdlen as well.
* omp-expand.c (expand_omp_simd): Set it if simdlen clause is present.
* tree-vect-loop.c (vect_analyze_loop): Pass loop->simdlen != 0
as new argument to autovectorize_vector_sizes target hook. If
loop->simdlen, pick up vector size where the vectorization factor
is equal to loop->simd, and if there is none, fall back to the first
successful one.
(vect_transform_loop): Adjust autovectorize_vector_sizes target hook
caller.
* omp-low.c (omp_clause_aligned_alignment): Likewise.
* omp-general.c (omp_max_vf): Likewise.
* optabs-query.c (can_vec_mask_load_store_p): Likewise.
* tree-vect-slp.c (vect_slp_bb): Likewise.
* target.def (autovectorize_vector_sizes): Add ALL argument and
document it.
* doc/tm.texi: Adjust documentation.
* targhooks.c (default_autovectorize_vector_sizes): Add bool argument.
* targhooks.h (default_autovectorize_vector_sizes): Likewise.
* config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes): Add
bool argument.
* config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
* config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
* config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
* config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise. If
true and TARGET_AVX512F or TARGET_AVX, push 3 or 2 sizes even if
preferred vector size is not 512-bit or 256-bit, just put those
unpreferred ones last.
* gcc.target/i386/avx512f-simd-1.c: New test.
From-SVN: r271403
2019-05-20 Martin Liska <mliska@suse.cz>
PR middle-end/90263
* builtins.c (expand_builtin_memory_copy_args): When having a
target with fast mempcpy implementation do now use memcpy.
* config/i386/i386.c (ix86_libc_has_fast_function): New.
(TARGET_LIBC_HAS_FAST_FUNCTION): Likewise.
* doc/tm.texi: Likewise.
* doc/tm.texi.in: Likewise.
* target.def:
* expr.c (emit_block_move_hints): Add 2 new arguments.
* expr.h (emit_block_move_hints): Bail out when libcall
to memcpy would be used.
2019-05-20 Martin Liska <mliska@suse.cz>
PR middle-end/90263
* gcc.c-torture/compile/pr90263.c: New test.
* lib/target-supports.exp: Add check_effective_target_glibc.
From-SVN: r271400
2019-05-20 Martin Liska <mliska@suse.cz>
* profile-count.c: Add vertical spacing in order
to separate functions.
* profile-count.h: Likewise.
From-SVN: r271399
2019-05-20 Martin Liska <mliska@suse.cz>
* profile-count.h: Do not use full qualified
names if possible.
* profile-count.c (profile_count::to_frequency): Likewise.
From-SVN: r271398