platform/upstream/gcc.git
2 years agoaarch64: Use memcpy to copy vector tables in vst4[q] intrinsics
Jonathan Wright [Tue, 20 Jul 2021 09:28:34 +0000 (10:28 +0100)]
aarch64: Use memcpy to copy vector tables in vst4[q] intrinsics

Use __builtin_memcpy to copy vector structures instead of building
a new opaque structure one vector at a time in each of the vst4[q]
Neon intrinsics in arm_neon.h. This simplifies the header file and
also improves code generation - superfluous move instructions were
emitted for every register extraction/set in this additional
structure.

Add new code generation tests to verify that superfluous move
instructions are no longer generated for the vst4q intrinsics.

gcc/ChangeLog:

2021-07-20  Jonathan Wright  <jonathan.wright@arm.com>

* config/aarch64/arm_neon.h (vst4_s64): Use __builtin_memcpy
instead of constructing __builtin_aarch64_simd_xi one vector
at a time.
(vst4_u64): Likewise.
(vst4_f64): Likewise.
(vst4_s8): Likewise.
(vst4_p8): Likewise.
(vst4_s16): Likewise.
(vst4_p16): Likewise.
(vst4_s32): Likewise.
(vst4_u8): Likewise.
(vst4_u16): Likewise.
(vst4_u32): Likewise.
(vst4_f16): Likewise.
(vst4_f32): Likewise.
(vst4_p64): Likewise.
(vst4q_s8): Likewise.
(vst4q_p8): Likewise.
(vst4q_s16): Likewise.
(vst4q_p16): Likewise.
(vst4q_s32): Likewise.
(vst4q_s64): Likewise.
(vst4q_u8): Likewise.
(vst4q_u16): Likewise.
(vst4q_u32): Likewise.
(vst4q_u64): Likewise.
(vst4q_f16): Likewise.
(vst4q_f32): Likewise.
(vst4q_f64): Likewise.
(vst4q_p64): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/vector_structure_intrinsics.c: Add new
tests.

2 years agoaarch64: Use memcpy to copy vector tables in vtbx4 intrinsics
Jonathan Wright [Thu, 8 Jul 2021 22:27:54 +0000 (23:27 +0100)]
aarch64: Use memcpy to copy vector tables in vtbx4 intrinsics

Use __builtin_memcpy to copy vector structures instead of building
a new opaque structure one vector at a time in each of the vtbx4
Neon intrinsics in arm_neon.h. This simplifies the header file and
also improves code generation - superfluous move instructions were
emitted for every register extraction/set in this additional
structure.

gcc/ChangeLog:

2021-07-19  Jonathan Wright  <jonathan.wright@arm.com>

* config/aarch64/arm_neon.h (vtbx4_s8): Use __builtin_memcpy
instead of constructing __builtin_aarch64_simd_oi one vector
at a time.
(vtbx4_u8): Likewise.
(vtbx4_p8): Likewise.

2 years agoaarch64: Use memcpy to copy vector tables in vtbl[34] intrinsics
Jonathan Wright [Thu, 8 Jul 2021 22:27:54 +0000 (23:27 +0100)]
aarch64: Use memcpy to copy vector tables in vtbl[34] intrinsics

Use __builtin_memcpy to copy vector structures instead of building
a new opaque structure one vector at a time in each of the vtbl[34]
Neon intrinsics in arm_neon.h. This simplifies the header file and
also improves code generation - superfluous move instructions were
emitted for every register extraction/set in this additional
structure.

gcc/ChangeLog:

2021-07-08  Jonathan Wright  <jonathan.wright@arm.com>

* config/aarch64/arm_neon.h (vtbl3_s8): Use __builtin_memcpy
instead of constructing __builtin_aarch64_simd_oi one vector
at a time.
(vtbl3_u8): Likewise.
(vtbl3_p8): Likewise.
(vtbl4_s8): Likewise.
(vtbl4_u8): Likewise.
(vtbl4_p8): Likewise.

2 years agoaarch64: Use memcpy to copy vector tables in vqtbx[234] intrinsics
Jonathan Wright [Thu, 8 Jul 2021 11:32:45 +0000 (12:32 +0100)]
aarch64: Use memcpy to copy vector tables in vqtbx[234] intrinsics

Use __builtin_memcpy to copy vector structures instead of building
a new opaque structure one vector at a time in each of the vqtbx[234]
Neon intrinsics in arm_neon.h. This simplifies the header file and
also improves code generation - superfluous move instructions were
emitted for every register extraction/set in this additional
structure.

Add new code generation tests to verify that superfluous move
instructions are no longer generated for the vqtbx[234] intrinsics.

gcc/ChangeLog:

2021-07-08  Jonathan Wright  <jonathan.wright@arm.com>

* config/aarch64/arm_neon.h (vqtbx2_s8): Use __builtin_memcpy
instead of constructing __builtin_aarch64_simd_oi one vector
at a time.
(vqtbx2_u8): Likewise.
(vqtbx2_p8): Likewise.
(vqtbx2q_s8): Likewise.
(vqtbx2q_u8): Likewise.
(vqtbx2q_p8): Likewise.
(vqtbx3_s8): Use __builtin_memcpy instead of constructing
__builtin_aarch64_simd_ci one vector at a time.
(vqtbx3_u8): Likewise.
(vqtbx3_p8): Likewise.
(vqtbx3q_s8): Likewise.
(vqtbx3q_u8): Likewise.
(vqtbx3q_p8): Likewise.
(vqtbx4_s8): Use __builtin_memcpy instead of constructing
__builtin_aarch64_simd_xi one vector at a time.
(vqtbx4_u8): Likewise.
(vqtbx4_p8): Likewise.
(vqtbx4q_s8): Likewise.
(vqtbx4q_u8): Likewise.
(vqtbx4q_p8): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/vector_structure_intrinsics.c: New tests.

2 years agoaarch64: Use memcpy to copy vector tables in vqtbl[234] intrinsics
Jonathan Wright [Tue, 6 Jul 2021 15:20:02 +0000 (16:20 +0100)]
aarch64: Use memcpy to copy vector tables in vqtbl[234] intrinsics

Use __builtin_memcpy to copy vector structures instead of building
a new opaque structure one vector at a time in each of the vqtbl[234]
Neon intrinsics in arm_neon.h. This simplifies the header file and
also improves code generation - superfluous move instructions were
emitted for every register extraction/set in this additional
structure.

Add new code generation tests to verify that superfluous move
instructions are no longer generated for the vqtbl[234] intrinsics.

gcc/ChangeLog:

2021-07-08  Jonathan Wright  <jonathan.wright@arm.com>

* config/aarch64/arm_neon.h (vqtbl2_s8): Use __builtin_memcpy
instead of constructing __builtin_aarch64_simd_oi one vector
at a time.
(vqtbl2_u8): Likewise.
(vqtbl2_p8): Likewise.
(vqtbl2q_s8): Likewise.
(vqtbl2q_u8): Likewise.
(vqtbl2q_p8): Likewise.
(vqtbl3_s8): Use __builtin_memcpy instead of constructing
__builtin_aarch64_simd_ci one vector at a time.
(vqtbl3_u8): Likewise.
(vqtbl3_p8): Likewise.
(vqtbl3q_s8): Likewise.
(vqtbl3q_u8): Likewise.
(vqtbl3q_p8): Likewise.
(vqtbl4_s8): Use __builtin_memcpy instead of constructing
__builtin_aarch64_simd_xi one vector at a time.
(vqtbl4_u8): Likewise.
(vqtbl4_p8): Likewise.
(vqtbl4q_s8): Likewise.
(vqtbl4q_u8): Likewise.
(vqtbl4q_p8): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/vector_structure_intrinsics.c: New test.

2 years agolibstdc++: Update documentation comments for namespace rel_ops
Jonathan Wakely [Fri, 23 Jul 2021 10:03:23 +0000 (11:03 +0100)]
libstdc++: Update documentation comments for namespace rel_ops

The comments in <bits/stl_relops.h> describe problems that were solved
years ago (for GCC 3.1). The comparison operators in <iterator> are no
longer ambiguous with the rel_ops ones, so the linked mailing list
thread and FAQ entry aren't relevant now. The reference to std_utility.h
is also outdated as it's just called utility now, both in the source
tree and when installed.

The use of rel_ops is still frowned upon though, so replace the
discussion of ambiguities within libstdc++ headers with adminition about
using rel_ops in user code.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/stl_relops.h: Update documentation comments.

2 years agoopenmp: Add support for __has_attribute(omp::directive) and __has_attribute(omp:...
Jakub Jelinek [Fri, 23 Jul 2021 07:50:15 +0000 (09:50 +0200)]
openmp: Add support for __has_attribute(omp::directive) and __has_attribute(omp::sequence)

Now that the C++ FE supports these attributes, but not through registering
them in the attributes tables (they work quite differently from other
attributes), this teaches c_common_has_attributes about those.

2021-07-23  Jakub Jelinek  <jakub@redhat.com>

* c-lex.c (c_common_has_attribute): Call canonicalize_attr_name also
on attr_id.  Return 1 for omp::directive or omp::sequence in C++11
and later.

* c-c++-common/gomp/attrs-1.c: New test.
* c-c++-common/gomp/attrs-2.c: New test.
* c-c++-common/gomp/attrs-3.c: New test.

2 years agoopenmp: Diagnose invalid mixing of the attribute and pragma syntax directives
Jakub Jelinek [Fri, 23 Jul 2021 07:37:36 +0000 (09:37 +0200)]
openmp: Diagnose invalid mixing of the attribute and pragma syntax directives

The OpenMP 5.1 spec says that the attribute and pragma syntax directives
should not be mixed on the same statement.  The following patch adds diagnostic
for that,
  [[omp::directive (...)]]
  #pragma omp ...
is always an error and for the other order
  #pragma omp ...
  [[omp::directive (...)]]
it depends on whether the pragma directive is an OpenMP construct
(then it is an error because it needs a structured block or loop
or statement as body) or e.g. a standalone directive (then it is fine).

Only block scope is handled for now though, namespace scope and class scope
still needs implementing even the basic support.

2021-07-23  Jakub Jelinek  <jakub@redhat.com>

gcc/c-family/
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP__START_ and
PRAGMA_OMP__LAST_ enumerators.
gcc/cp/
* parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
* parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
mixing of attribute and pragma syntax directives when seeing
omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
directives are followed by OpenMP pragma.
(cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
the cp_parser_handle_statement_omp_attributes call.
(cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
if true, set parser->omp_attrs_forbidden_p.
(cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
false as disallow_omp_attrs to cp_parser_omp_structured_block.
(cp_parser_omp_parallel, cp_parser_omp_task): Set
parser->omp_attrs_forbidden_p.
gcc/testsuite/
* g++.dg/gomp/attrs-4.C: New test.
* g++.dg/gomp/attrs-5.C: New test.

2 years agotestsuite: mips: pass -finline/-fnoinline through
Xi Ruoyao [Fri, 23 Jul 2021 05:55:56 +0000 (13:55 +0800)]
testsuite: mips: pass -finline/-fnoinline through

gcc/testsuite/

* gcc.target/mips/mips.exp (mips_option_groups): add
  -finline and -fno-inline.

2 years agoRevert "testsuite: mips: use noinline attribute instead of -fno-inline"
Xi Ruoyao [Fri, 23 Jul 2021 05:54:11 +0000 (13:54 +0800)]
Revert "testsuite: mips: use noinline attribute instead of -fno-inline"

This reverts commit 3b33b1136d5ba1903a56fa601a848accc3db46ef.

2 years agoanalyzer: fix feasibility false +ve with overly complex svalues
David Malcolm [Fri, 23 Jul 2021 02:36:05 +0000 (22:36 -0400)]
analyzer: fix feasibility false +ve with overly complex svalues

gcc/analyzer/ChangeLog:
* diagnostic-manager.cc
(class auto_disable_complexity_checks): New.
(epath_finder::explore_feasible_paths): Use it to disable
complexity checks whilst processing the worklist.
* region-model-manager.cc
(region_model_manager::region_model_manager): Initialize
m_check_complexity.
(region_model_manager::reject_if_too_complex): Bail if
m_check_complexity is false.
* region-model.h
(region_model_manager::enable_complexity_check): New.
(region_model_manager::disable_complexity_check): New.
(region_model_manager::m_check_complexity): New.

gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/feasibility-3.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2 years agoFix execution failure of parity_1.f90 on P10 [PR100952]
Haochen Gui [Fri, 23 Jul 2021 01:47:23 +0000 (09:47 +0800)]
Fix execution failure of parity_1.f90 on P10 [PR100952]

gcc/
PR target/100952
* config/rs6000/rs6000.md (cstore<mode>4): Fix wrong fall through.

2 years agoDaily bump.
GCC Administrator [Fri, 23 Jul 2021 00:16:31 +0000 (00:16 +0000)]
Daily bump.

2 years agoBind(c): signed char is not a Fortran character type
Sandra Loosemore [Thu, 22 Jul 2021 22:15:50 +0000 (15:15 -0700)]
Bind(c): signed char is not a Fortran character type

CFI_allocate and CFI_select_part were incorrectly treating
CFI_type_signed_char as a Fortran character type for the purpose of
deciding whether or not to use the elem_len argument.  It is a Fortran
integer type per table 18.2 in the 2018 Fortran standard.

Other functions in ISO_Fortran_binding.c appeared to handle this case
correctly already.

2021-07-15  Sandra Loosemore  <sandra@codesourcery.com>

libgfortran/
* runtime/ISO_Fortran_binding.c (CFI_allocate): Don't use elem_len
for CFI_type_signed_char.
(CFI_select_part): Likewise.

2 years agolibstdc++: Fix non-default constructors for hash containers [PR101583]
Jonathan Wakely [Thu, 22 Jul 2021 17:49:57 +0000 (18:49 +0100)]
libstdc++: Fix non-default constructors for hash containers [PR101583]

When I added the new mixin to _Hashtable, I forgot to explicitly
construct it in each non-default constructor. That means you can't
use any constructors unless all three of the hash function, equality
function, and allocator are all default constructible.

libstdc++-v3/ChangeLog:

PR libstdc++/101583
* include/bits/hashtable.h (_Hashtable): Replace mixin with
_Enable_default_ctor. Construct it explicitly in all
non-forwarding, non-defaulted constructors.
* testsuite/23_containers/unordered_map/cons/default.cc: Check
non-default constructors can be used.
* testsuite/23_containers/unordered_set/cons/default.cc:
Likewise.

2 years agoAdd new test for PR65178.
Martin Sebor [Thu, 22 Jul 2021 17:49:33 +0000 (11:49 -0600)]
Add new test for PR65178.

gcc/testsuite/ChangeLog:
PR tree-optimization/65178
* gcc.dg/uninit-pr65178.c: New test.

2 years agoRemove an invalid defintion [PR101568].
Martin Sebor [Thu, 22 Jul 2021 16:23:11 +0000 (10:23 -0600)]
Remove an invalid defintion [PR101568].

Resolves:
PR testsuite/101568 - g++.dg/ipa/pr82352.C fails

gcc/testsuite/ChangeLog:
PR testsuite/101568
* g++.dg/ipa/pr82352.C

2 years agoFix PR 10153: tail recusion for vector types.
Andrew Pinski [Tue, 20 Jul 2021 18:25:43 +0000 (11:25 -0700)]
Fix PR 10153: tail recusion for vector types.

The problem here is we try to an initialized value
from a scalar constant. For vectors we need to do
a vect_dup instead.  This fixes that issue by using
build_{one,zero}_cst instead of integer_{one,zero}_node
when calling create_tailcall_accumulator.

Changes from v1:
* v2: Use build_{one,zero}_cst and get the correct type before.

OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions.

gcc/ChangeLog:

PR tree-optimization/10153
* tree-tailcall.c (create_tailcall_accumulator):
Don't call fold_convert as the type should be correct already.
(tree_optimize_tail_calls_1): Use build_{one,zero}_cst instead
of integer_{one,zero}_node for the call of create_tailcall_accumulator.

gcc/testsuite/ChangeLog:

PR tree-optimization/10153
* gcc.c-torture/compile/pr10153-1.c: New test.
* gcc.c-torture/compile/pr10153-2.c: New test.

2 years agoAllow non-null adjustments for pointers even when there is a known range.
Aldy Hernandez [Thu, 22 Jul 2021 14:03:53 +0000 (16:03 +0200)]
Allow non-null adjustments for pointers even when there is a known range.

Fix non_null_ref::adjust_range so it always adjust ranges, not just
varying ranges.  This will allow pointers that have a range, but are not
necessarily non-null, to be adjusted.

gcc/ChangeLog:

* gimple-range-cache.cc (non_null_ref::adjust_range): Replace
varying_p check for null/non-null check.

2 years agoaix: Protect AIX math.h overloads with new macro.
David Edelsohn [Wed, 21 Jul 2021 18:06:45 +0000 (14:06 -0400)]
aix: Protect AIX math.h overloads with new macro.

AIX math.h provides C++ overloaded inlined math functions, which should
not be present for G++. The definitions have been guaded by
__COMPATMATH__, but that macro had other uses in IBM xlC++. A new
macro has been introduced with the sole purpose of guarding the functions.
This patch updates libstdc++ os_defines.h to define the additional macro.
The earlier macro definition is retained to guard the functions in the
math.h header of earlier AIX releases.

libstdc++-v3/ChangeLog:

* config/os/aix/os_defines.h (__LIBC_NO_CPP_MATH_OVERLOADS__): Define.

3 years agolibstdc++: Use __builtin_operator_new when available [PR94295]
Jonathan Wakely [Thu, 22 Jul 2021 13:38:34 +0000 (14:38 +0100)]
libstdc++: Use __builtin_operator_new when available [PR94295]

Clang provides __builtin_operator_new and __builtin_operator_delete,
which have the same semantics as ::operator new and ::operator delete
except that the compiler is allowed to elide calls to them. This changes
std::allocator to use those built-in functions so that memory allocated
by std::allocator can be optimized away when using Clang. This avoids an
abstraction penalty for using std::allocator to allocate storage rather
than a new-expression.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/94295
* include/ext/new_allocator.h (_GLIBCXX_OPERATOR_NEW)
(_GLIBCXX_OPERATOR_DELETE, _GLIBCXX_SIZED_DEALLOC): Define.
(allocator::allocate, allocator::deallocate): Use new macros.

3 years agolibstdc++: Use std::addressof in ranges::uninitialized_xxx [PR101571]
Jonathan Wakely [Thu, 22 Jul 2021 13:37:24 +0000 (14:37 +0100)]
libstdc++: Use std::addressof in ranges::uninitialized_xxx [PR101571]

Make the ranges::uninitialized_xxx algorithms use std::addressof to
protect against iterator types that overload operator&.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/101571
* include/bits/ranges_uninitialized.h (_DestroyGuard): Change
constructor parameter to reference and use addressof.
* testsuite/util/testsuite_iterators.h: Define deleted operator&
overloads for test iterators.

3 years agolibstdc++: Initialize all subobjects of std::function
Jonathan Wakely [Thu, 22 Jul 2021 10:57:38 +0000 (11:57 +0100)]
libstdc++: Initialize all subobjects of std::function

The std::function::swap member swaps each data member unconditionally,
resulting in -Wmaybe-uninitialized warnings for a default constructed
object. This happens because the _M_invoker and _M_functor members are
only initialized if the function has a target.

This change ensures that all subobjects are zero-initialized on
construction.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/std_function.h (_Function_base): Add
default member initializers and define constructor as defaulted.
(function::_M_invoker): Add default member initializer.

3 years agolibstdc++: Restore __gnu_debug::array [PR100682]
Jonathan Wakely [Thu, 22 Jul 2021 10:45:32 +0000 (11:45 +0100)]
libstdc++: Restore __gnu_debug::array [PR100682]

As the PR points out, we removed the debug version of std::array without
any period of deprecation. Although std::array contains all the actual
debug checks now, removing the <debug/arrray> header breaks any code
that was using that explicitly. The manual still lists doing that as
supported.

This restores the <debug/array> header, but simply defines
__gnu_debug::array as an alias for std::array, and declares the alias
with the deprecated attribute. The docs are updated to match.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/100682
* doc/xml/manual/debug_mode.xml: Update documentation about
debug capability of std::array.
* doc/html/*: Regenerate.
* include/debug/array: New file.

3 years agoAllow non-symmetrical equivalences.
Andrew MacLeod [Mon, 19 Jul 2021 19:54:57 +0000 (15:54 -0400)]
Allow non-symmetrical equivalences.

Don't trap if equivalences are processed out of DOM order, and aren't
completely symmetrical.  We will eventually resolve this, but its OK for now.

gcc/
PR tree-optimization/101511
* value-relation.cc (relation_oracle::query_relation): Check if ssa1
is in ssa2's equiv set, and don't trap if so.

gcc/testsuite/
* g++.dg/pr101511.C: New.

3 years agoCheck for undefined on COND_EXPR before querying type.
Andrew MacLeod [Mon, 19 Jul 2021 19:16:25 +0000 (15:16 -0400)]
Check for undefined on COND_EXPR before querying type.

gcc/
PR tree-optimization/101497
* gimple-range-fold.cc (fold_using_range::range_of_cond_expr): Check
for undefined.

gcc/testsuite
* gcc.dg/pr101497.c: New.

3 years agoOnly call vrp_visit_cond_stmt if range_of_stmt doesn't resolve to a const.
Andrew MacLeod [Mon, 19 Jul 2021 18:02:57 +0000 (14:02 -0400)]
Only call vrp_visit_cond_stmt if range_of_stmt doesn't resolve to a const.

Eevntually all functionality will be subsumed.  Until then, call it only
if needed.

gcc/
PR tree-optimization/101496
* vr-values.c (simplify_using_ranges::fold_cond): Call range_of_stmt
first, then vrp_visit_cond_Stmt.

gcc/testsuite
* gcc.dg/pr101496.c: New.

3 years agoRemove pass_cpb which is related to enable avx512 embedded broadcast from constant...
liuhongt [Tue, 13 Jul 2021 10:22:03 +0000 (18:22 +0800)]
Remove pass_cpb which is related to enable avx512 embedded broadcast from constant pool.

By optimizing vector movement to broadcast in ix86_expand_vector_move
during pass_expand, pass_reload/LRA can automatically generate an avx512
embedded broadcast, pass_cpb is not needed.

Considering that in the absence of avx512f, broadcast from memory is
still slightly faster than loading the entire memory, so always enable
broadcast.

benchmark:
https://gitlab.com/x86-benchmarks/microbenchmark/-/tree/vaddps/broadcast

The performance diff

strategy    : cycles
memory      : 1046611188
memory      : 1255420817
memory      : 1044720793
memory      : 1253414145
average     : 1097868397

broadcast   : 1044430688
broadcast   : 1044477630
broadcast   : 1253554603
broadcast   : 1044561934
average     : 1096756213

But however broadcast has larger size.

the size diff

size broadcast.o
   text    data     bss     dec     hex filename
    137       0       0     137      89 broadcast.o

size memory.o
   text    data     bss     dec     hex filename
    115       0       0     115      73 memory.o

gcc/ChangeLog:

* config/i386/i386-expand.c
(ix86_broadcast_from_integer_constant): Rename to ..
(ix86_broadcast_from_constant): .. this, and extend it to
handle float mode.
(ix86_expand_vector_move): Extend to float mode.
* config/i386/i386-features.c
(replace_constant_pool_with_broadcast): Remove.
(remove_partial_avx_dependency_gate): Ditto.
(constant_pool_broadcast): Ditto.
(class pass_constant_pool_broadcast): Ditto.
(make_pass_constant_pool_broadcast): Ditto.
(remove_partial_avx_dependency): Adjust gate.
* config/i386/i386-passes.def: Remove pass_constant_pool_broadcast.
* config/i386/i386-protos.h
(make_pass_constant_pool_broadcast): Remove.

gcc/testsuite/ChangeLog:

* gcc.target/i386/fuse-caller-save-xmm.c: Adjust testcase.

3 years agoSupport logic shift left/right for avx512 mask type.
liuhongt [Tue, 20 Jul 2021 10:32:35 +0000 (18:32 +0800)]
Support logic shift left/right for avx512 mask type.

gcc/ChangeLog:

* config/i386/constraints.md (Wb): New constraint.
(Ww): Ditto.
* config/i386/i386.md (*ashlhi3_1): Extend to avx512 mask
shift.
(*ashlqi3_1): Ditto.
(*<insn><mode>3_1): Split to ..
(*ashr<mode>3_1): this, ...
(*lshr<mode>3_1): and this, also extend this pattern to avx512
mask registers.
(*<insn><mode>3_1): Split to ..
(*ashr<mode>3_1): this, ...
(*lshrqi3_1): and this, also extend this pattern to avx512
mask registers.
(*lshrhi3_1): And this, also extend this pattern to avx512
mask registers.
* config/i386/sse.md (k<code><mode>): New define_split after
it to convert generic shift pattern to mask shift ones.

gcc/testsuite/ChangeLog:

* gcc.target/i386/mask-shift.c: New test.

3 years agoDaily bump.
GCC Administrator [Thu, 22 Jul 2021 00:16:46 +0000 (00:16 +0000)]
Daily bump.

3 years agoanalyzer: bulletproof -Wanalyzer-file-leak [PR101547]
David Malcolm [Wed, 21 Jul 2021 23:19:31 +0000 (19:19 -0400)]
analyzer: bulletproof -Wanalyzer-file-leak [PR101547]

gcc/analyzer/ChangeLog:
PR analyzer/101547
* sm-file.cc (file_leak::emit): Handle m_arg being NULL.
(file_leak::describe_final_event): Handle ev.m_expr being NULL.

gcc/testsuite/ChangeLog:
PR analyzer/101547
* gcc.dg/analyzer/pr101547.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
3 years agoanalyzer: fix ICE in binding_cluster::purge_state_involving [PR101522]
David Malcolm [Wed, 21 Jul 2021 23:16:08 +0000 (19:16 -0400)]
analyzer: fix ICE in binding_cluster::purge_state_involving [PR101522]

gcc/analyzer/ChangeLog:
PR analyzer/101522
* store.cc (binding_cluster::purge_state_involving): Don't change
m_map whilst iterating through it.

gcc/testsuite/ChangeLog:
PR analyzer/101522
* g++.dg/analyzer/pr101522.C: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
3 years agoOpenACC 'nohost' clause
Thomas Schwinge [Wed, 21 Jul 2021 16:30:00 +0000 (18:30 +0200)]
OpenACC 'nohost' clause

Do not "compile a version of this procedure for the host".

gcc/
* tree-core.h (omp_clause_code): Add 'OMP_CLAUSE_NOHOST'.
* tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
Handle it.
* tree-pretty-print.c (dump_omp_clause): Likewise.
* omp-general.c (oacc_verify_routine_clauses): Likewise.
* gimplify.c (gimplify_scan_omp_clauses)
(gimplify_adjust_omp_clauses): Likewise.
* tree-nested.c (convert_nonlocal_omp_clauses)
(convert_local_omp_clauses): Likewise.
* omp-low.c (scan_sharing_clauses): Likewise.
* omp-offload.c (execute_oacc_device_lower): Update.
gcc/c-family/
* c-pragma.h (pragma_omp_clause): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
gcc/c/
* c-parser.c (c_parser_omp_clause_name): Handle 'nohost'.
(c_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
(OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
* c-typeck.c (c_finish_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
gcc/cp/
* parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
(cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
(OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
* pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
* semantics.c (finish_omp_clauses): Likewise.
gcc/fortran/
* dump-parse-tree.c (show_attr): Update.
* gfortran.h (symbol_attribute): Add 'oacc_routine_nohost' member.
(gfc_omp_clauses): Add 'nohost' member.
* module.c (ab_attribute): Add 'AB_OACC_ROUTINE_NOHOST'.
(attr_bits, mio_symbol_attribute): Update.
* openmp.c (omp_mask2): Add 'OMP_CLAUSE_NOHOST'.
(gfc_match_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
(OACC_ROUTINE_CLAUSES): Add 'OMP_CLAUSE_NOHOST'.
(gfc_match_oacc_routine): Update.
* trans-decl.c (add_attributes_to_decl): Update.
* trans-openmp.c (gfc_trans_omp_clauses): Likewise.
gcc/testsuite/
* c-c++-common/goacc/classify-routine-nohost.c: New file.
* c-c++-common/goacc/classify-routine.c: Update.
* c-c++-common/goacc/routine-2.c: Likewise.
* c-c++-common/goacc/routine-nohost-1.c: New file.
* c-c++-common/goacc/routine-nohost-2.c: Likewise.
* g++.dg/goacc/template.C: Update.
* gfortran.dg/goacc/classify-routine-nohost.f95: New file.
* gfortran.dg/goacc/classify-routine.f95: Update.
* gfortran.dg/goacc/pure-elemental-procedures-2.f90: Likewise.
* gfortran.dg/goacc/routine-6.f90: Likewise.
* gfortran.dg/goacc/routine-intrinsic-2.f: Likewise.
* gfortran.dg/goacc/routine-module-1.f90: Likewise.
* gfortran.dg/goacc/routine-module-2.f90: Likewise.
* gfortran.dg/goacc/routine-module-3.f90: Likewise.
* gfortran.dg/goacc/routine-module-mod-1.f90: Likewise.
* gfortran.dg/goacc/routine-multiple-directives-1.f90: Likewise.
* gfortran.dg/goacc/routine-multiple-directives-2.f90: Likewise.
libgomp/
* testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c: New
file.
* testsuite/libgomp.oacc-c-c++-common/routine-nohost-2.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/routine-nohost-2_2.c:
Likewise.
* testsuite/libgomp.oacc-fortran/routine-nohost-1.f90: Likewise.

Co-Authored-By: Joseph Myers <joseph@codesourcery.com>
Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
3 years ago[OpenACC] Fix '#pragma atomic update' typo in 'g++.dg/goacc/template.C'
Thomas Schwinge [Wed, 21 Jul 2021 06:20:18 +0000 (08:20 +0200)]
[OpenACC] Fix '#pragma atomic update' typo in 'g++.dg/goacc/template.C'

    [...]/g++.dg/goacc/template.C:58: warning: ignoring ‘#pragma atomic update’ [-Wunknown-pragmas]
       58 | #pragma atomic update
          |

Small fix-up for r229832 (commit 7a5e4956cc026cba54159d5c764486ac4151db85)
"[openacc] tile, independent, default, private and firstprivate support in
c/++".

gcc/testsuite/
* g++.dg/goacc/template.C: Fix '#pragma atomic update' typo.

3 years agoanalyzer: fix issues with phi handling
David Malcolm [Wed, 21 Jul 2021 21:24:08 +0000 (17:24 -0400)]
analyzer: fix issues with phi handling

The analyzer's state purging code was overzealously purging state
for ssa names that might be used within phi nodes, leading to
false positives from -Wanalyzer-use-of-uninitialized-value.

This patch updates phi handling in the analyzer to fix these issues.

gcc/analyzer/ChangeLog:
* region-model.cc (region_model::handle_phi): Add "old_state"
param and use it.
(region_model::update_for_phis): Update so that all of the phi
stmts are effectively handled simultaneously, rather than in
order.
* region-model.h (region_model::handle_phi): Add "old_state"
param.
* state-purge.cc (self_referential_phi_p): Replace with...
(name_used_by_phis_p): ...this new function.
(state_purge_per_ssa_name::process_point): Update to use the
above, so that all phi stmts at a basic block are effectively
considered simultaneously, and only consider the phi arguments for
the pertinent in-edge.
* supergraph.cc (cfg_superedge::get_phi_arg_idx): New.
(cfg_superedge::get_phi_arg): Use the above.
* supergraph.h (cfg_superedge::get_phi_arg_idx): New decl.

gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/explode-2.c: Remove xfail.
* gcc.dg/analyzer/explode-2a.c: Remove expected leak warning on
while stmt.
* gcc.dg/analyzer/phi-2.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
3 years agoanalyzer: fixes to -fdump-analyzer-state-purge for phi nodes
David Malcolm [Wed, 21 Jul 2021 21:22:45 +0000 (17:22 -0400)]
analyzer: fixes to -fdump-analyzer-state-purge for phi nodes

gcc/analyzer/ChangeLog:
* state-purge.cc (state_purge_annotator::add_node_annotations):
Rather than erroneously always using the NULL in-edge, determine
each relevant in-edge, and print the appropriate data for each
in-edge.  Use print_needed to print the data as comma-separated
lists of SSA names.
(print_vec_of_names): Add "within_table" param and use it.
(state_purge_annotator::add_stmt_annotations): Factor out
collation and printing code into...
(state_purge_annotator::print_needed): ...this new function.
* state-purge.h (state_purge_annotator::print_needed): New decl.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
3 years agoanalyzer: show BB index in BEFORE_SUPERNODE's in-edge
David Malcolm [Wed, 21 Jul 2021 21:21:22 +0000 (17:21 -0400)]
analyzer: show BB index in BEFORE_SUPERNODE's in-edge

This is useful for debugging how the analyzer handles phi nodes.

gcc/analyzer/ChangeLog:
* program-point.cc (function_point::print): Show src BB index at
BEFORE_SUPERNODE.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
3 years agoanalyzer: tweak dumping of min_expr/max_expr
David Malcolm [Wed, 21 Jul 2021 21:19:31 +0000 (17:19 -0400)]
analyzer: tweak dumping of min_expr/max_expr

gcc/analyzer/ChangeLog:
* svalue.cc (infix_p): New.
(binop_svalue::dump_to_pp): Use it to print MIN_EXPR and MAX_EXPR
in prefix form, rather than infix.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
3 years agoFix typos in a comment.
Martin Sebor [Wed, 21 Jul 2021 20:34:28 +0000 (14:34 -0600)]
Fix typos in a comment.

gcc/ChangeLog:
* tree-ssa-alias.c (walk_aliased_vdefs_1): Fix typos in a comment.

3 years agors6000: Add int128 target check to pr101129.c (PR101531)
Bill Schmidt [Wed, 21 Jul 2021 14:23:45 +0000 (09:23 -0500)]
rs6000: Add int128 target check to pr101129.c (PR101531)

2021-07-21  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/testsuite/
PR target/101531
* gcc.target/powerpc/pr101129.c: Adjust.

3 years agors6000: Write output to the builtins init file, part 2 of 3
Bill Schmidt [Wed, 21 Jul 2021 13:19:46 +0000 (09:19 -0400)]
rs6000: Write output to the builtins init file, part 2 of 3

2021-07-21  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-gen-builtins.c (write_init_bif_table):
Implement.

3 years agors6000: Write output to the builtins init file, part 1 of 3
Bill Schmidt [Wed, 21 Jul 2021 13:16:55 +0000 (09:16 -0400)]
rs6000: Write output to the builtins init file, part 1 of 3

2021-07-21  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-gen-builtins.c (write_fntype): New
callback function.
(write_fntype_init): New stub function.
(write_init_bif_table): Likewise.
(write_init_ovld_table): New function.
(write_init_file): Implement.

3 years agors6000: Write output to the builtins header file
Bill Schmidt [Wed, 21 Jul 2021 12:57:06 +0000 (08:57 -0400)]
rs6000: Write output to the builtins header file

2021-07-21  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-gen-builtins.c
(write_autogenerated_header): New function.
(write_decls): Likewise.
(write_extern_fntype): New callback function.
(write_header_file): Implement.

3 years agors6000: Write output to the builtin definition include file
Bill Schmidt [Wed, 21 Jul 2021 12:47:49 +0000 (08:47 -0400)]
rs6000: Write output to the builtin definition include file

2021-06-07  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-gen-builtins.c (write_defines_file):
Implement.

3 years agors6000: Build and store function type identifiers
Bill Schmidt [Wed, 21 Jul 2021 12:45:36 +0000 (08:45 -0400)]
rs6000: Build and store function type identifiers

2021-07-21  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-gen-builtins.c (complete_vector_type): New
function.
(complete_base_type): Likewise.
(construct_fntype_id): Likewise.
(parse_bif_entry): Call contruct_fntype_id.
(parse_ovld_entry): Likewise.

3 years agors6000: Parsing of overload input file
Bill Schmidt [Wed, 21 Jul 2021 12:39:37 +0000 (08:39 -0400)]
rs6000: Parsing of overload input file

2021-06-07  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-gen-builtins.c (ovld_stanza): New struct.
(MAXOVLDSTANZAS): New macro.
(ovld_stanzas): New variable.
(curr_ovld_stanza): Likewise.
(MAXOVLDS): New macro.
(ovlddata): New struct.
(ovlds): New variable.
(curr_ovld): Likewise.
(max_ovld_args): Likewise.
(parse_ovld_entry): New function.
(parse_ovld_stanza): Likewise.
(parse_ovld): Implement.

3 years agors6000: Parsing built-in input file, part 3 of 3
Bill Schmidt [Wed, 21 Jul 2021 12:36:25 +0000 (08:36 -0400)]
rs6000: Parsing built-in input file, part 3 of 3

2021-07-21  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-gen-builtins.c (parse_bif_attrs):
Implement.

3 years agors6000: Parsing built-in input file, part 2 of 3
Bill Schmidt [Wed, 21 Jul 2021 12:32:32 +0000 (08:32 -0400)]
rs6000: Parsing built-in input file, part 2 of 3

2021-07-21  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-gen-builtins.c (parse_args): New function.
(parse_prototype): Implement.

3 years agors6000: Parsing built-in input file, part 1 of 3
Bill Schmidt [Tue, 20 Jul 2021 22:45:57 +0000 (18:45 -0400)]
rs6000: Parsing built-in input file, part 1 of 3

2021-07-20  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-gen-builtins.c (bif_stanza): New enum.
(curr_bif_stanza): New variable.
(stanza_entry): New struct.
(stanza_map): New initialized variable.
(enable_string): Likewise.
(fnkinds): New enum.
(typelist): New struct.
(attrinfo): Likewise.
(MAXRESTROPNDS): New macro.
(prototype): New struct.
(MAXBIFS): New macro.
(bifdata): New struct.
(bifs): New variable.
(curr_bif): Likewise.
(bif_order): Likewise.
(bif_index): Likewise.
(fatal): New function.
(stanza_name_to_stanza): Likewise.
(parse_bif_attrs): New stub function.
(parse_prototype): Likewise.
(parse_bif_entry): New function.
(parse_bif_stanza): Likewise.
(parse_bif): Implement.
(set_bif_order): New function.
(create_bif_order): Implement.

3 years agors6000: Main function with stubs for parsing and output
Bill Schmidt [Tue, 20 Jul 2021 22:25:53 +0000 (18:25 -0400)]
rs6000: Main function with stubs for parsing and output

2021-07-20  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-gen-builtins.c (rbtree.h): New #include.
(num_bifs): New variable.
(num_ovld_stanzas): Likewise.
(num_ovlds): Likewise.
(parse_codes): New enum.
(bif_rbt): New variable.
(ovld_rbt): Likewise.
(fntype_rbt): Likewise.
(bifo_rbt): Likewise.
(parse_bif): New stub function.
(create_bif_order): Likewise.
(parse_ovld): Likewise.
(write_header_file): Likewise.
(write_init_file): Likewise.
(write_defines_file): Likewise.
(delete_output_files): New function.
(main): Likewise.

3 years agox86: Remove OPTION_MASK_ISA_SSE4_2 from CRC32 _builtin functions
H.J. Lu [Wed, 21 Jul 2021 12:15:55 +0000 (05:15 -0700)]
x86: Remove OPTION_MASK_ISA_SSE4_2 from CRC32 _builtin functions

Since

commit 39671f87b2df6a1894cc11a161e4a7949d1ddccd
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Apr 15 05:59:48 2021 -0700

    x86: Use crc32 target option for CRC32 intrinsics

enabled OPTION_MASK_ISA_CRC32 for -msse4 and removed TARGET_SSE4_2 check
in sse4_2_crc32<mode> pattens, remove OPTION_MASK_ISA_SSE4_2 from CRC32
_builtin functions.

gcc/

PR target/101549
* config/i386/i386-builtin.def: Remove OPTION_MASK_ISA_SSE4_2
from CRC32 _builtin functions.

gcc/testsuite/

PR target/101549
* gcc.target/i386/crc32-6.c: New test.

3 years agoFortran: ICE, OOM while calculating sizes of derived type array components
Harald Anlauf [Wed, 21 Jul 2021 16:54:00 +0000 (18:54 +0200)]
Fortran: ICE, OOM while calculating sizes of derived type array components

gcc/fortran/ChangeLog:

PR fortran/101514
* target-memory.c (gfc_interpret_derived): Size of array component
of derived type can only be computed here for explicit shape.
* trans-types.c (gfc_get_nodesc_array_type): Do not dereference
NULL pointers.

gcc/testsuite/ChangeLog:

PR fortran/101514
* gfortran.dg/pr101514.f90: New test.

3 years agoAdjust macro to avoid warning [PR101379].
Martin Sebor [Wed, 21 Jul 2021 16:48:55 +0000 (10:48 -0600)]
Adjust macro to avoid warning [PR101379].

Resolves:
PR bootstrap/101379 - libatomic arm build failure after r12-2132 due to -Warray-bounds on a constant address

libatomic/ChangeLog:
PR bootstrap/101379
* config/linux/arm/host-config.h (__kernel_helper_version): New
function.  Adjust shadow macro.

3 years agolibstdc++: Make __gnu_cxx::sequence_buffer move-aware [PR101542]
Jonathan Wakely [Wed, 21 Jul 2021 14:29:19 +0000 (15:29 +0100)]
libstdc++: Make __gnu_cxx::sequence_buffer move-aware [PR101542]

The PR explains that Clang trunk now selects a different constructor
when a non-const sequence_buffer is returned in a context where it
qualifies as an implicitly-movable entity. Because lookup is first
performed using an rvalue, the sequence_buffer(const sequence_buffer&)
constructor gets chosen, which makes a copy instead of a "pseudo-move"
via the sequence_buffer(sequence_buffer&) constructor. The problem isn't
seen with GCC because as noted in the r11-2412 commit log, GCC actually
implements a slightly modified rule that avoids breaking exactly this
type of code.

This patch adds a move constructor to sequence_buffer, so that implicit
or explicit moves will have the same effect, calling the
sequence_buffer(sequence_buffer&) constructor. A move assignment
operator is also added to make move assignment work similarly.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/101542
* include/ext/rope (sequence_buffer): Add move constructor and
move assignment operator.
* testsuite/ext/rope/101542.cc: New test.

3 years agoc++tools, configury: Configure with C++; test checking status [PR98821].
Iain Sandoe [Tue, 20 Jul 2021 13:00:38 +0000 (14:00 +0100)]
c++tools, configury: Configure with C++; test checking status [PR98821].

The c++tools configure fragments need to be built with a C++ compiler.

In addition, the stand-alone server uses diagnostic mechanisms in common
with GCC, but needs to define implementations for gcc_assert and
supporting output functions.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/98821 - modules : c++tools configures with CC but code fragments assume CXX.

PR c++/98821

c++tools/ChangeLog:

* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Configure using C++.  Pull logic to
detect enabled checking modes; default to release
checking.
* server.cc (AI_NUMERICSERV): Define a fallback value.
(gcc_assert): New.
(gcc_unreachable): New.
(fancy_abort): Only build when checking is enabled.

Co-authored-by: Jakub Jelinek <jakub@redhat.com>
3 years agogcov: Fix use of profile info section
Sebastian Huber [Wed, 14 Jul 2021 07:40:11 +0000 (09:40 +0200)]
gcov: Fix use of profile info section

If the -fprofile-info-section is used, then the gcov information is registered
in a linker set.  This is done by build_gcov_info_var_registration().  The
compiler generated object placed in the section was not marked as referenced,
so once optimization was enabled, this object was optimized away.  Mark it as
referenced.

gcc/
* coverage.c (build_gcov_info_var_registration): Mark the object placed
in the linker set as referenced so that it does not get optimized away.

3 years agoRevert "RISC-V: Detect python and pick best one for calling multilib-generator"
Kito Cheng [Wed, 21 Jul 2021 08:31:10 +0000 (16:31 +0800)]
Revert "RISC-V: Detect python and pick best one for calling multilib-generator"

This reverts commit e695f0101a8cacbc29353c5a000731e50b2627e6.

3 years agoopenmp: Fix up omp_check_private [PR101535]
Jakub Jelinek [Wed, 21 Jul 2021 07:45:02 +0000 (09:45 +0200)]
openmp: Fix up omp_check_private [PR101535]

The target data construct shouldn't affect omp_check_private, unless
the decl there is privatized (use_device_* clauses).  The routine
had some code for that, but it just did continue; in a loop that looped
only if the region type is one of selected 4 kinds, so effectively resulted
in return false; instead of looping again.  And not diagnosing lastprivate
(or reduction etc.) on a variable that is private to containing parallel
results in ICEs later on, as there is no original list item to which store
the last result.
The target construct is unclear as it has an implicit parallel region
and it is not obvious if the data privatization clauses on the construct
shall be treated as data privatization on the implicit parallel or just
on the target.  For now treat those as privatization on the implicit
parallel, but treat map clauses as shared on the implicit parallel.

2021-07-21  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/101535
* gimplify.c (omp_check_private): Properly skip ORT_TARGET_DATA
contexts in which decl isn't privatized and for ORT_TARGET return
false if decl is mapped.

* c-c++-common/gomp/pr101535-1.c: New test.
* c-c++-common/gomp/pr101535-2.c: New test.

3 years agoc++: Ensure OpenMP reduction with reference type references complete type [PR101516]
Jakub Jelinek [Wed, 21 Jul 2021 07:38:59 +0000 (09:38 +0200)]
c++: Ensure OpenMP reduction with reference type references complete type [PR101516]

The following testcase ICEs because we haven't verified if reduction decl
has reference type that TREE_TYPE of the reference is a complete type,
require_complete_type on the decl doesn't ensure that.

2021-07-21  Jakub Jelinek  <jakub@redhat.com>

PR c++/101516
* semantics.c (finish_omp_reduction_clause): Also call
complete_type_or_else and return true if it fails.

* g++.dg/gomp/pr101516.C: New test.

3 years agoFortran: Fix bind(C) character length checks
Tobias Burnus [Wed, 21 Jul 2021 07:36:48 +0000 (09:36 +0200)]
Fortran: Fix bind(C) character length checks

gcc/fortran/ChangeLog:

* decl.c (gfc_verify_c_interop_param): Update for F2008 + F2018
changes; reject unsupported bits with 'Error: Sorry,'.
* trans-expr.c (gfc_conv_procedure_call): Fix condition to
For using CFI descriptor with characters.

gcc/testsuite/ChangeLog:

* gfortran.dg/iso_c_binding_char_1.f90: Update dg-error.
* gfortran.dg/pr32599.f03: Use -std=-f2003 + update comment.
* gfortran.dg/bind_c_char_10.f90: New test.
* gfortran.dg/bind_c_char_6.f90: New test.
* gfortran.dg/bind_c_char_7.f90: New test.
* gfortran.dg/bind_c_char_8.f90: New test.
* gfortran.dg/bind_c_char_9.f90: New test.

3 years agounroll: Run VN on unrolled-and-jammed loops
Richard Sandiford [Wed, 21 Jul 2021 06:50:20 +0000 (07:50 +0100)]
unroll: Run VN on unrolled-and-jammed loops

Unroll and jam can sometimes leave redundancies.  E.g. for:

  for (int j = 0; j < 100; ++j)
    for (int i = 0; i < 100; ++i)
      x[i] += y[i] * z[j][i];

the new loop will do the equivalent of:

  for (int j = 0; j < 100; j += 2)
    for (int i = 0; i < 100; ++i)
      {
        x[i] += y[i] * z[j][i];
        x[i] += y[i] * z[j + 1][i];
      }

with two reads of y[i] and with a round trip through memory for x[i].

At the moment these redundancies survive till vectorisation, so if
vectorisation succeeds, we're reliant on being able to remove the
redundancies from the vector form.  This can be hard to do if
a vector loop uses predication.  E.g. on SVE we end up with:

.L3:
        ld1w    z3.s, p0/z, [x3, x0, lsl 2]
        ld1w    z0.s, p0/z, [x5, x0, lsl 2]
        ld1w    z1.s, p0/z, [x2, x0, lsl 2]
        mad     z1.s, p1/m, z0.s, z3.s
        ld1w    z2.s, p0/z, [x4, x0, lsl 2]
        st1w    z1.s, p0, [x3, x0, lsl 2]    // store to x[i]
        ld1w    z1.s, p0/z, [x3, x0, lsl 2]  // load back from x[i]
        mad     z0.s, p1/m, z2.s, z1.s
        st1w    z0.s, p0, [x3, x0, lsl 2]
        add     x0, x0, x6
        whilelo p0.s, w0, w1
        b.any   .L3

This patch runs a value-numbering pass on loops after a successful
unroll-and-jam, which gets rid of the unnecessary load and gives
a more accurate idea of vector costs.  Unfortunately the redundant
store still persists without a pre-vect DSE, but that feels like
a separate issue.

Note that the pass requires the loop to have a single exit,
hence the simple calculation of exit_bbs.

gcc/
* gimple-loop-jam.c: Include tree-ssa-sccvn.h.
(tree_loop_unroll_and_jam): Run value-numbering on a loop that
has been successfully unrolled.

gcc/testsuite/
* gcc.dg/unroll-10.c: New test.

3 years agounroll: Avoid unnecessary tail loops for constant niters
Richard Sandiford [Wed, 21 Jul 2021 06:50:20 +0000 (07:50 +0100)]
unroll: Avoid unnecessary tail loops for constant niters

unroll and jam can decide to unroll the outer loop of a nest like:

  for (int j = 0; j < n; ++j)
    for (int i = 0; i < n; ++i)
      x[i] += __builtin_expf (y[j][i]);

It then uses a tail loop to handle any left-over iterations.

However, the code is structured so that this tail loop is always used.
If n is a multiple of the unroll factor UF, the final UF iterations will
use the tail loop rather than the unrolled loop.

“Fixing” that for variable loop counts would mean introducing another
runtime test: a branch around the tail loop if there are no more
iterations.  There's at least an argument that the overhead of doing
that test might not pay for itself.

But we use this structure even if the iteration count is provably
a multiple of UF at compile time.  E.g. with s/n/100/ and an
unroll factor of 2, the first 98 iterations use the unrolled loop
and the final 2 iterations use the original loop.

This patch makes the unroller avoid a tail loop in that case.
The end result seemed easier to follow if variables were declared
at the point of initialisation, so that it's more obvious which
ones are meaningful even when there's no tail loop.

gcc/
* tree-ssa-loop-manip.c (determine_exit_conditions): Return a null
exit condition if no tail loop is needed, and if the original exit
condition should therefore be kept as-is.
(tree_transform_and_unroll_loop): Handle that case here too.

gcc/testsuite/
* gcc.dg/unroll-9.c: New test/

3 years agopredcom: Refactor more using auto_vec
Kewen Lin [Wed, 21 Jul 2021 05:22:05 +0000 (00:22 -0500)]
predcom: Refactor more using auto_vec

This patch follows Martin's suggestion at the link[1] to do more
refactorings by:
  - Adding m_ prefix for class pcom_worker member variables.
  - Using auto_vec instead of vec among class pcom_worker,
    chain, component and comp_ptrs.

The changes in tree-data-ref.[ch] is required, without it the
destruction of auto_vec instance could try to double free the
memory pointed by m_vec.

Bootstrapped and regtested on powerpc64le-linux-gnu P9,
x86_64-redhat-linux and aarch64-linux-gnu, also
bootstrapped on ppc64le P9 with bootstrap-O3 config.

[1] https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573424.html

gcc/ChangeLog:

* tree-data-ref.c (free_dependence_relations): Adjust to pass vec
by reference.
(free_data_refs): Likewise.
* tree-data-ref.h (free_dependence_relations): Likewise.
(free_data_refs): Likewise.
* tree-predcom.c (struct chain): Use auto_vec instead of vec for
members.
(struct component): Likewise.
(pcom_worker::pcom_worker): Adjust for auto_vec and renaming changes.
(pcom_worker::~pcom_worker): Likewise.
(pcom_worker::release_chain): Adjust as auto_vec changes.
(pcom_worker::loop): Rename to ...
(pcom_worker::m_loop): ... this.
(pcom_worker::datarefs): Rename to ...
(pcom_worker::m_datarefs): ... this.  Use auto_vec instead of vec.
(pcom_worker::dependences): Rename to ...
(pcom_worker::m_dependences): ... this.  Use auto_vec instead of vec.
(pcom_worker::chains): Rename to ...
(pcom_worker::m_chains): ... this.  Use auto_vec instead of vec.
(pcom_worker::looparound_phis): Rename to ...
(pcom_worker::m_looparound_phis): ... this.  Use auto_vec instead of
vec.
(pcom_worker::cache): Rename to ...
(pcom_worker::m_cache): ... this.  Use auto_vec instead of vec.
(pcom_worker::release_chain): Adjust for auto_vec changes.
(pcom_worker::release_chains): Adjust for auto_vec and renaming
changes.
(release_component): Remove.
(release_components): Adjust for release_component removal.
(component_of): Adjust to use vec.
(merge_comps): Likewise.
(pcom_worker::aff_combination_dr_offset): Adjust for renaming changes.
(pcom_worker::determine_offset): Likewise.
(class comp_ptrs): Remove.
(pcom_worker::split_data_refs_to_components): Adjust for renaming
changes, for comp_ptrs removal with auto_vec.
(pcom_worker::suitable_component_p): Adjust for renaming changes.
(pcom_worker::filter_suitable_components): Adjust for release_component
removal.
(pcom_worker::valid_initializer_p): Adjust for renaming changes.
(pcom_worker::find_looparound_phi): Likewise.
(pcom_worker::add_looparound_copies): Likewise.
(pcom_worker::determine_roots_comp): Likewise.
(pcom_worker::single_nonlooparound_use): Likewise.
(pcom_worker::execute_pred_commoning_chain): Likewise.
(pcom_worker::execute_pred_commoning): Likewise.
(pcom_worker::try_combine_chains): Likewise.
(pcom_worker::prepare_initializers_chain): Likewise.
(pcom_worker::prepare_initializers): Likewise.
(pcom_worker::prepare_finalizers_chain): Likewise.
(pcom_worker::prepare_finalizers): Likewise.
(pcom_worker::tree_predictive_commoning_loop): Likewise.

3 years agoDaily bump.
GCC Administrator [Wed, 21 Jul 2021 00:16:54 +0000 (00:16 +0000)]
Daily bump.

3 years agolibsanitizer: Bump asan/tsan versions
H.J. Lu [Tue, 20 Jul 2021 19:15:40 +0000 (12:15 -0700)]
libsanitizer: Bump asan/tsan versions

Bump asan/tsan versions for the upstream commit:

commit acf0a6428681dccac803984bfbb1e3e54248f090
Author: Ilya Leoshkevich <iii@linux.ibm.com>
Date:   Fri Jul 2 02:42:38 2021 +0200

    [sanitizer] Fix __sanitizer_kernel_sigset_t endianness issue

    setuid(0) hangs on SystemZ under TSan because TSan's BackgroundThread
    ignores SIGSETXID. This in turn happens because internal_sigdelset()
    messes up the mask bits on big-endian system due to how
    __sanitizer_kernel_sigset_t is defined.

    Commit d9a1a53b8d80 ("[ESan] [MIPS] Fix workingset-signal-posix.cpp on
    MIPS") fixed this for MIPS by adjusting the __sanitizer_kernel_sigset_t
    definition. Generalize this by defining __SANITIZER_KERNEL_NSIG based
    on kernel's _NSIG and using uptr[] for __sanitizer_kernel_sigset_t.sig
    on all platforms.

    Reviewed By: dvyukov

    Differential Revision: https://reviews.llvm.org/D105629

which changed __sanitizer_kernel_sigset_t and changed the ABI for function

void __sanitizer_syscall_post_impl_rt_sigaction
  (long int, long int,
   const __sanitizer::__sanitizer_kernel_sigaction_t*,
   __sanitizer::__sanitizer_kernel_sigaction_t*,
   SIZE_T);

* asan/libtool-version: Bump version.
* tsan/libtool-version: Likewise.

3 years agolibsanitizer: Update LOCAL_PATCHES
H.J. Lu [Tue, 20 Jul 2021 17:47:45 +0000 (10:47 -0700)]
libsanitizer: Update LOCAL_PATCHES

* LOCAL_PATCHES: Update to the corresponding revision.

3 years agolibsanitizer: Apply local patches
H.J. Lu [Tue, 20 Jul 2021 17:46:51 +0000 (10:46 -0700)]
libsanitizer: Apply local patches

3 years agolibsanitizer: Merge with upstream
H.J. Lu [Tue, 20 Jul 2021 17:44:37 +0000 (10:44 -0700)]
libsanitizer: Merge with upstream

Merged revision: 7704fedfff6ef5676adb6415f3be0ac927d1a746

3 years agoCorrect stpcpy offset computation for -Warray-bounds et al. [PR101397].
Martin Sebor [Tue, 20 Jul 2021 19:48:20 +0000 (13:48 -0600)]
Correct stpcpy offset computation for -Warray-bounds et al. [PR101397].

Resolves:
PR middle-end/101397 - spurious warning writing to the result of stpcpy minus 1

gcc/ChangeLog:

PR middle-end/101397
* builtins.c (gimple_call_return_array): Add argument.  Correct
offsets for memchr, mempcpy, stpcpy, and stpncpy.
(compute_objsize_r): Adjust offset computation for argument returning
built-ins.

gcc/testsuite/ChangeLog:

PR middle-end/101397
* gcc.dg/Warray-bounds-80.c: New test.
* gcc.dg/Warray-bounds-81.c: New test.
* gcc.dg/Warray-bounds-82.c: New test.
* gcc.dg/Warray-bounds-83.c: New test.
* gcc.dg/Warray-bounds-84.c: New test.
* gcc.dg/Wstringop-overflow-46.c: Adjust expected output.

3 years agolibstdc++: Fix create_directories to resolve symlinks [PR101510]
Jonathan Wakely [Tue, 20 Jul 2021 17:15:48 +0000 (18:15 +0100)]
libstdc++: Fix create_directories to resolve symlinks [PR101510]

When filesystem__create_directories checks to see if the path already
exists and resovles to a directory, it uses filesystem::symlink_status,
which means it reports an error if the path is a symlink. It should use
filesystem::status, so that the target directory is detected, and no
error is reported.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/101510
* src/c++17/fs_ops.cc (fs::create_directories): Use status
instead of symlink_status.
* src/filesystem/ops.cc (fs::create_directories): Likewise.
* testsuite/27_io/filesystem/operations/create_directories.cc:
* testsuite/27_io/filesystem/operations/create_directory.cc: Do
not test with symlinks on Windows.
* testsuite/experimental/filesystem/operations/create_directories.cc:
* testsuite/experimental/filesystem/operations/create_directory.cc:
Do not test with symlinks on Windows.

3 years agoHandle all UBSAN built-ins in -Wuninitialized [PR101300].
Martin Sebor [Tue, 20 Jul 2021 19:08:39 +0000 (13:08 -0600)]
Handle all UBSAN built-ins in -Wuninitialized [PR101300].

Resolves:
PR middle-end/101300 - -fsanitize=undefined suppresses -Wuninitialized for a VLA read at -O0

gcc/ChangeLog:
PR middle-end/101300
* tree-ssa-uninit.c (check_defs): Handle UBSAN built-ins.

gcc/testsuite/ChangeLog:
PR middle-end/101300
* gcc.dg/uninit-pr101300.c: New test.

3 years agoAttach MEM_EXPR information when flushing BLKmode args to the stack - V2
Jeff Law [Tue, 20 Jul 2021 18:49:54 +0000 (14:49 -0400)]
Attach MEM_EXPR information when flushing BLKmode args to the stack - V2

gcc/
* function.c (assign_parm_setup_block): Use adjust_address instead
of change_address to preserve MEM_EXPR and friends.

3 years agoAdjust by-value function vec arguments to by-reference.
Martin Sebor [Tue, 20 Jul 2021 17:14:19 +0000 (11:14 -0600)]
Adjust by-value function vec arguments to by-reference.

gcc/c-family/ChangeLog:

* c-common.c (c_build_shufflevector): Adjust by-value argument to
by-const-reference.
* c-common.h (c_build_shufflevector): Same.

gcc/c/ChangeLog:

* c-tree.h (c_build_function_call_vec): Adjust by-value argument to
by-const-reference.
* c-typeck.c (c_build_function_call_vec): Same.

gcc/ChangeLog:

* cfgloop.h (single_likely_exit): Adjust by-value argument to
by-const-reference.
* cfgloopanal.c (single_likely_exit): Same.
* cgraph.h (struct cgraph_node): Same.
* cgraphclones.c (cgraph_node::create_virtual_clone): Same.
* genautomata.c (merge_states): Same.
* genextract.c (VEC_char_to_string): Same.
* genmatch.c (dt_node::gen_kids_1): Same.
(walk_captures): Adjust by-value argument to by-reference.
* gimple-ssa-store-merging.c (check_no_overlap): Adjust by-value argument
to by-const-reference.
* gimple.c (gimple_build_call_vec): Same.
(gimple_build_call_internal_vec): Same.
(gimple_build_switch): Same.
(sort_case_labels): Same.
(preprocess_case_label_vec_for_gimple): Adjust by-value argument to
by-reference.
* gimple.h (gimple_build_call_vec): Adjust by-value argument to
by-const-reference.
(gimple_build_call_internal_vec): Same.
(gimple_build_switch): Same.
(sort_case_labels): Same.
(preprocess_case_label_vec_for_gimple): Adjust by-value argument to
by-reference.
* haifa-sched.c (calc_priorities): Adjust by-value argument to
by-const-reference.
(sched_init_luids): Same.
(haifa_init_h_i_d): Same.
* ipa-cp.c (ipa_get_indirect_edge_target_1): Same.
(adjust_callers_for_value_intersection): Adjust by-value argument to
by-reference.
(find_more_scalar_values_for_callers_subset): Adjust by-value argument to
by-const-reference.
(find_more_contexts_for_caller_subset): Same.
(find_aggregate_values_for_callers_subset): Same.
(copy_useful_known_contexts): Same.
* ipa-fnsummary.c (remap_edge_summaries): Same.
(remap_freqcounting_predicate): Same.
* ipa-inline.c (add_new_edges_to_heap): Adjust by-value argument to
by-reference.
* ipa-predicate.c (predicate::remap_after_inlining): Adjust by-value argument
to by-const-reference.
* ipa-predicate.h (predicate::remap_after_inlining): Same.
* ipa-prop.c (ipa_find_agg_cst_for_param): Same.
* ipa-prop.h (ipa_find_agg_cst_for_param): Same.
* ira-build.c (ira_loop_tree_body_rev_postorder): Same.
* read-rtl.c (add_overload_instance): Same.
* rtl.h (native_decode_rtx): Same.
(native_decode_vector_rtx): Same.
* sched-int.h (sched_init_luids): Same.
(haifa_init_h_i_d): Same.
* simplify-rtx.c (native_decode_vector_rtx): Same.
(native_decode_rtx): Same.
* tree-call-cdce.c (gen_shrink_wrap_conditions): Same.
(shrink_wrap_one_built_in_call_with_conds): Same.
(shrink_wrap_conditional_dead_built_in_calls): Same.
* tree-data-ref.c (create_runtime_alias_checks): Same.
(compute_all_dependences): Same.
* tree-data-ref.h (compute_all_dependences): Same.
(create_runtime_alias_checks): Same.
(index_in_loop_nest): Same.
* tree-if-conv.c (mask_exists): Same.
* tree-loop-distribution.c (class loop_distribution): Same.
(loop_distribution::create_rdg_vertices): Same.
(dump_rdg_partitions): Same.
(debug_rdg_partitions): Same.
(partition_contains_all_rw): Same.
(loop_distribution::distribute_loop): Same.
* tree-parloops.c (oacc_entry_exit_ok_1): Same.
(oacc_entry_exit_single_gang): Same.
* tree-ssa-loop-im.c (hoist_memory_references): Same.
(loop_suitable_for_sm): Same.
* tree-ssa-loop-niter.c (bound_index): Same.
* tree-ssa-reassoc.c (update_ops): Same.
(swap_ops_for_binary_stmt): Same.
(rewrite_expr_tree): Same.
(rewrite_expr_tree_parallel): Same.
* tree-ssa-sccvn.c (ao_ref_init_from_vn_reference): Same.
* tree-ssa-sccvn.h (ao_ref_init_from_vn_reference): Same.
* tree-ssa-structalias.c (process_all_all_constraints): Same.
(make_constraints_to): Same.
(handle_lhs_call): Same.
(find_func_aliases_for_builtin_call): Same.
(sort_fieldstack): Same.
(check_for_overlaps): Same.
* tree-vect-loop-manip.c (vect_create_cond_for_align_checks): Same.
(vect_create_cond_for_unequal_addrs): Same.
(vect_create_cond_for_lower_bounds): Same.
(vect_create_cond_for_alias_checks): Same.
* tree-vect-slp-patterns.c (vect_validate_multiplication): Same.
* tree-vect-slp.c (vect_analyze_slp_instance): Same.
(vect_make_slp_decision): Same.
(vect_slp_bbs): Same.
(duplicate_and_interleave): Same.
(vect_transform_slp_perm_load): Same.
(vect_schedule_slp): Same.
* tree-vectorizer.h (vect_transform_slp_perm_load): Same.
(vect_schedule_slp): Same.
(duplicate_and_interleave): Same.
* tree.c (build_vector_from_ctor): Same.
(build_vector): Same.
(check_vector_cst): Same.
(check_vector_cst_duplicate): Same.
(check_vector_cst_fill): Same.
(check_vector_cst_stepped): Same.
* tree.h (build_vector_from_ctor): Same.

3 years agoPR 100167: Fix vector long long multiply/divide tests on power10.
Michael Meissner [Tue, 20 Jul 2021 16:56:19 +0000 (12:56 -0400)]
PR 100167: Fix vector long long multiply/divide tests on power10.

This patch updates the vector long long multiply and divide tests to
supply the correct code information if power10 code generation is used.

2021-06-18  Michael Meissner  <meissner@linux.ibm.com>

gcc/testsuite/
PR testsuite/100167
* gcc.target/powerpc/fold-vec-div-longlong.c: Fix expected code
generation on power10.
* gcc.target/powerpc/fold-vec-mult-longlong.c: Likewise.

3 years agors6000: Fix up easy_vector_constant_msb handling [PR101384]
Jakub Jelinek [Tue, 20 Jul 2021 15:26:10 +0000 (17:26 +0200)]
rs6000: Fix up easy_vector_constant_msb handling [PR101384]

The following gcc.dg/pr101384.c testcase is miscompiled on
powerpc64le-linux.
easy_altivec_constant has code to try construct vector constants with
different element sizes, perhaps different from CONST_VECTOR's mode.  But as
written, that works fine for vspltis[bhw] cases, but not for the vspltisw
x,-1; vsl[bhw] x,x,x case, because that creates always a V16QImode, V8HImode
or V4SImode constant containing broadcasted constant with just the MSB set.
The vspltis_constant function etc. expects the vspltis[bhw] instructions
where the small [-16..15] or even [-32..30] constant is sign-extended to the
remaining step bytes, but that is not the case for the 0x80...00 constants,
with step > 1 we can't handle e.g.
{ 0x80, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff }
vectors but do want to handle e.g.
{ 0, 0, 0, 0x80, 0, 0, 0, 0x80, 0, 0, 0, 0x80, 0, 0, 0, 0x80 }
and similarly with copies > 1 we do want to handle e.g.
{ 0x80808080, 0x80808080, 0x80808080, 0x80808080 }.

2021-07-20  Jakub Jelinek  <jakub@redhat.com>

PR target/101384
* config/rs6000/rs6000-protos.h (easy_altivec_constant): Change return
type from bool to int.
* config/rs6000/rs6000.c (vspltis_constant): Fix up handling the
EASY_VECTOR_MSB case if either step or copies is not 1.
(vspltis_shifted): Fix comment typo.
(easy_altivec_constant): Change return type from bool to int, instead
of returning true return byte size of the element mode that should be
used to synthetize the constant.
* config/rs6000/predicates.md (easy_vector_constant_msb): Require
that vspltis_shifted is 0, handle the case where easy_altivec_constant
assumes using different vector mode from CONST_VECTOR's mode.
* config/rs6000/altivec.md (easy_vector_constant_msb splitter): Use
easy_altivec_constant to determine mode in which -1 >> -1 should be
performed, use rs6000_expand_vector_init instead of gen_vec_initv4sisi.

* gcc.dg/pr101384.c: New test.
* gcc.target/powerpc/pr101384-1.c: New test.
* gcc.target/powerpc/pr101384-2.c: New test.

3 years agolibstdc++: fix is_default_constructible for hash containers [PR 100863]
Jonathan Wakely [Tue, 20 Jul 2021 14:20:41 +0000 (15:20 +0100)]
libstdc++: fix is_default_constructible for hash containers [PR 100863]

The recent change to _Hashtable_ebo_helper for this PR broke the
is_default_constructible trait for a hash container with a non-default
constructible allocator. That happens because the constructor needs to
be user-provided in order to initialize the member, and so is not
defined as deleted when the type is not default constructible.

By making _Hashtable derive from _Enable_special_members we can ensure
that the default constructor for the std::unordered_xxx containers is
deleted when it would be ill-formed. This makes the trait give the
correct answer.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/100863
* include/bits/hashtable.h (_Hashtable): Conditionally delete
default constructor by deriving from _Enable_special_members.
* testsuite/23_containers/unordered_map/cons/default.cc: New test.
* testsuite/23_containers/unordered_set/cons/default.cc: New test.

3 years agoaarch64: Tweak old vect-* tests to avoid new FAILs
Richard Sandiford [Tue, 20 Jul 2021 14:42:02 +0000 (15:42 +0100)]
aarch64: Tweak old vect-* tests to avoid new FAILs

I'm not sure what these test were originally designed to test.
vaddv and vmaxv seem to be testing for vectorisation, with associated
scan-assembler tests.  But they use arm_neon.h functions to test
the results, which would presumably also trip many of the scans.
That was probably what the split into vect-fmax-fmin.c and
vect-fmaxv-fminv-compile.c was supposed to avoid.

Anyway, the tests started failing after the recent change to allow
staged reductions for epilogue loops.  And epilogues came into play
because the reduction loops iterate LANES-1 rather than LANES times.
(vmaxv was trying to iterate LANES times, but the gimple optimisers
outsmarted it.  The other two explicitly had a count of LANES-1.)

Just suppressing epilogues causes other issues for vaddv and vmaxv.
The easiest fix therefore seemed to be to use an asm to hide the
initial value of the vmaxv loop (so that it really does iterate
LANES times) and then make the others match that style.

gcc/testsuite/
PR testsuite/101506
* gcc.target/aarch64/vect-vmaxv.c: Use an asm to hide the
true initial value of the reduction from the vectorizer.
* gcc.target/aarch64/vect-vaddv.c: Likewise.  Make the vector
loop operate on exactly LANES (rather than LANES-1) iterations.
* gcc.target/aarch64/vect-fmaxv-fminv.x: Likewise.

3 years agolibstdc++: Add more tests for filesystem::create_directory [PR101510]
Jonathan Wakely [Tue, 20 Jul 2021 11:35:37 +0000 (12:35 +0100)]
libstdc++: Add more tests for filesystem::create_directory [PR101510]

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/101510
* src/c++17/fs_ops.cc (create_dir): Adjust whitespace.
* testsuite/27_io/filesystem/operations/create_directory.cc:
Test creating directory with name of existing symlink to
directory.
* testsuite/experimental/filesystem/operations/create_directory.cc:
Likewise.

3 years agodebug/101473 - apply debug prefix maps before checksumming DIEs
Richard Biener [Tue, 20 Jul 2021 09:00:33 +0000 (11:00 +0200)]
debug/101473 - apply debug prefix maps before checksumming DIEs

The following makes sure to apply the debug prefix maps to filenames
before checksumming DIEs to create the global symbol for the CU DIE
used by LTO to link the late debug to the early debug.  This avoids
binary differences (in said symbol) when compiling with toolchains
installed under a different path and that compensated with appropriate
-fdebug-prefix-map options.

The easiest and most scalable way is to record both the unmapped
and the remapped filename in the dwarf_file_data so the remapping
process takes place at a single point and only once (otherwise it
creates GC garbage at each point doing that).

2021-07-20  Richard Biener  <rguenther@suse.de>

PR debug/101473
* dwarf2out.h (dwarf_file_data): Add key member.
* dwarf2out.c (dwarf_file_hasher::equal): Compare key.
(dwarf_file_hasher::hash): Hash key.
(lookup_filename): Remap the filename and store it in the
filename member of dwarf_file_data when creating a new
dwarf_file_data.
(file_name_acquire): Do not remap the filename again.
(maybe_emit_file): Likewise.

3 years agodir-locals: Use https for bug references
Richard Earnshaw [Tue, 20 Jul 2021 10:39:41 +0000 (11:39 +0100)]
dir-locals: Use https for bug references

We've been using https for web references for some time now.

ChangeLog:

* .dir-locals.el (bug-reference-url-format): Use https.

3 years agoLimit fill-column to 79
Richard Earnshaw [Tue, 20 Jul 2021 10:06:01 +0000 (11:06 +0100)]
Limit fill-column to 79

The current line-length limit is set to 80, but that allows a
character to appear in the 80th column, and that causes emacs to
display a line-wrap followed by a blank line when the display/window
width is 80 columns.  Furthermore, this seems to contradict the
coding-style rules on the wiki which suggest that the line limit
should be 79.

So reduce the line width in both the emacs control file and the
contrib vimrc file to 79 characters.

ChangeLog:

* .dir-locals.el (c-mode): Change fill-column to 79.

contrib/ChangeLog:

* vimrc (textwidth): Change non-gitcommit length to 79.

3 years agoaarch64: Refactor TBL/TBX RTL patterns
Jonathan Wright [Fri, 9 Jul 2021 09:12:19 +0000 (10:12 +0100)]
aarch64: Refactor TBL/TBX RTL patterns

Rename two-source-register TBL/TBX RTL patterns so that their names
better reflect what they do, rather than confusing them with tbl3 or
tbx4 patterns. Also use the correct "neon_tbl2" type attribute for
both patterns.

Rename single-source-register TBL/TBX patterns for consistency.

gcc/ChangeLog:

2021-07-08  Jonathan Wright  <jonathan.wright@arm.com>

* config/aarch64/aarch64-simd-builtins.def: Use two variant
generators for all TBL/TBX intrinsics and rename to
consistent forms: qtbl[1234] or qtbx[1234].
* config/aarch64/aarch64-simd.md (aarch64_tbl1<mode>):
Rename to...
(aarch64_qtbl1<mode>): This.
(aarch64_tbx1<mode>): Rename to...
(aarch64_qtbx1<mode>): This.
(aarch64_tbl2v16qi): Delete.
(aarch64_tbl3<mode>): Rename to...
(aarch64_qtbl2<mode>): This.
(aarch64_tbx4<mode>): Rename to...
(aarch64_qtbx2<mode>): This.
* config/aarch64/aarch64.c (aarch64_expand_vec_perm_1): Use
renamed qtbl1 and qtbl2 RTL patterns.
* config/aarch64/arm_neon.h (vqtbl1_p8): Use renamed qtbl1
RTL pattern.
(vqtbl1_s8): Likewise.
(vqtbl1_u8): Likewise.
(vqtbl1q_p8): Likewise.
(vqtbl1q_s8): Likewise.
(vqtbl1q_u8): Likewise.
(vqtbx1_s8): Use renamed qtbx1 RTL pattern.
(vqtbx1_u8): Likewise.
(vqtbx1_p8): Likewise.
(vqtbx1q_s8): Likewise.
(vqtbx1q_u8): Likewise.
(vqtbx1q_p8): Likewise.
(vtbl1_s8): Use renamed qtbl1 RTL pattern.
(vtbl1_u8): Likewise.
(vtbl1_p8): Likewise.
(vtbl2_s8): Likewise
(vtbl2_u8): Likewise.
(vtbl2_p8): Likewise.
(vtbl3_s8): Use renamed qtbl2 RTL pattern.
(vtbl3_u8): Likewise.
(vtbl3_p8): Likewise.
(vtbl4_s8): Likewise.
(vtbl4_u8): Likewise.
(vtbl4_p8): Likewise.
(vtbx2_s8): Use renamed qtbx2 RTL pattern.
(vtbx2_u8): Likewise.
(vtbx2_p8): Likewise.
(vqtbl2_s8): Use renamed qtbl2 RTL pattern.
(vqtbl2_u8): Likewise.
(vqtbl2_p8): Likewise.
(vqtbl2q_s8): Likewise.
(vqtbl2q_u8): Likewise.
(vqtbl2q_p8): Likewise.
(vqtbx2_s8): Use renamed qtbx2 RTL pattern.
(vqtbx2_u8): Likewise.
(vqtbx2_p8): Likewise.
(vqtbx2q_s8): Likewise.
(vqtbx2q_u8): Likewise.
(vqtbx2q_p8): Likewise.
(vtbx4_s8): Likewise.
(vtbx4_u8): Likewise.
(vtbx4_p8): Likewise.

3 years ago[gcn] Work-around libgomp 'error: array subscript 0 is outside array bounds of ‘__lds...
Thomas Schwinge [Mon, 19 Jul 2021 21:11:38 +0000 (23:11 +0200)]
[gcn] Work-around libgomp 'error: array subscript 0 is outside array bounds of ‘__lds struct gomp_thread * __lds[0]’ [-Werror=array-bounds]' some more [PR101484]

With yesterday's commit 9f2bc5077debef2b046b6c10d38591ac324ad8b5 "[gcn]
Work-around libgomp 'error: array subscript 0 is outside array bounds of
‘__lds struct gomp_thread * __lds[0]’ [-Werror=array-bounds]' [PR101484]",
I did defuse the "unexpected" '-Werror=array-bounds' diagnostics that we see
as of commit a110855667782dac7b674d3e328b253b3b3c919b "Correct handling of
variable offset minus constant in -Warray-bounds [PR100137]".  However, these
'#pragma GCC diagnostic [...]' directives cause some code generation changes
(that seems unexpected, problematic!), which results in a lot (ten thousands)
of 'GCN team arena exhausted' run-time diagnostics, also leading to a few
FAILs:

    PASS: libgomp.c/../libgomp.c-c++-common/for-11.c (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.c/../libgomp.c-c++-common/for-11.c execution test

    PASS: libgomp.c/../libgomp.c-c++-common/for-12.c (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.c/../libgomp.c-c++-common/for-12.c execution test

    PASS: libgomp.c/../libgomp.c-c++-common/for-3.c (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.c/../libgomp.c-c++-common/for-3.c execution test

    PASS: libgomp.c/../libgomp.c-c++-common/for-5.c (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.c/../libgomp.c-c++-common/for-5.c execution test

    PASS: libgomp.c/../libgomp.c-c++-common/for-6.c (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.c/../libgomp.c-c++-common/for-6.c execution test

    PASS: libgomp.c/../libgomp.c-c++-common/for-9.c (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.c/../libgomp.c-c++-common/for-9.c execution test

Same for 'libgomp.c++'.

It remains to be analyzed how '#pragma GCC diagnostic [...]' directives can
cause code generation changes; for now I'm working around the "unexpected"
'-Werror=array-bounds' diagnostics differently.

Overall, still awaiting a different solution, of course.

libgomp/
PR target/101484
* configure.tgt [amdgcn*-*-*] (XCFLAGS): Add
'-Wno-error=array-bounds'.
* config/gcn/team.c: Remove '-Werror=array-bounds' work-around.
* libgomp.h [__AMDGCN__]: Likewise.

3 years agoi386: Remove atomic_storedi_fpu and atomic_loaddi_fpu peepholes [PR100182]
Uros Bizjak [Tue, 20 Jul 2021 04:15:16 +0000 (06:15 +0200)]
i386: Remove atomic_storedi_fpu and atomic_loaddi_fpu peepholes [PR100182]

These patterns result in non-atomic sequence.

2021-07-21  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
PR target/100182
* config/i386/sync.md (define_peephole2 atomic_storedi_fpu):
Remove.
(define_peephole2 atomic_loaddi_fpu): Ditto.

gcc/testsuite/
PR target/100182
* gcc.target/i386/pr71245-1.c: Remove.
* gcc.target/i386/pr71245-2.c: Ditto.

3 years agoRISC-V: Detect python and pick best one for calling multilib-generator
Kito Cheng [Tue, 20 Jul 2021 03:02:27 +0000 (11:02 +0800)]
RISC-V: Detect python and pick best one for calling multilib-generator

gcc/

* config.gcc (riscv*-*-*): Detect which python is available.

3 years agors6000: Support [u]mul<mode>3_highpart for vector
Kewen Lin [Tue, 20 Jul 2021 01:50:13 +0000 (20:50 -0500)]
rs6000: Support [u]mul<mode>3_highpart for vector

This patch is to make Power10 newly introduced vector
multiply high (part) instructions exploited in vectorized
loops, it renames existing define_insns as standard pattern
names.  It depends on that patch which enables vectorizer
to recog mul_highpart.

gcc/ChangeLog:

* config/rs6000/vsx.md (mulhs_<mode>): Rename to...
(smul<mode>3_highpart): ... this.
(mulhu_<mode>): Rename to...
(umul<mode>3_highpart): ... this.
* config/rs6000/rs6000-builtin.def (MULHS_V2DI, MULHS_V4SI,
MULHU_V2DI, MULHU_V4SI): Adjust.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/mul-vectorize-3.c: New test.
* gcc.target/powerpc/mul-vectorize-4.c: New test.

3 years agovect: Recog mul_highpart pattern [PR100696]
Kewen Lin [Tue, 20 Jul 2021 01:49:17 +0000 (20:49 -0500)]
vect: Recog mul_highpart pattern [PR100696]

This patch is to extend the existing pattern mulhs handlings
to cover normal multiply highpart pattern recognization, it
introduces one new internal function IFN_MULH for 1:1 map to
[su]mul_highpart optab.  Since it covers MULT_HIGHPART_EXPR
with optab support, i386 part change is to ensure it follows
the consistent costing path.

Bootstrapped & regtested on powerpc64le-linux-gnu P9,
x86_64-redhat-linux and aarch64-linux-gnu.

gcc/ChangeLog:

PR tree-optimization/100696
* internal-fn.c (first_commutative_argument): Add info for IFN_MULH.
* internal-fn.def (IFN_MULH): New internal function.
* tree-vect-patterns.c (vect_recog_mulhs_pattern): Add support to
recog normal multiply highpart as IFN_MULH.
* config/i386/i386.c (ix86_add_stmt_cost): Adjust for combined
function CFN_MULH.

gcc/testsuite/ChangeLog:

PR tree-optimization/100696
* gcc.target/i386/pr100637-3w.c: Adjust for mul_highpart recog.

3 years agoDaily bump.
GCC Administrator [Tue, 20 Jul 2021 00:16:38 +0000 (00:16 +0000)]
Daily bump.

3 years agocompiler: avoid aliases in receiver types
Ian Lance Taylor [Mon, 19 Jul 2021 18:53:05 +0000 (11:53 -0700)]
compiler: avoid aliases in receiver types

If a package declares a method on an alias type, the alias would be
used in the export data.  This would then trigger a compiler
assertion on import: we should not be adding methods to aliases.

Fix the problem by ensuring that receiver types do not use alias types.
This seems preferable to consistently avoiding aliases in export data,
as aliases can cross packages.  And it's painful to try to patch this
while writing the export data, as at that point all the types are known.

Test case is https://golang.org/cl/335172.

Fixes golang/go#47131

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/335729

3 years agoPR testsuite 101520 - gcc.target/powerpc/pr93658.c has excess errors
Martin Sebor [Mon, 19 Jul 2021 22:45:10 +0000 (16:45 -0600)]
PR testsuite 101520 - gcc.target/powerpc/pr93658.c has excess errors

gcc/testsuite/ChangeLog:
* gcc.target/powerpc/pr93658.c: Suppress valid warnings.

3 years agocoroutines: Adjust outlined function names [PR95520].
Iain Sandoe [Thu, 8 Jul 2021 08:42:49 +0000 (09:42 +0100)]
coroutines: Adjust outlined function names [PR95520].

The mechanism used to date for uniquing the coroutine helper
functions (actor, destroy) was over-complicating things and
leading to the noted PR and also difficulties in setting
breakpoints on these functions (so this will help PR99215 as
well).

This implementation delegates the adjustment to the mangling
to write_encoding() which necessitates some book-keeping so
that it is possible to determine which of the coroutine
helper names is to be mangled.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/95520 - [coroutines] __builtin_FUNCTION() returns mangled .actor instead of original function name

PR c++/95520

gcc/cp/ChangeLog:

* coroutines.cc (struct coroutine_info): Add fields for
actor and destroy function decls.
(to_ramp): New.
(coro_get_ramp_function): New.
(coro_get_actor_function): New.
(coro_get_destroy_function): New.
(act_des_fn): Set up mapping between ramp, actor and
destroy functions.
(morph_fn_to_coro): Adjust interface to the builder for
helper function decls.
* cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
JOIN_STR): New.
* mangle.c (write_encoding): Handle coroutine helpers.
(write_unqualified_name): Handle lambda coroutine helpers.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/pr95520.C: New test.

3 years agoanalyzer: add svalue::can_have_associated_state_p [PR101503]
David Malcolm [Mon, 19 Jul 2021 19:44:02 +0000 (15:44 -0400)]
analyzer: add svalue::can_have_associated_state_p [PR101503]

PR analyzer/101503 reports an assertion failure due to an unexpected
"UNKNOWN" value (due to using --param analyzer-max-svalue-depth=0).

This patch fixes this by rejecting attempts to purge state involving
unknown/poisoned svalues (in region_model::purge_state_involving),
as these svalues should not have state associated with them - they
are singletons w.r.t each type.

To be more systematic about this, the patch also introduces a new
svalue::can_have_associated_state_p which returns false for
unknown/poisoned svalues, so that we can reject adding constraints
or sm-state on them, or building various kinds of svalue in terms
of them (e.g. unary ops, binary ops, etc).

gcc/analyzer/ChangeLog:
PR analyzer/101503
* constraint-manager.cc (constraint_manager::add_constraint): Use
can_have_associated_state_p rather than testing for unknown.
(constraint_manager::get_or_add_equiv_class): Likewise.
* program-state.cc (sm_state_map::set_state): Likewise.
(sm_state_map::impl_set_state): Add assertion.
* region-model-manager.cc
(region_model_manager::maybe_fold_unaryop): Handle poisoned
values.
(region_model_manager::maybe_fold_binop): Move handling of unknown
values...
(region_model_manager::get_or_create_binop): ...to here, and
generalize to use can_have_associated_state_p.
(region_model_manager::maybe_fold_sub_svalue): Use
can_have_associated_state_p rather than testing for unknown.
(region_model_manager::maybe_fold_repeated_svalue): Use unknown
when the size or repeated value is "unknown"/"poisoned".
* region-model.cc (region_model::purge_state_involving): Reject
attempts to purge unknown/poisoned svalues, as these svalues
should not have state associated with them.
* svalue.cc (sub_svalue::sub_svalue): Assert that we're building
on top of an svalue with can_have_associated_state_p.
(repeated_svalue::repeated_svalue): Likewise.
(bits_within_svalue::bits_within_svalue): Likewise.
* svalue.h (svalue::can_have_associated_state_p): New.
(unknown_svalue::can_have_associated_state_p): New.
(poisoned_svalue::can_have_associated_state_p): New.
(unaryop_svalue::unaryop_svalue): Assert that we're building on
top of an svalue with can_have_associated_state_p.
(binop_svalue::binop_svalue): Likewise.
(widening_svalue::widening_svalue): Likewise.

gcc/testsuite/ChangeLog:
PR analyzer/101503
* gcc.dg/analyzer/pr101503.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
3 years agodebug: Allow means for targets to opt out of CTF/BTF support
Indu Bhagat [Mon, 19 Jul 2021 17:24:59 +0000 (10:24 -0700)]
debug: Allow means for targets to opt out of CTF/BTF support

CTF/BTF debug formats can be safely enabled for all ELF-based targets by
default in GCC.

CTF/BTF debug formats now adopt a similar approach as taken for DWARF debug
format via the DWARF2_DEBUGGING_INFO.
  - By default, CTF/BTF formats can be enabled for all ELF-based targets.
  - By default, CTF/BTF formats can be disabled for all non ELF-based targets.
  - If the user passed a -gctf but CTF is not enabled for the target, GCC
  issues an error to the user (as is done currently with other debug formats) -
  "target system does not support the 'ctf' debug format". Analogous behavior
  for -gbtf command line option.

A previous commit disabled the CTF and BTF testcases on the AIX platform. This
is not necessary now that CTF and BTF debug formats are disabled by default on
all non-ELF targets. GCC emits an error message when -gctf/-gbtf is used on
such platforms and these tests will be skipped.

gcc/

* config/elfos.h (CTF_DEBUGGING_INFO): New definition.
(BTF_DEBUGGING_INFO): Likewise.
* doc/tm.texi.in: Document the new macros.
* doc/tm.texi: Regenerated.
* toplev.c: Guard initialization of debug hooks.

gcc/testsuite/

* gcc.dg/debug/btf/btf.exp: Do not run BTF testsuite if target does not
support BTF format. Remove redundant check for AIX.
* gcc.dg/debug/ctf/ctf.exp: Do not run CTF testsuite if target does not
support CTF format. Remove redundant check for AIX.
* lib/gcc-dg.exp: Remove redundant check for AIX.

3 years agodebug: Add new function ctf_debuginfo_p
Indu Bhagat [Mon, 19 Jul 2021 17:23:27 +0000 (10:23 -0700)]
debug: Add new function ctf_debuginfo_p

gcc/

* flags.h (ctf_debuginfo_p): New function declaration.
* opts.c (ctf_debuginfo_p): New function definition.

3 years agoamdgcn: Add -mxnack and -msram-ecc [PR 100208]
Andrew Stubbs [Thu, 8 Jul 2021 14:47:53 +0000 (15:47 +0100)]
amdgcn: Add -mxnack and -msram-ecc [PR 100208]

gcc/ChangeLog:

PR target/100208
* config/gcn/gcn-hsa.h (DRIVER_SELF_SPECS): New.
(ASM_SPEC): Set -mattr for xnack and sram-ecc.
* config/gcn/gcn-opts.h (enum sram_ecc_type): New.
* config/gcn/gcn-valu.md: Add a warning comment.
* config/gcn/gcn.c (gcn_option_override): Add "sorry" for -mxnack.
(output_file_start): Add xnack and sram-ecc state to ".amdgcn_target".
* config/gcn/gcn.md: Add a warning comment.
* config/gcn/gcn.opt: Add -mxnack and -msram-ecc.
* config/gcn/mkoffload.c (EF_AMDGPU_MACH_AMDGCN_GFX908): Remove
SRAM-ECC flag.
(EF_AMDGPU_XNACK): New.
(EF_AMDGPU_SRAM_ECC): New.
(elf_flags): New.
(copy_early_debug_info): Use elf_flags.
(main): Handle -mxnack and -msram-ecc options.
* doc/invoke.texi: Document -mxnack and -msram-ecc.

gcc/testsuite/ChangeLog:

PR target/100208
* gcc.target/gcn/sram-ecc-1.c: New test.
* gcc.target/gcn/sram-ecc-2.c: New test.
* gcc.target/gcn/sram-ecc-3.c: New test.
* gcc.target/gcn/sram-ecc-4.c: New test.
* gcc.target/gcn/sram-ecc-5.c: New test.
* gcc.target/gcn/sram-ecc-6.c: New test.
* gcc.target/gcn/sram-ecc-7.c: New test.
* gcc.target/gcn/sram-ecc-8.c: New test.

3 years ago[AARCH64] Fix PR 101205: csinv does not have an zero_extend version
Andrew Pinski [Sat, 17 Jul 2021 08:16:28 +0000 (01:16 -0700)]
[AARCH64] Fix PR 101205: csinv does not have an zero_extend version

So the problem is even though there was a csneg with
a zero_extend in the front, there was not one for csinv.
This fixes it by extending that pattern.

OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions.

gcc/ChangeLog:

PR target/101205
* config/aarch64/aarch64.md (csneg3_uxtw_insn): Rename to ...
(*cs<neg_not_cs>3_uxtw_insn4): and extend to NEG_NOT.

gcc/testsuite/ChangeLog:

PR target/101205
* gcc.target/aarch64/csinv-neg-1.c: New test.

3 years agoc++: Add test for DR 2126
Marek Polacek [Mon, 19 Jul 2021 14:16:42 +0000 (10:16 -0400)]
c++: Add test for DR 2126

DR 2126

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/constexpr-temp2.C: New test.

3 years agotree-optimization/101505 - properly determine stmt precision for PHIs
Richard Biener [Mon, 19 Jul 2021 11:29:16 +0000 (13:29 +0200)]
tree-optimization/101505 - properly determine stmt precision for PHIs

Loop vectorization pattern recog fails to walk PHIs when determining
stmt precisions.  This fails to recognize non-mask uses for bools
in PHIs and outer loop vectorization.

2021-07-19  Richard Biener  <rguenther@suse.de>

PR tree-optimization/101505
* tree-vect-patterns.c (vect_determine_precisions): Walk
PHIs also for loop vectorization.

* gcc.dg/vect/pr101505.c: New testcase.

3 years ago[gcn] Work-around libgomp 'error: array subscript 0 is outside array bounds of ‘__lds...
Thomas Schwinge [Fri, 16 Jul 2021 17:12:02 +0000 (19:12 +0200)]
[gcn] Work-around libgomp 'error: array subscript 0 is outside array bounds of ‘__lds struct gomp_thread * __lds[0]’ [-Werror=array-bounds]' [PR101484]

... seen as of commit a110855667782dac7b674d3e328b253b3b3c919b "Correct
handling of variable offset minus constant in -Warray-bounds [PR100137]".

Awaiting a different solution, of course.

libgomp/
PR target/101484
* config/gcn/team.c: Apply '-Werror=array-bounds' work-around.
* libgomp.h [__AMDGCN__]: Likewise.

3 years agoRemove gimple_expr_type
Richard Biener [Fri, 16 Jul 2021 12:56:38 +0000 (14:56 +0200)]
Remove gimple_expr_type

This removes the transitional gimple_expr_type API.

2021-07-16  Richard Biener  <rguenther@suse.de>

* gimple.h (gimple_expr_type): Remove.
* doc/gimple.texi: Remove gimple_expr_type documentation.