]> gcc.gnu.org Git - gcc.git/log
gcc.git
3 years agoarm: Remove use of opts_set in arm_configure_build_target [PR100767]
Richard Earnshaw [Thu, 27 May 2021 09:25:37 +0000 (10:25 +0100)]
arm: Remove use of opts_set in arm_configure_build_target [PR100767]

The variable global_options_set is a reflection of which options have
been explicitly set from the command line in the structure
global_options.  But it doesn't describe the contents of a
cl_target_option.  cl_target_option is a set of options to apply and
once configured should represent a viable set of options without
needing to know which were explicitly set by the user.

Unfortunately arm_configure_build_target was incorrectly conflating
the two.  Fortunately, however, we do not really need to know this
since the various override_options functions should have sanitized the
target_options values before constructing a cl_target_option
structure.  It is safe, therefore, to simply drop this parameter to
arm_configure_build_target and rely on checking that various string
parameters are non-null before dereferencing them.

gcc:

PR target/100767
* config/arm/arm.c (arm_configure_build_target): Remove parameter
opts_set, directly check opts parameters for being non-null.
(arm_option_restore): Update call to arm_configure_build_target.
(arm_option_override): Likewise.
(arm_can_inline_p): Likewise.
(arm_valid_target_attribute_tree): Likewise.
* config/arm/arm-c.c (arm_pragma_target_parse): Likewise.
* config/arm/arm-protos.h (arm_configure_build_target): Adjust
prototype.

(cherry picked from commit 262e75d22c350acbdf4c1fb4f224cc5d3d711eff)

3 years agoarm: Avoid emitting bogus CFA adjusts for CMSE nonsecure calls [PR99725]
Alex Coplan [Tue, 11 May 2021 12:11:09 +0000 (13:11 +0100)]
arm: Avoid emitting bogus CFA adjusts for CMSE nonsecure calls [PR99725]

The PR shows us attaching REG_CFA_ADJUST_CFA notes to stack pointer
adjustments emitted in cmse_nonsecure_call_inline_register_clear (when
-march=armv8.1-m.main). However, the stack pointer is not guaranteed to
be the CFA reg. If we're at -O0 or we have -fno-omit-frame-pointer, then
the frame pointer will be used as the CFA reg, and these notes on the sp
adjustments will lead to ICEs in dwarf2out_frame_debug_adjust_cfa.

This patch avoids emitting these notes if the current function has a
frame pointer.

gcc/ChangeLog:

PR target/99725
* config/arm/arm.c (cmse_nonsecure_call_inline_register_clear):
Avoid emitting CFA adjusts on the sp if we have the fp.

gcc/testsuite/ChangeLog:

PR target/99725
* gcc.target/arm/cmse/pr99725.c: New test.

(cherry picked from commit 2ac1f0eb3887335b7a7e845812956fa436e72a91)

3 years agoDaily bump.
GCC Administrator [Thu, 27 May 2021 00:18:31 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 26 May 2021 00:18:21 +0000 (00:18 +0000)]
Daily bump.

3 years agoFortran: fix passing return value to class(*) dummy argument
Harald Anlauf [Sun, 23 May 2021 18:51:14 +0000 (20:51 +0200)]
Fortran: fix passing return value to class(*) dummy argument

gcc/fortran/ChangeLog:

PR fortran/100551
* trans-expr.c (gfc_conv_procedure_call): Adjust check for
implicit conversion of actual argument to an unlimited polymorphic
procedure argument.

gcc/testsuite/ChangeLog:

PR fortran/100551
* gfortran.dg/pr100551.f90: New test.

(cherry picked from commit fe03f4fc9548b3fdbff3c8284a994feaa7d6307d)

3 years agoi386: Fix split_double_mode with paradoxical subreg [PR100626]
Uros Bizjak [Tue, 18 May 2021 13:45:54 +0000 (15:45 +0200)]
i386: Fix split_double_mode with paradoxical subreg [PR100626]

split_double_mode calls simplify_gen_subreg, which fails for the
high half of the paradoxical subreg.  Return temporary register
instead of NULL RTX in this case.

2021-05-18  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
PR target/100626
* config/i386/i386-expand.c (split_double_mode): Return
temporary register when simplify_gen_subreg fails with
the high half od the paradoxical subreg.

(cherry picked from commit d39fbed75810fc7478842503ecb0268b85dc9c2e)

3 years agofortran/intrinsic.texi: Fix copy'n'paste errors and typos
Tobias Burnus [Tue, 25 May 2021 07:17:07 +0000 (09:17 +0200)]
fortran/intrinsic.texi: Fix copy'n'paste errors and typos

gcc/fortran/ChangeLog:

* intrinsic.texi (GERROR, GETARGS, GETLOG, NORM2, PARITY, RANDOM_INIT,
RANDOM_NUMBER): Fix typos and copy'n'paste errors.

Co-Authored-By: Johannes Nendwich <a08727063@unet.univie.ac.at>
(cherry picked from commit d8f6ceb58e6f506866cf0eacd2874f30743ea47c)

3 years agoFix typo and weird syntax in configure script
Eric Botcazou [Tue, 25 May 2021 10:12:08 +0000 (12:12 +0200)]
Fix typo and weird syntax in configure script

c++tools/
* configure.ac (--enable-maintainer-mode): Fix typo and weird syntax.
* configure: Regenerate.

3 years agotree-optimization/100519 - avoid reassociating asm goto defs
Richard Biener [Tue, 11 May 2021 12:59:59 +0000 (14:59 +0200)]
tree-optimization/100519 - avoid reassociating asm goto defs

This splits can_associate_p into checks for SSA defs and checks
for the type so it can be called from is_reassociable_op to
catch cases not catched by the earlier fix.

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

PR tree-optimization/100519
* tree-ssa-reassoc.c (can_associate_p): Split into...
(can_associate_op_p): ... this
(can_associate_type_p): ... and this.
(is_reassociable_op): Call can_associate_op_p.
(break_up_subtract_bb): Call the appropriate predicates.
(reassociate_bb): Likewise.

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

(cherry picked from commit cd36bbb2281ada10b5e1df143ecf64b88cdb8119)

3 years agoipa/100513 - fix SSA_NAME_DEF_STMT corruption in IPA param manip
Richard Biener [Tue, 11 May 2021 11:23:45 +0000 (13:23 +0200)]
ipa/100513 - fix SSA_NAME_DEF_STMT corruption in IPA param manip

This fixes unintended clobbering of SSA_NAME_DEF_STMT of the
cloned/inlined from SSA name during IPA parameter manipulation
of call stmt LHSs.  gimple_call_set_lhs adjusts SSA_NAME_DEF_STMT
of the lhs to the stmt being modified but when
ipa_param_body_adjustments::modify_call_stmt is called the
cloning/inlining process has not yet remapped the stmts operands
to the copy variants but they are still original.

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

PR ipa/100513
* ipa-param-manipulation.c
(ipa_param_body_adjustments::modify_call_stmt): Avoid
altering SSA_NAME_DEF_STMT by adjusting the calls LHS
via gimple_call_lhs_ptr.

(cherry picked from commit 7e0fe7761da9255c9342788956c37b426875d872)

3 years agomiddle-end/100509 - avoid folding constant to aggregate type
Richard Biener [Tue, 11 May 2021 08:58:35 +0000 (10:58 +0200)]
middle-end/100509 - avoid folding constant to aggregate type

When folding a constant initializer looking through aliases to
incompatible types can lead to us trying to fold a constant
to an aggregate type which can't work.  Simply avoid trying
to constant fold non-register typed symbols.

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

PR middle-end/100509
* gimple-fold.c (fold_gimple_assign): Only call
get_symbol_constant_value on register type symbols.

* gcc.dg/pr100509.c: New testcase.

(cherry picked from commit ca8e8301180fa71de1a76769fc038df2ab85dfeb)

3 years agotree-optimization/100492 - avoid irreducible regions in loop distribution
Richard Biener [Mon, 10 May 2021 09:37:27 +0000 (11:37 +0200)]
tree-optimization/100492 - avoid irreducible regions in loop distribution

When we distribute away a condition we rely on the ability to
change it to either 1 != 0 or 0 != 0 depending on the direction
of the exit branch in the respective loop.  But when the loop
contains an irreducible sub-region then for the conditions inside
this this fails and can lead to infinite loops being generated.

Avoid distibuting loops with irreducible sub-regions.

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

PR tree-optimization/100492
* tree-loop-distribution.c (find_seed_stmts_for_distribution):
Find nothing when the loop contains an irreducible region.

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

(cherry picked from commit 60af2db18013a0339302928ba98fee893ccc1957)

3 years agoDaily bump.
GCC Administrator [Tue, 25 May 2021 00:18:36 +0000 (00:18 +0000)]
Daily bump.

3 years agoarm: Fix wrong code with MVE V2DImode loads and stores [PR99960]
Alex Coplan [Mon, 10 May 2021 08:46:45 +0000 (09:46 +0100)]
arm: Fix wrong code with MVE V2DImode loads and stores [PR99960]

As the PR shows, we currently miscompile V2DImode loads and stores for
MVE.  We're currently using 64-bit loads/stores, but need to be using
128-bit vector loads and stores. Fixed thusly.

Some intrinsics tests were checking that we (incorrectly) used the
64-bit loads/stores: these have been updated.

gcc/ChangeLog:

PR target/99960
* config/arm/mve.md (*mve_mov<mode>): Simplify output code. Use
vldrw.u32 and vstrw.32 for V2D[IF]mode loads and stores.

gcc/testsuite/ChangeLog:

PR target/99960
* gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_s64.c:
Update now that we're (correctly) using full 128-bit vector
loads/stores.
* gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_u64.c:
Likewise.
* gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_s64.c:
Likewise.
* gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_u64.c:
Likewise.
* gcc.target/arm/mve/intrinsics/vuninitializedq_int.c: Likewise.
* gcc.target/arm/mve/intrinsics/vuninitializedq_int1.c:
Likewise.

(cherry picked from commit 7596c762137f26f495b53ec93471273887832e31)

3 years agoDaily bump.
GCC Administrator [Mon, 24 May 2021 00:18:14 +0000 (00:18 +0000)]
Daily bump.

3 years agofortran/intrinsic.texi: Use proper variable name
Tobias Burnus [Sun, 23 May 2021 09:56:39 +0000 (11:56 +0200)]
fortran/intrinsic.texi: Use proper variable name

gcc/fortran/ChangeLog:

* intrinsic.texi (ATOMIC_ADD, ATOMIC_FETCH_ADD): Use the
proper variable name in the description.

(cherry picked from commit 5d3ef9189a7c57679b5fb06e51c90479df0548b0)

3 years agoDaily bump.
GCC Administrator [Sun, 23 May 2021 00:18:02 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 22 May 2021 00:18:07 +0000 (00:18 +0000)]
Daily bump.

3 years agolibsanitizer: Remove cyclades from libsanitizer
Tamar Christina [Fri, 21 May 2021 09:30:59 +0000 (10:30 +0100)]
libsanitizer: Remove cyclades from libsanitizer

The Linux kernel has removed the interface to cyclades from
the latest kernel headers[1] due to them being orphaned for the
past 13 years.

libsanitizer uses this header when compiling against glibc, but
glibcs itself doesn't seem to have any references to cyclades.

Further more it seems that the driver is broken in the kernel and
the firmware doesn't seem to be available anymore.

As such since this is breaking the build of libsanitizer (and so the
GCC bootstrap[2]) I propose to remove this.

[1] https://lkml.org/lkml/2021/3/2/153
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379

libsanitizer/ChangeLog:

PR sanitizer/100379
* sanitizer_common/sanitizer_common_interceptors_ioctl.inc: Cherry-pick
llvm-project revision f7c5351552387bd43f6ca3631016d7f0dfe0f135.
* sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise.
* sanitizer_common/sanitizer_platform_limits_posix.h: Likewise.

(cherry picked from commit 745dae5923aba02982563481d75a21595df22ff8)

3 years agoFix internal error on locally derived bit-packed array type
Eric Botcazou [Fri, 21 May 2021 08:57:02 +0000 (10:57 +0200)]
Fix internal error on locally derived bit-packed array type

This is a regression present on the mainline, 11 and 10 branches,
in the form of an ICE on a locally derived bit-packed array type.

gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Process
the implementation type of a packed type implemented specially.
gcc/testsuite/
* gnat.dg/derived_type7.adb, gnat.dg/derived_type7.ads: New test.

3 years agoAlways translate Is_Pure flag into pure in C sense
Eric Botcazou [Fri, 21 May 2021 08:45:21 +0000 (10:45 +0200)]
Always translate Is_Pure flag into pure in C sense

Gigi has historically translated the Is_Pure flag of the front-end into
the "const" attribute of GNU C.  That's correct for subprograms of pure
Ada units, but not fully exact according to the semantics of the flag.

gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_subprog_type): Always translate
the Is_Pure flag into the "pure" attribute of GNU C.

3 years agoFix segfault at run time on strict-alignment platforms
Eric Botcazou [Fri, 21 May 2021 08:40:41 +0000 (10:40 +0200)]
Fix segfault at run time on strict-alignment platforms

This fixes a regression present on the mainline and 11 branch by
restricting the problematic change dealing with bitfields whose
nomimal subtype is self-referential to the cases where the size
is really lower.

gcc/ada/
* gcc-interface/trans.c (Call_to_gnu): Restrict previous change
to bitfields whose size is not equal to the type size.
(gnat_to_gnu): Likewise.

3 years agoFix incorrect SLOC on instruction
Eric Botcazou [Fri, 21 May 2021 08:26:50 +0000 (10:26 +0200)]
Fix incorrect SLOC on instruction

This puts the missing SLOC on a statement generated by a return.

gcc/ada/
* gcc-interface/trans.c (gnat_to_gnu) <N_Simple_Return_Statement>:
Put a SLOC on the assignment from the return value to the return
object in the copy-in/copy-out case.

3 years agoDaily bump.
GCC Administrator [Fri, 21 May 2021 00:18:54 +0000 (00:18 +0000)]
Daily bump.

3 years agoc++: designated init with anonymous union [PR100489]
Jason Merrill [Thu, 20 May 2021 01:12:45 +0000 (21:12 -0400)]
c++: designated init with anonymous union [PR100489]

My patch for PR98463 added an assert that tripped on this testcase, because
we ended up with a U CONSTRUCTOR with an initializer for a, which is not a
member of U.  We need to wrap the a initializer in another CONSTRUCTOR for
the anonymous union.

There was already support for this in process_init_constructor_record, but
not in process_init_constructor_union.  But since this is about brace
elision, it really belongs under reshape_init rather than digest_init, so
this patch moves the handling to reshape_init_class, which also handles
unions.

PR c++/100489

gcc/cp/ChangeLog:

* decl.c (reshape_init_class): Handle designator for
member of anonymous aggregate here.
* typeck2.c (process_init_constructor_record): Not here.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/desig18.C: New test.

3 years agoPR100281 C++: Fix SImode pointer handling
Andreas Krebbel [Tue, 27 Apr 2021 08:09:06 +0000 (10:09 +0200)]
PR100281 C++: Fix SImode pointer handling

The problem appears to be triggered by two locations in the front-end
where non-POINTER_SIZE pointers aren't handled right now.

1. An assertion in strip_typedefs is triggered because the alignment
of the types don't match. This in turn is caused by creating the new
type with build_pointer_type instead of taking the type of the
original pointer into account.

2. An assertion in cp_convert_to_pointer is triggered which expects
the target type to always have POINTER_SIZE.

gcc/cp/ChangeLog:

PR c++/100281
* cvt.c (cp_convert_to_pointer): Use the size of the target
pointer type.
* tree.c (cp_build_reference_type): Call
cp_build_reference_type_for_mode with VOIDmode.
(cp_build_reference_type_for_mode): Rename from
cp_build_reference_type.  Add MODE argument and invoke
build_reference_type_for_mode.
(strip_typedefs): Use build_pointer_type_for_mode and
cp_build_reference_type_for_mode for pointers and references.

gcc/ChangeLog:

PR c++/100281
* tree.c (build_reference_type_for_mode)
(build_pointer_type_for_mode): Pick pointer mode if MODE argument
is VOIDmode.
(build_reference_type, build_pointer_type): Invoke
build_*_type_for_mode with VOIDmode.

gcc/testsuite/ChangeLog:

PR c++/100281
* g++.target/s390/pr100281-1.C: New test.
* g++.target/s390/pr100281-2.C: New test.

(cherry picked from commit 720dff974ea0487c35c0a4bfa527f30df5066ce1)

3 years agoFix gnat.dg spurious failures on PowerPC64 LE
Eric Botcazou [Thu, 20 May 2021 15:12:11 +0000 (17:12 +0200)]
Fix gnat.dg spurious failures on PowerPC64 LE

gcc/testsuite
PR testsuite/96488
* gnat.dg/unchecked_convert5.adb: Do not run on PowerPC64 LE.
* gnat.dg/unchecked_convert6.adb: Likewise.

3 years agolibstdc++: Disable floating_to_chars.cc on 16 bit targets
Joern Rennecke [Thu, 20 May 2021 12:21:41 +0000 (13:21 +0100)]
libstdc++: Disable floating_to_chars.cc on 16 bit targets

This patch conditionally disables the compilation of floating_to_chars.cc
on 16 bit targets, thus fixing a build failure for these targets as
the POW10_SPLIT_2 array exceeds the maximum object size.

libstdc++-v3/
PR libstdc++/100361
* include/std/charconv (to_chars): Hide the overloads for
floating-point types for 16 bit targets.
* src/c++17/floating_to_chars.cc: Don't compile for 16 bit targets.
* testsuite/20_util/to_chars/double.cc: Run this test only on
size32plus targets.
* testsuite/20_util/to_chars/float.cc: Likewise.
* testsuite/20_util/to_chars/long_double.cc: Likewise.

3 years agoTestsuite/Fortran: gfortran.dg/pr96711.f90 - fix expected value for PowerPC [PR96983]
Tobias Burnus [Thu, 20 May 2021 07:51:10 +0000 (09:51 +0200)]
Testsuite/Fortran: gfortran.dg/pr96711.f90 - fix expected value for PowerPC [PR96983]

gcc/testsuite/ChangeLog:

PR fortran/96983
* gfortran.dg/pr96711.f90: Use 2**digit(x) instead of a hard-coded value;
add comments regarding what the code does.

(cherry picked from commit 9e0a5e3ea37f9d7d2b6f2dab7c0bfbeaf08466a3)

3 years agoc++: _Complex template parameter [PR100634]
Jason Merrill [Wed, 19 May 2021 21:33:21 +0000 (17:33 -0400)]
c++: _Complex template parameter [PR100634]

We were crashing because invalid_nontype_parm_type_p allowed _Complex
template parms, but convert_nontype_argument didn't know what to do for
them.  Let's just disallow it, people can and should use std::complex
instead.

PR c++/100634

gcc/cp/ChangeLog:

* pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/nontype-complex1.C: New test.

3 years agoc++: ICE with using and enum [PR100659]
Jason Merrill [Wed, 19 May 2021 20:40:24 +0000 (16:40 -0400)]
c++: ICE with using and enum [PR100659]

Here the code for 'using enum' is confused by the combination of a
using-decl and an enum that are not from 'using enum'; this CONST_DECL is
from the normal unscoped enum scoping.

PR c++/100659

gcc/cp/ChangeLog:

* cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.

gcc/testsuite/ChangeLog:

* g++.dg/parse/access13.C: New test.

3 years agoDaily bump.
GCC Administrator [Thu, 20 May 2021 00:18:19 +0000 (00:18 +0000)]
Daily bump.

3 years agors6000: Add ROP tests
Bill Schmidt [Thu, 13 May 2021 18:33:35 +0000 (13:33 -0500)]
rs6000: Add ROP tests

2021-05-13  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/testsuite/
* gcc.target/powerpc/rop-1.c: New.
* gcc.target/powerpc/rop-2.c: New.
* gcc.target/powerpc/rop-3.c: New.
* gcc.target/powerpc/rop-4.c: New.
* gcc.target/powerpc/rop-5.c: New.

3 years agors6000: Conditionally define __ROP_PROTECT__
Bill Schmidt [Thu, 13 May 2021 18:10:10 +0000 (13:10 -0500)]
rs6000: Conditionally define __ROP_PROTECT__

2021-05-13  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define
__ROP_PROTECT__ if -mrop-protect is selected.

3 years agors6000: Emit ROP-mitigation instructions in prologue and epilogue
Bill Schmidt [Fri, 14 May 2021 19:25:25 +0000 (14:25 -0500)]
rs6000: Emit ROP-mitigation instructions in prologue and epilogue

2021-05-14  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-internal.h (rs6000_stack): Add
rop_hash_save_offset and rop_hash_size.
* config/rs6000/rs6000-logue.c (rs6000_stack_info): Compute
rop_hash_size and rop_hash_save_offset.
(debug_stack_info): Dump rop_hash_save_offset and rop_hash_size.
(rs6000_emit_prologue): Emit hashst[p] in prologue.
(rs6000_emit_epilogue): Emit hashchk[p] in epilogue.
* config/rs6000/rs6000.md (unspec): Add UNSPEC_HASHST and
UNSPEC_HASHCHK.
(hashst): New define_insn.
(hashchk): Likewise.

3 years agors6000: Add -mrop-protect and -mprivileged flags
Bill Schmidt [Fri, 14 May 2021 19:15:55 +0000 (14:15 -0500)]
rs6000: Add -mrop-protect and -mprivileged flags

2021-05-14  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000.c (rs6000_option_override_internal):
Disable shrink wrap when inserting ROP-protect instructions.
* config/rs6000/rs6000.opt (mrop-protect): New option.
(mprivileged): Likewise.
* doc/invoke.texi: Document mrop-protect and mprivileged.

3 years agoc++: ICE with <=> fallback [PR100367]
Jason Merrill [Tue, 18 May 2021 16:29:33 +0000 (12:29 -0400)]
c++: ICE with <=> fallback [PR100367]

Here, when genericizing lexicographical_compare_three_way, we haven't yet
walked the operands, so (a == a) still sees ADDR_EXPR <a>, but this is after
we've changed the type of a to REFERENCE_TYPE.  When we try to fold (a == a)
by constexpr evaluation, the constexpr code doesn't understand trying to
take the address of a reference, and we end up crashing.

Fixed by avoiding constexpr evaluation in genericize_spaceship, by using
fold_build2 instead of build_new_op on scalar operands.  Class operands
should have been expanded during parsing.

PR c++/100367
PR c++/96299

gcc/cp/ChangeLog:

* method.c (genericize_spaceship): Use fold_build2 for scalar
operands.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/spaceship-fallback1.C: New test.

3 years agodoc: Update description of __GXX_EXPERIMENTAL_CXX0X__
Jonathan Wakely [Wed, 19 May 2021 10:11:11 +0000 (11:11 +0100)]
doc: Update description of __GXX_EXPERIMENTAL_CXX0X__

This macro has been obsolete for years, and C++0x features are no longer
experimental or liable to be removed.

gcc/ChangeLog:

* doc/cpp.texi (Common Predefined Macros): Update documentation
for the __GXX_EXPERIMENTAL_CXX0X__ macro.

(cherry picked from commit 9b50282b0dcf79d3141979e466465a23d1816166)

3 years agoarm/testsuite: Fix testcase for PR99977
Christophe Lyon [Wed, 19 May 2021 14:45:54 +0000 (14:45 +0000)]
arm/testsuite: Fix testcase for PR99977

Some targets (eg arm-none-uclinuxfdpiceabi) do not support Thumb-1,
and since the testcase forces -march=armv8-m.base, we need to check
whether this option is actually supported.

Using dg-add-options arm_arch_v8m_base ensure that we pass -mthumb as
needed too.

2021-05-19  Christophe Lyon  <christophe.lyon@linaro.org>

PR target/99977
gcc/testsuite/
* gcc.target/arm/pr99977.c: Require arm_arch_v8m_base.

3 years agoc++: ICE with bad definition of decimal32 [PR100261]
Jason Merrill [Tue, 18 May 2021 21:15:42 +0000 (17:15 -0400)]
c++: ICE with bad definition of decimal32 [PR100261]

The change to only look at the global binding for non-classes meant that
here, when dealing with decimal32 which is magically mangled like its first
non-static data member, we got a collision with the mangling for float.
Fixed by also looking up an existing binding for such magical classes.

PR c++/100261

gcc/cp/ChangeLog:

* rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.

gcc/testsuite/ChangeLog:

* g++.dg/dfp/mangle-6.C: New test.

3 years agoc++: template template parm pack expansion [PR100372]
Jason Merrill [Tue, 18 May 2021 21:12:37 +0000 (17:12 -0400)]
c++: template template parm pack expansion [PR100372]

Here we have a pack expansion of a template template parameter pack, of
which the pattern is a TEMPLATE_DECL, which strip_typedefs doesn't want to
see.

PR c++/100372

gcc/cp/ChangeLog:

* tree.c (strip_typedefs): Only look at the pattern of a
TYPE_PACK_EXPANSION if it's a type.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/alias-decl-ttp1.C: New test.

3 years agoDaily bump.
GCC Administrator [Wed, 19 May 2021 00:18:23 +0000 (00:18 +0000)]
Daily bump.

3 years agoc++: "perfect" implicitly deleted move [PR100644]
Jason Merrill [Tue, 18 May 2021 16:06:36 +0000 (12:06 -0400)]
c++: "perfect" implicitly deleted move [PR100644]

Here we were ignoring the template constructor because the implicit move
constructor had all perfect conversions.  But CWG1402 says that an
implicitly deleted move constructor is ignored by overload resolution; we
implement that instead by preferring any other candidate in joust, to get
better diagnostics, but that means we need to handle that case here as well.

gcc/cp/ChangeLog:

PR c++/100644
* call.c (perfect_candidate_p): An implicitly deleted move
is not perfect.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/implicit-delete1.C: New test.

3 years agoc++: constant expressions are evaluated [PR93314]
Jason Merrill [Wed, 14 Apr 2021 15:24:50 +0000 (11:24 -0400)]
c++: constant expressions are evaluated [PR93314]

My GCC 11 patch for PR93314 turned off cp_unevaluated_operand while
processing an id-expression that names a non-static data member, but the
broader issue is that in general, a constant-expression is evaluated even in
an unevaluated operand.

This also fixes 100205, introduced by the earlier patch that couldn't
distinguish between the different allow_non_constant_p cases.

PR c++/100205
PR c++/93314

gcc/cp/ChangeLog:

* cp-tree.h (cp_evaluated): Add reset parm to constructor.
* parser.c (cp_parser_constant_expression): Change
allow_non_constant_p to int.  Use cp_evaluated.
(cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
* semantics.c (finish_id_expression_1): Don't mess with
cp_unevaluated_operand here.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/decltype-nonstatic1.C: New test.

3 years agogcc-changelog: Remove use of non-strict mode
Jonathan Wakely [Tue, 18 May 2021 09:08:50 +0000 (10:08 +0100)]
gcc-changelog: Remove use of non-strict mode

contrib/ChangeLog:

* gcc-changelog/git_email.py: Remove use of non-strict mode.

(cherry picked from commit 7b4bae0acb14a1076df3234e905442bbdf9503dd)

3 years agoOpenMP/Fortran: Reject nonintrinsic assignments in OMP WORKSHARE [PR100633]
Tobias Burnus [Mon, 17 May 2021 11:20:27 +0000 (13:20 +0200)]
OpenMP/Fortran: Reject nonintrinsic assignments in OMP WORKSHARE [PR100633]

PR fortran/100633

gcc/fortran/ChangeLog:

* resolve.c (gfc_resolve_code): Reject nonintrinsic assignments in
OMP WORKSHARE.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/workshare-59.f90: New test.

(cherry picked from commit 582776eb1b62c32f5234566a01ea92247b7d6bcc)

3 years agoDaily bump.
GCC Administrator [Tue, 18 May 2021 00:18:33 +0000 (00:18 +0000)]
Daily bump.

3 years agoopenmp: Notify team barrier of pending tasks in omp_fulfill_event
Kwok Cheung Yeung [Fri, 14 May 2021 16:59:11 +0000 (09:59 -0700)]
openmp: Notify team barrier of pending tasks in omp_fulfill_event

The team barrier should be notified of any new tasks that become runnable
as the result of a completing task, otherwise the barrier threads might
not resume processing available tasks, resulting in a hang.

2021-05-17  Kwok Cheung Yeung  <kcy@codesourcery.com>

libgomp/
* task.c (omp_fulfill_event): Call gomp_team_barrier_set_task_pending
if new tasks generated.
* testsuite/libgomp.c-c++-common/task-detach-13.c: New.

(cherry picked from commit ba886d0c488ebea2eb2df95c2069a3e207704dac)

3 years agolibstdc++: Fix filesystem::path constraints for volatile [PR 100630]
Jonathan Wakely [Mon, 17 May 2021 10:54:06 +0000 (11:54 +0100)]
libstdc++: Fix filesystem::path constraints for volatile [PR 100630]

The constraint check for filesystem::path construction uses
decltype(__is_path_src(declval<Source>())) which mean it considers
conversion from an rvalue.  When Source is a volatile-qualified type
it cannot use is_path_src(const Unknown&) because a const lvalue
reference can only bind to a non-volatile rvalue.

Since the relevant path members all have a const Source& parameter,
the constraint should be defined in terms of declval<const Source&>(),
not declval<Source>(). This avoids the problem of volatile-qualified
rvalues, because we no longer use an rvalue at all.

libstdc++-v3/ChangeLog:

PR libstdc++/100630
* include/experimental/bits/fs_path.h (__is_constructible_from):
Test construction from a const lvalue, not an rvalue.
* testsuite/27_io/filesystem/path/construct/100630.cc: New test.
* testsuite/experimental/filesystem/path/construct/100630.cc:
New test.

(cherry picked from commit 45aa7a447652e8541cc381d7ab128544f81ed857)

3 years agolibstdc++: Fix wrong thread waking on notify [PR100334]
Thomas Rodgers [Mon, 17 May 2021 18:41:26 +0000 (11:41 -0700)]
libstdc++: Fix wrong thread waking on notify [PR100334]

Fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100334

libstdc++-v3/ChangeLog:
* include/bits/atomic_wait.h (__waiter::_M_do_wait_v): loop
until value change observed.
(__waiter_base::_M_laundered): New member.
(__waiter_base::_M_notify): Check _M_laundered to determine
whether to wake one or all.
(__detail::__atomic_compare): Return true if call to
__builtin_memcmp() == 0.
(__waiter_base::_S_do_spin_v): Adjust predicate.
* testsuite/29_atomics/atomic/wait_notify/100334.cc: New
test.

(cherry picked from commit 346cbaf57828aef190de93271c0eb3f10c9aca61)

3 years agoarm: Fix ICEs with compare-and-swap and -march=armv8-m.base [PR99977]
Alex Coplan [Tue, 27 Apr 2021 13:56:15 +0000 (14:56 +0100)]
arm: Fix ICEs with compare-and-swap and -march=armv8-m.base [PR99977]

The PR shows two ICEs with __sync_bool_compare_and_swap and
-mcpu=cortex-m23 (equivalently, -march=armv8-m.base): one in LRA and one
later on, after the CAS insn is split.

The LRA ICE occurs because the
@atomic_compare_and_swap<CCSI:arch><SIDI:mode>_1 pattern attempts to tie
two output operands together (operands 0 and 1 in the third
alternative). LRA can't handle this, since it doesn't make sense for an
insn to assign to the same operand twice.

The later (post-splitting) ICE occurs because the expansion of the
cbranchsi4_scratch insn doesn't quite go according to plan. As it
stands, arm_split_compare_and_swap calls gen_cbranchsi4_scratch,
attempting to pass a register (neg_bval) to use as a scratch register.
However, since the RTL template has a match_scratch here,
gen_cbranchsi4_scratch ignores this argument and produces a scratch rtx.
Since this is all happening after RA, this is doomed to fail (and we get
an ICE about the insn not matching its constraints).

It seems that the motivation for the choice of constraints in the
atomic_compare_and_swap pattern comes from an attempt to satisfy the
constraints of the cbranchsi4_scratch insn. This insn requires the
scratch register to be the same as the input register in the case that
we use a larger negative immediate (one that satisfies J, but not L).

Of course, as noted above, LRA refuses to assign two output operands to
the same register, so this was never going to work.

The solution I'm proposing here is to collapse the alternatives to the
CAS insn (allowing the two output register operands to be matched to
different registers) and to ensure that the constraints for
cbranchsi4_scratch are met in arm_split_compare_and_swap. We do this by
inserting a move to ensure the source and destination registers match if
necessary (i.e. in the case of large negative immediates).

Another notable change here is that we only do:

  emit_move_insn (neg_bval, const1_rtx);

for non-negative immediates. This is because the ADDS instruction used in
the negative case suffices to leave a suitable value in neg_bval: if the
operands compare equal, we don't take the branch (so neg_bval will be
set by the load exclusive). Otherwise, the ADDS will leave a nonzero
value in neg_bval, which will correctly signal that the CAS has failed
when it is later negated.

gcc/ChangeLog:

PR target/99977
* config/arm/arm.c (arm_split_compare_and_swap): Fix up codegen
with negative immediates: ensure we expand cbranchsi4_scratch
correctly and ensure we satisfy its constraints.
* config/arm/sync.md
(@atomic_compare_and_swap<CCSI:arch><NARROW:mode>_1): Don't
attempt to tie two output operands together with constraints;
collapse two alternatives.
(@atomic_compare_and_swap<CCSI:arch><SIDI:mode>_1): Likewise.
* config/arm/thumb1.md (cbranchsi4_neg_late): New.

gcc/testsuite/ChangeLog:

PR target/99977
* gcc.target/arm/pr99977.c: New test.

(cherry picked from commit 42a10bb884c0d5af2583b8bfe4d239ce95bf9e43)

3 years agoIBM Z: Avoid bash-specific substitution in configure
Marius Hillenbrand [Wed, 12 May 2021 11:59:19 +0000 (13:59 +0200)]
IBM Z: Avoid bash-specific substitution in configure

Fix a bootstrap error observed on NetBSD.

2021-05-17  Marius Hillenbrand  <mhillen@linux.ibm.com>

gcc/ChangeLog:

PR bootstrap/100552
* configure.ac: Replace pattern substitution with call to sed.
* configure: Regenerate.

(cherry picked from commit 47abe2abf1210847629ebc271b1fc8c6d53f0d47)

3 years agoFortran/OpenMP: Handle implicit SAVE for variables in main
Tobias Burnus [Fri, 14 May 2021 17:19:26 +0000 (19:19 +0200)]
Fortran/OpenMP: Handle implicit SAVE for variables in main

gcc/fortran/ChangeLog:

* resolve.c (resolve_symbol): Handle implicit SAVE of main-program
for vars in 'omp threadprivate' and 'omp declare target'.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/implicit-save.f90: New test.

(cherry picked from commit 62e1bd651f60cfe3daaad91b41b7612bc7fa7460)

3 years agoUpdate mpfr version to 3.1.6
Richard Biener [Mon, 17 May 2021 06:51:03 +0000 (08:51 +0200)]
Update mpfr version to 3.1.6

This updates the mpfr version to 3.1.6 which is the last bugfix
release from the 3.1.x series and avoids printing the version
is buggy but acceptable from our configury.

2021-05-17  Richard Biener  <rguenther@suse.de>

contrib/ChangeLog:
* download_prerequisites: Update mpfr version to 3.1.6.
* prerequisites.md5: Update.
* prerequisites.sha512: Likewise.

(cherry picked from commit 2ec80a3457a1be57736a70007d4851e676bce7e8)

3 years agoDaily bump.
GCC Administrator [Mon, 17 May 2021 00:18:10 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 16 May 2021 00:18:13 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 15 May 2021 00:18:06 +0000 (00:18 +0000)]
Daily bump.

3 years agogcc-changelog: sync scripts.
Martin Liska [Fri, 14 May 2021 12:10:33 +0000 (14:10 +0200)]
gcc-changelog: sync scripts.

contrib/ChangeLog:

* gcc-changelog/git_check_commit.py: Sync from master.
* gcc-changelog/git_commit.py: Likewise.
* gcc-changelog/git_email.py: Likewise.
* gcc-changelog/git_repository.py: Likewise.
* gcc-changelog/git_update_version.py: Likewise.
* gcc-changelog/test_email.py: Likewise.
* gcc-changelog/test_patches.txt: Likewise.

3 years agotestsuite: Add testcase for already fixed PR [PR88872]
Jakub Jelinek [Fri, 14 May 2021 11:24:12 +0000 (13:24 +0200)]
testsuite: Add testcase for already fixed PR [PR88872]

2021-05-14  Jakub Jelinek  <jakub@redhat.com>

* g++.dg/cpp1y/pr88872.C: New test.

(cherry picked from commit f05627d404038368b99e92ac4df4c29f4ae4a5fa)

3 years agoopts: add Warning keyword for 2 options
Martin Liska [Fri, 14 May 2021 09:40:58 +0000 (11:40 +0200)]
opts: add Warning keyword for 2 options

gcc/c-family/ChangeLog:

* c.opt: Add Warning keyword for 2 options.

(cherry picked from commit 40a2f88838e5119799649a74692cbf38d774b706)

3 years agoDaily bump.
GCC Administrator [Fri, 14 May 2021 00:18:09 +0000 (00:18 +0000)]
Daily bump.

3 years agoOpenMP: detach - fix firstprivate handling
Tobias Burnus [Wed, 12 May 2021 22:12:31 +0000 (00:12 +0200)]
OpenMP: detach - fix firstprivate handling

gcc/ChangeLog:

* omp-low.c (finish_taskreg_scan): Use the proper detach decl.

libgomp/ChangeLog:

* testsuite/libgomp.c-c++-common/task-detach-12.c: New test.
* testsuite/libgomp.fortran/task-detach-12.f90: New test.

(cherry picked from commit d21963ce7a87db3d4a6921a0fa98b72ea6f4e7f5)

3 years agolibphobos: Fix static asserts on NetBSD, FreeBSD, DragonFlyBSD
Iain Buclaw [Thu, 13 May 2021 17:09:48 +0000 (19:09 +0200)]
libphobos: Fix static asserts on NetBSD, FreeBSD, DragonFlyBSD

The function declarations were updated to use `const scope', but the
static asserts were not.

libphobos/ChangeLog:

* libdruntime/core/sys/dragonflybsd/dlfcn.d: Update static assert.
* libdruntime/core/sys/freebsd/dlfcn.d: Likewise.
* libdruntime/core/sys/netbsd/dlfcn.d: Likewise.
* libdruntime/core/sys/posix/dlfcn.d: Replace 'in' with 'const scope'.

(cherry picked from commit 7677b501341d84e9889ddf0f3834b5d1ad2922f9)

3 years agoPR c/100550 - ICE: in fold_convert_loc with function call VLA argument
Martin Sebor [Thu, 13 May 2021 16:45:32 +0000 (10:45 -0600)]
PR c/100550 - ICE: in fold_convert_loc with function call VLA argument

gcc/c/ChangeLog:

PR c/100550
* c-decl.c (get_parm_array_spec): Avoid erroneous VLA bounds.

gcc/testsuite/ChangeLog:

PR c/100550
* gcc.dg/Wvla-parameter-9.c: New test.

3 years agoarm: Remove duplicate definitions from arm_mve.h (pr100419).
Srinath Parvathaneni [Tue, 11 May 2021 09:43:11 +0000 (10:43 +0100)]
arm: Remove duplicate definitions from arm_mve.h (pr100419).

This patch removes several duplicated intrinsic definitions from
arm_mve.h mentioned in PR100419 and also fixes the wrong arguments
in few of intrinsics polymorphic variants.

gcc/ChangeLog:

2021-05-04  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

PR target/100419
* config/arm/arm_mve.h (__arm_vstrwq_scatter_offset): Fix wrong arguments.
(__arm_vcmpneq): Remove duplicate definition.
(__arm_vstrwq_scatter_offset_p): Likewise.
(__arm_vmaxq_x): Likewise.
(__arm_vmlsdavaq): Likewise.
(__arm_vmlsdavaxq): Likewise.
(__arm_vmlsdavq_p): Likewise.
(__arm_vmlsdavxq_p): Likewise.
(__arm_vrmlaldavhaq): Likewise.
(__arm_vstrbq_p): Likewise.
(__arm_vstrbq_scatter_offset): Likewise.
(__arm_vstrbq_scatter_offset_p): Likewise.
(__arm_vstrdq_scatter_offset): Likewise.
(__arm_vstrdq_scatter_offset_p): Likewise.
(__arm_vstrdq_scatter_shifted_offset): Likewise.
(__arm_vstrdq_scatter_shifted_offset_p): Likewise.

Co-authored-by: Joe Ramsay <joe.ramsay@arm.com>
(cherry picked from commit 9b905ba9ebba8d2cc805c26351225e7f74c02333)

3 years agoarm: correctly handle inequality comparisons against max constants [PR100563]
Richard Earnshaw [Thu, 13 May 2021 10:42:58 +0000 (11:42 +0100)]
arm: correctly handle inequality comparisons against max constants [PR100563]

Normally we expect the gimple optimizers to fold away comparisons that
are always true, but at some lower optimization levels this is not
always the case, so the back-end has to be able to generate correct
code in these cases.

In this example, we have a comparison of the form

  (unsigned long long) op <= ~0ULL

which, of course is always true.

Normally, in the arm back-end we handle these expansions where the
immediate cannot be handled directly by adding 1 to the constant and
then adjusting the comparison operator:

  (unsigned long long) op < CONST + 1

but we cannot do that when the constant is already the largest value.

Fortunately, we observe that the comparisons we need to handle this
way are either always true or always false, so instead of forming a
comparison against the maximum value, we can replace it with a
comparison against the minimum value (which just happens to also be a
constant we can handle.  So

  op1 <= ~0ULL -> op1 >= 0U
  op1 > ~0ULL -> op1 < 0U

  op1 <= LONG_LONG_INT_MAX -> op1 >= (-LONG_LONG_INT_MAX - 1)
  op1 > LONG_LONG_INT_MAX -> op1 < (-LONG_LONG_INT_MAX - 1)

gcc:
PR target/100563
* config/arm/arm.c (arm_canonicalize_comparison): Correctly
canonicalize DImode inequality comparisons against the
maximum integral value.

gcc/testsuite:
* gcc.dg/pr100563.c: New test.

3 years agoDaily bump.
GCC Administrator [Thu, 13 May 2021 00:18:01 +0000 (00:18 +0000)]
Daily bump.

3 years agolibstdc++: Implement P2367 changes to avoid some list-initialization
Patrick Palka [Fri, 30 Apr 2021 14:59:20 +0000 (10:59 -0400)]
libstdc++: Implement P2367 changes to avoid some list-initialization

This implements the wording changes of P2367R0 "Remove misuses of
list-initialization from Clause 24", modulo the parts that depend
on P1739R4 which we don't yet implement (due to LWG 3407).

libstdc++-v3/ChangeLog:

* include/bits/ranges_util.h (subrange::subrange): Avoid
list-initialization in delegating constructor.
* include/std/ranges (single_view): Replace implicit guide
with explicit deduction guide that decays its argument.
(_Single::operator()): Avoid CTAD when constructing the
single_view object.
(_Iota::operator()): Avoid list-initialization.
(__detail::__can_filter_view, _Filter::operator()): Likewise.
(__detail::__can_transform_view, _Transform::operator()): Likewise.
(take_view::begin): Likewise.
(__detail::__can_take_view, _Take::operator()): Likewise.
(__detail::__can_take_while_view, _TakeWhile::operator()): Likewise.
(__detail::__can_drop_view, _Drop::operator()): Likewise.
(__detail::__can_drop_while_view, _DropWhile::operator()): Likewise.
(split_view::split_view): Use views::single when initializing
_M_pattern.
(__detail::__can_split_view, _Split::operator()): Avoid
list-initialization.
(_Counted::operator()): Likewise.
* testsuite/std/ranges/p2367.cc: New test.

(cherry picked from commit 6e00d9bb113b531be15bc71cad2f1742648ba18a)

3 years agotree-optimization/100566 - fix another predication issue in VN
Richard Biener [Wed, 12 May 2021 13:39:52 +0000 (15:39 +0200)]
tree-optimization/100566 - fix another predication issue in VN

This amends the fix for PR100053 where I failed to amend all edge
tests in dominated_by_p_w_unex.

2021-05-12  Richard Biener  <rguenther@suse.de>

PR tree-optimization/100566
* tree-ssa-sccvn.c (dominated_by_p_w_unex): Properly handle
allow_back for all edge queries.

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

(cherry picked from commit 097fde5e7514e909f2e8472be2e008d0cab2260d)

3 years agolibcpp: Fix up -fdirectives-only preprocessing of includes not ending with newline...
Jakub Jelinek [Wed, 12 May 2021 13:14:35 +0000 (15:14 +0200)]
libcpp: Fix up -fdirectives-only preprocessing of includes not ending with newline [PR100392]

If a header doesn't end with a new-line, with -fdirectives-only we right now
preprocess it as
int i = 1;# 2 "pr100392.c" 2
i.e. the line directive isn't on the next line, which means we fail to parse
it when compiling.

GCC 10 and earlier libcpp/directives-only.c had for this:
  if (!pfile->state.skipping && cur != base)
    {
      /* If the file was not newline terminated, add rlimit, which is
         guaranteed to point to a newline, to the end of our range.  */
      if (cur[-1] != '\n')
        {
          cur++;
          CPP_INCREMENT_LINE (pfile, 0);
          lines++;
        }

      cb->print_lines (lines, base, cur - base);
    }
and we have the assertion
      /* Files always end in a newline or carriage return.  We rely on this for
         character peeking safety.  */
      gcc_assert (buffer->rlimit[0] == '\n' || buffer->rlimit[0] == '\r');
So, this patch just does readd the more less same thing, so that we emit
a newline after the inline even when it wasn't there before.

2021-05-12  Jakub Jelinek  <jakub@redhat.com>

PR preprocessor/100392
* lex.c (cpp_directive_only_process): If buffer doesn't end with '\n',
add buffer->rlimit[0] character to the printed range and
CPP_INCREMENT_LINE and increment line_count.

* gcc.dg/cpp/pr100392.c: New test.
* gcc.dg/cpp/pr100392.h: New file.

(cherry picked from commit c6b664e2c4c127025e076d8b584abe0976694629)

3 years agoexpand: Don't reuse DEBUG_EXPRs with vector type if they have different modes [PR100508]
Jakub Jelinek [Wed, 12 May 2021 08:38:35 +0000 (10:38 +0200)]
expand: Don't reuse DEBUG_EXPRs with vector type if they have different modes [PR100508]

The inliner doesn't remap DEBUG_EXPR_DECLs, so the same decls can appear
in multiple functions.
Furthermore, expansion reuses corresponding DEBUG_EXPRs too, so they again
can be reused in multiple functions.
Neither of that is a major problem, DEBUG_EXPRs are just magic value holders
and what value they stand for is independent in each function and driven by
what debug stmts or DEBUG_INSNs they are bound to.
Except for DEBUG_EXPR*s with vector types, TYPE_MODE can be either BLKmode
or some vector mode depending on whether current function's enabled ISAs
support that vector mode or not.  On the following testcase, we expand it
first in foo function without AVX2 enabled and so the DEBUG_EXPR is
BLKmode, but later the same DEBUG_EXPR_DECL is used in a simd clone with
AVX2 enabled and expansion ICEs because of a mode mismatch.

The following patch fixes that by forcing recreation of a DEBUG_EXPR if
there is a mode mismatch for vector typed DEBUG_EXPR_DECL, DEBUG_EXPRs
will be still reused in between functions otherwise and within the same
function the mode should be always the same.

2021-05-12  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/100508
* cfgexpand.c (expand_debug_expr): For DEBUG_EXPR_DECL with vector
type, don't reuse DECL_RTL if it has different mode, instead force
creation of a new DEBUG_EXPR.

* gcc.dg/gomp/pr100508.c: New test.

(cherry picked from commit 19040050aa2c8ee890fc58dda48639fc91bf0af0)

3 years agoopenmp: Fix up taskloop reduction ICE if taskloop has no iterations [PR100471]
Jakub Jelinek [Tue, 11 May 2021 07:07:47 +0000 (09:07 +0200)]
openmp: Fix up taskloop reduction ICE if taskloop has no iterations [PR100471]

When a taskloop doesn't have any iterations, GOMP_taskloop* takes an early
return, doesn't create any tasks and more importantly, doesn't create
a taskgroup and doesn't register task reductions.  But, the code emitted
in the callers assumes task reductions have been registered and performs
the reduction handling and task reduction unregistration.  The pointer
to the task reduction private variables is reused, on input it is the alignment
and only on output it is the pointer, so in the case taskloop with no iterations
the caller attempts to dereference the alignment value as if it was a pointer
and crashes.  We could in the early returns register the task reductions
only to have them looped over and unregistered in the caller, but I think
it is better to tell the caller there is nothing to task reduce and bypass
all that.

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

PR middle-end/100471
* omp-low.c (lower_omp_task_reductions): For OMP_TASKLOOP, if data
is 0, bypass the reduction loop including
GOMP_taskgroup_reduction_unregister call.

* taskloop.c (GOMP_taskloop): If GOMP_TASK_FLAG_REDUCTION and not
GOMP_TASK_FLAG_NOGROUP, when doing early return clear the task
reduction pointer.
* testsuite/libgomp.c/task-reduction-4.c: New test.

(cherry picked from commit 98acbb3111fcb5e57d5e63d46c0d92f4e53e3c2a)

3 years agoDaily bump.
GCC Administrator [Wed, 12 May 2021 08:52:58 +0000 (08:52 +0000)]
Daily bump.

3 years agoRISC-V: For '-march' and '-mabi' options, add 'Negative' property mentions itself.
Geng Qi [Wed, 28 Apr 2021 08:29:33 +0000 (16:29 +0800)]
RISC-V: For '-march' and '-mabi' options, add 'Negative' property mentions itself.

When use multi-lib riscv-tool-chain. A bug is triggered when there are two
'-march' at command line.
riscv64-unknown-elf-gcc -march=rv32gcp -mabi=ilp32f -march=rv32gcpzp64 HelloWorld.c
/lhome/gengq/riscv64-linux-ptest/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: /lhome/gengq/riscv64-linux-ptest/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/lib/crt0.o: ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/lhome/gengq/riscv64-linux-ptest/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /lhome/gengq/riscv64-linux-ptest/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/lib/crt0.o
/lhome/gengq/riscv64-linux-ptest/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: /lhome/gengq/riscv64-linux-ptest/lib/gcc/riscv64-unknown-elf/10.2.0/crtbegin.o: ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/lhome/gengq/riscv64-linux-ptest/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /lhome/gengq/riscv64-linux-ptest/lib/gcc/riscv64-unknown-elf/10.2.0/crtbegin.o
......

This patch fix it. And the DRIVER would prune the extra '-march' and '-mabi'
options and keep only the last one valid.

gcc/ChangeLog:
* config/riscv/riscv.opt (march=,mabi=): Negative itself.

(cherry picked from commit 17f2908fcf058e145cff275966e34f8c7f57c2c5)

3 years agoUpdate gcc ja.po.
Joseph Myers [Tue, 11 May 2021 21:07:26 +0000 (21:07 +0000)]
Update gcc ja.po.

* ja.po: Update.

3 years agolibstdc++: Fix tests that fail in C++98 mode
Jonathan Wakely [Tue, 11 May 2021 16:14:26 +0000 (17:14 +0100)]
libstdc++: Fix tests that fail in C++98 mode

The header synopsis test fails to define NOTHROW for C++98.

The shared_ptr test should be skipped for C++98.

The debug mode one should work for C++98 too, it just needs to avoid
C++11 syntax that isn't valid in C++98.

libstdc++-v3/ChangeLog:

* testsuite/20_util/headers/memory/synopsis.cc: Define C++98
alternative for macro.
* testsuite/20_util/shared_ptr/creation/99006.cc: Add effective
target keyword.
* testsuite/25_algorithms/copy/debug/99402.cc: Avoid C++11
syntax.

(cherry picked from commit 37407a2ae701c0a93377106a2938ab5474062fc3)

3 years agolibstdc++: Fix missing members in std::allocator<void>
Jonathan Wakely [Tue, 11 May 2021 14:01:01 +0000 (15:01 +0100)]
libstdc++: Fix missing members in std::allocator<void>

The changes in 75c6a925dab5b7af9ab47c10906cb0e140261cc2 were slightly
incorrect, because the converting constructor should be noexcept, and
the POCMA and is_always_equal traits should still be present in C++20.
This fixes it, and slightly refactors the preprocessor conditions and
order of members. Also add comments explaining things.

The non-standard construct and destroy members added for PR 78052 can be
private if allocator_traits<allocator<void>> is made a friend.

libstdc++-v3/ChangeLog:

* include/bits/allocator.h (allocator<void>) [C++20]: Add
missing noexcept to constructor. Restore missing POCMA and
is_always_equal_traits.
[C++17]: Make construct and destroy members private and
declare allocator_traits as a friend.
* include/bits/memoryfwd.h (allocator_traits): Declare.
* include/ext/malloc_allocator.h (malloc_allocator::allocate):
Add nodiscard attribute. Add static assertion for LWG 3307.
* include/ext/new_allocator.h (new_allocator::allocate): Add
static assertion for LWG 3307.
* testsuite/20_util/allocator/void.cc: Check that converting
constructor is noexcept. Check for propagation traits and
size_type and difference_type. Check that pointer and
const_pointer are gone in C++20.

(cherry picked from commit 5e3a1ea3d89d62972e1f036b2ede37a80b880bdf)

3 years agolibstdc++: Remove TODO comment
Jonathan Wakely [Mon, 10 May 2021 20:06:22 +0000 (21:06 +0100)]
libstdc++: Remove TODO comment

We have a comment saying to replace the simple binary_semaphore type
with std::binary_semaphore, which has been done. However, that isn't
defined on all targets. So keep the simple one here that just implements
the parts of the API needed by <stop_token>, and remove the comment
suggesting it should be replaced.

libstdc++-v3/ChangeLog:

* include/std/stop_token: Remove TODO comment.

(cherry picked from commit 151154a21da8b0784894b2463a117f4e283d5525)

3 years agolibstdc++: Implement proposed resolution to LWG 3548
Jonathan Wakely [Mon, 10 May 2021 19:46:38 +0000 (20:46 +0100)]
libstdc++: Implement proposed resolution to LWG 3548

This has been tentatively approved by LWG. The deleter from a unique_ptr
can be moved into the shared_ptr (at least, since LWG 2802). This uses
std::forward<_Del>(__r.get_deleter()) not std::move(__r.get_deleter())
because we don't want to convert the deleter to an rvalue when _Del is
an lvalue reference type.

This also adds a missing is_move_constructible_v<D> constraint to the
shared_ptr(unique_ptr<Y, D>&&) constructor, which is inherited from the
shared_ptr(Y*, D) constructor due to the use of "equivalent to" in the
specified effects.

libstdc++-v3/ChangeLog:

* include/bits/shared_ptr_base.h (__shared_count(unique_ptr&&)):
Initialize a non-reference deleter from an rvalue, as per LWG
3548.
(__shared_ptr::_UniqCompatible): Add missing constraint.
* testsuite/20_util/shared_ptr/cons/lwg3548.cc: New test.
* testsuite/20_util/shared_ptr/cons/unique_ptr_deleter.cc: Check
constraints.

(cherry picked from commit 5edc0c15f1667cc2a5deb664b25c007b35d259f6)

3 years agolibstdc++: Remove redundant -std=gnu++17 option from remaining tests
Jonathan Wakely [Mon, 10 May 2021 15:22:54 +0000 (16:22 +0100)]
libstdc++: Remove redundant -std=gnu++17 option from remaining tests

GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the
dg-options directive prevents running these tests with different modes
such as -std=c++17 or -std=gnu++20.

libstdc++-v3/ChangeLog:

* testsuite/17_intro/headers/c++2017/all_attributes.cc: Remove
-std=gnu++17 from dg-options directive.
* testsuite/17_intro/headers/c++2017/all_no_exceptions.cc:
Likewise.
* testsuite/17_intro/headers/c++2017/all_pedantic_errors.cc:
Likewise.
* testsuite/17_intro/headers/c++2017/operator_names.cc:
Likewise.
* testsuite/17_intro/headers/c++2017/parallel_mode.cc: Likewise.
* testsuite/17_intro/headers/c++2017/stdc++.cc: Likewise.
* testsuite/17_intro/headers/c++2017/stdc++_multiple_inclusion.cc:
Likewise.
* testsuite/18_support/aligned_alloc/aligned_alloc.cc: Likewise.
* testsuite/18_support/byte/81076.cc: Likewise.
* testsuite/18_support/byte/global_neg.cc: Likewise.
* testsuite/18_support/byte/ops.cc: Likewise.
* testsuite/18_support/byte/requirements.cc: Likewise.
* testsuite/18_support/headers/cfloat/values_c++17.cc: Likewise.
* testsuite/18_support/launder/1.cc: Likewise.
* testsuite/18_support/launder/nodiscard.cc: Likewise.
* testsuite/18_support/launder/requirements.cc: Likewise.
* testsuite/18_support/launder/requirements_neg.cc: Likewise.
* testsuite/18_support/new_aligned.cc: Likewise.
* testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc:
Likewise.
* testsuite/19_diagnostics/error_code/is_error_code_v.cc:
Likewise.
* testsuite/19_diagnostics/error_condition/hash.cc: Likewise.
* testsuite/20_util/addressof/requirements/constexpr.cc:
Likewise.
* testsuite/20_util/as_const/1.cc: Likewise.
* testsuite/20_util/as_const/rvalue_neg.cc: Likewise.
* testsuite/20_util/bind/83427.cc: Likewise.
* testsuite/20_util/bind/is_placeholder_v.cc: Likewise.
* testsuite/20_util/bool_constant/requirements.cc: Likewise.
* testsuite/20_util/duration/arithmetic/constexpr_c++17.cc:
Likewise.
* testsuite/20_util/duration/requirements/treat_as_floating_point_v.cc:
Likewise.
* testsuite/20_util/duration_cast/rounding.cc: Likewise.
* testsuite/20_util/enable_shared_from_this/members/weak_from_this.cc:
Likewise.
* testsuite/20_util/from_chars/1_neg.cc: Likewise.
* testsuite/20_util/from_chars/requirements.cc: Likewise.
* testsuite/20_util/function/91456.cc: Likewise.
* testsuite/20_util/function/cons/deduction.cc: Likewise.
* testsuite/20_util/function_objects/83607.cc: Likewise.
* testsuite/20_util/function_objects/invoke/59768.cc: Likewise.
* testsuite/20_util/function_objects/mem_fn/80478.cc: Likewise.
* testsuite/20_util/function_objects/not_fn/1.cc: Likewise.
* testsuite/20_util/function_objects/not_fn/87538.cc: Likewise.
* testsuite/20_util/has_unique_object_representations/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/has_unique_object_representations/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/has_unique_object_representations/value.cc:
Likewise.
* testsuite/20_util/hash/nullptr.cc: Likewise.
* testsuite/20_util/in_place/requirements.cc: Likewise.
* testsuite/20_util/is_aggregate/incomplete_neg.cc: Likewise.
* testsuite/20_util/is_aggregate/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_aggregate/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/is_aggregate/value.cc: Likewise.
* testsuite/20_util/is_invocable/83395.cc: Likewise.
* testsuite/20_util/is_invocable/91456.cc: Likewise.
* testsuite/20_util/is_invocable/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_invocable/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/is_invocable/value.cc: Likewise.
* testsuite/20_util/is_literal_type/deprecated-1z.cc: Likewise.
* testsuite/20_util/is_nothrow_constructible/94003.cc: Likewise.
* testsuite/20_util/is_nothrow_invocable/83395.cc: Likewise.
* testsuite/20_util/is_nothrow_invocable/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_nothrow_invocable/requirements/typedefs.cc: Likewise.
* testsuite/20_util/is_nothrow_invocable/value.cc: Likewise.
* testsuite/20_util/is_nothrow_swappable/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_nothrow_swappable/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/is_nothrow_swappable/value.cc: Likewise.
* testsuite/20_util/is_nothrow_swappable_with/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_nothrow_swappable_with/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/is_nothrow_swappable_with/value.cc:
Likewise.
* testsuite/20_util/is_swappable/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_swappable/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/is_swappable/value.cc: Likewise.
* testsuite/20_util/is_swappable_with/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_swappable_with/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/is_swappable_with/value.cc: Likewise.
* testsuite/20_util/logical_traits/83134.cc: Likewise.
* testsuite/20_util/logical_traits/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/logical_traits/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/logical_traits/value.cc: Likewise.
* testsuite/20_util/pair/cons/deduction.cc: Likewise.
* testsuite/20_util/pair/swap_cxx17.cc: Likewise.
* testsuite/20_util/ratio/requirements/ratio_equal_v.cc:
Likewise.
* testsuite/20_util/reference_wrapper/83427.cc: Likewise.
* testsuite/20_util/reference_wrapper/deduction.cc: Likewise.
* testsuite/20_util/shared_ptr/casts/reinterpret.cc: Likewise.
* testsuite/20_util/shared_ptr/cons/deduction.cc: Likewise.
* testsuite/20_util/shared_ptr/requirements/weak_type.cc:
Likewise.
* testsuite/20_util/time_point/arithmetic/constexpr.cc:
Likewise.
* testsuite/20_util/time_point_cast/rounding.cc: Likewise.
* testsuite/20_util/to_chars/3.cc: Likewise.
* testsuite/20_util/to_chars/chars_format.cc: Likewise.
* testsuite/20_util/to_chars/lwg3266.cc: Likewise.
* testsuite/20_util/to_chars/requirements.cc: Likewise.
* testsuite/20_util/tuple/78939.cc: Likewise.
* testsuite/20_util/tuple/apply/1.cc: Likewise.
* testsuite/20_util/tuple/apply/2.cc: Likewise.
* testsuite/20_util/tuple/cons/deduction.cc: Likewise.
* testsuite/20_util/tuple/make_from_tuple/1.cc: Likewise.
* testsuite/20_util/tuple/make_from_tuple/2.cc: Likewise.
* testsuite/20_util/tuple/swap_cxx17.cc: Likewise.
* testsuite/20_util/tuple/tuple_size_v.cc: Likewise.
* testsuite/20_util/unique_ptr/cons/deduction_neg.cc: Likewise.
* testsuite/20_util/uses_allocator/requirements/uses_allocator_v.cc:
Likewise.
* testsuite/20_util/variable_templates_for_traits.cc: Likewise.
* testsuite/20_util/void_t/1.cc: Likewise.
* testsuite/20_util/weak_ptr/cons/deduction.cc: Likewise.
* testsuite/24_iterators/container_access.cc: Likewise.
* testsuite/24_iterators/headers/iterator/range_access_c++17.cc:
Likewise.
* testsuite/24_iterators/headers/iterator/synopsis_c++17.cc:
Likewise.
* testsuite/24_iterators/range_access/range_access_cpp17.cc:
Likewise.
* testsuite/24_iterators/range_access/range_access_cpp17_neg.cc:
Likewise.
* testsuite/26_numerics/gcd/gcd_neg.cc: Likewise.
* testsuite/26_numerics/headers/cmath/functions_std_c++17.cc:
Likewise.
* testsuite/26_numerics/headers/cmath/hypot.cc: Likewise.
* testsuite/26_numerics/headers/cmath/special_functions_global.cc:
Likewise.
* testsuite/26_numerics/lcm/1.cc: Likewise.
* testsuite/26_numerics/lcm/lcm_neg.cc: Likewise.
* testsuite/26_numerics/valarray/deduction.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_other/char/lwg2221.cc:
Likewise.
* testsuite/27_io/manipulators/standard/char/quoted_sv.cc:
Likewise.
* testsuite/27_io/manipulators/standard/wchar_t/quoted_sv.cc:
Likewise.
* testsuite/27_io/types/4.cc: Likewise.
* testsuite/28_regex/basic_regex/ctors/deduction.cc: Likewise.
* testsuite/libstdc++-prettyprinters/91997.cc: Likewise.
* testsuite/libstdc++-prettyprinters/cxx17.cc: Likewise.

(cherry picked from commit 0498d2d09a2364aae1e6b5e085c8ebb8fc517684)

3 years agolibstdc++: Remove redundant -std=gnu++17 option from algorithm tests
Jonathan Wakely [Mon, 10 May 2021 15:22:54 +0000 (16:22 +0100)]
libstdc++: Remove redundant -std=gnu++17 option from algorithm tests

GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the
dg-options directive prevents running these tests with different modes
such as -std=c++17 or -std=gnu++20.

libstdc++-v3/ChangeLog:

* testsuite/20_util/function_objects/searchers.cc: Remove
-std=gnu++17 from dg-options directive.
* testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/memory_management_tools/destroy_neg.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94831.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/sizes.cc:
Likewise.
* testsuite/20_util/unique_ptr/specialized_algorithms/swap_cxx17.cc:
Likewise.
* testsuite/25_algorithms/clamp/1.cc: Likewise.
* testsuite/25_algorithms/clamp/2.cc: Likewise.
* testsuite/25_algorithms/clamp/constexpr.cc: Likewise.
* testsuite/25_algorithms/clamp/requirements/explicit_instantiation/1.cc:
Likewise.
* testsuite/25_algorithms/clamp/requirements/explicit_instantiation/pod.cc:
Likewise.
* testsuite/25_algorithms/for_each/for_each_n.cc: Likewise.
* testsuite/25_algorithms/for_each/for_each_n_debug.cc:
Likewise.
* testsuite/25_algorithms/sample/1.cc: Likewise.
* testsuite/25_algorithms/sample/2.cc: Likewise.
* testsuite/25_algorithms/sample/3.cc: Likewise.
* testsuite/25_algorithms/sample/81221.cc: Likewise.
* testsuite/25_algorithms/search/searcher.cc: Likewise.
* testsuite/26_numerics/exclusive_scan/1.cc: Likewise.
* testsuite/26_numerics/inclusive_scan/1.cc: Likewise.
* testsuite/26_numerics/reduce/1.cc: Likewise.
* testsuite/26_numerics/reduce/2.cc: Likewise.
* testsuite/26_numerics/transform_exclusive_scan/1.cc: Likewise.
* testsuite/26_numerics/transform_inclusive_scan/1.cc: Likewise.
* testsuite/26_numerics/transform_reduce/1.cc: Likewise.

(cherry picked from commit d7b2d92747f8d236050af3ec5741786f0f878716)

3 years agolibstdc++: Remove redundant -std=gnu++17 option from containers tests
Jonathan Wakely [Mon, 10 May 2021 15:22:53 +0000 (16:22 +0100)]
libstdc++: Remove redundant -std=gnu++17 option from containers tests

GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the
dg-options directive prevents running these tests with different modes
such as -std=c++17 or -std=gnu++20.

libstdc++-v3/ChangeLog:

* testsuite/23_containers/array/cons/deduction.cc: Remove
-std=gnu++17 from dg-options directive.
* testsuite/23_containers/array/cons/deduction_neg.cc: Likewise.
* testsuite/23_containers/array/element_access/constexpr_c++17.cc:
Likewise.
* testsuite/23_containers/array/requirements/constexpr_iter.cc:
Likewise.
* testsuite/23_containers/array/specialized_algorithms/swap_cxx17.cc:
Likewise.
* testsuite/23_containers/deque/cons/deduction.cc: Likewise.
* testsuite/23_containers/deque/modifiers/emplace/cxx17_return.cc:
Likewise.
* testsuite/23_containers/forward_list/cons/deduction.cc:
Likewise.
* testsuite/23_containers/forward_list/modifiers/emplace_cxx17_return.cc:
Likewise.
* testsuite/23_containers/list/cons/deduction.cc: Likewise.
* testsuite/23_containers/list/modifiers/emplace/cxx17_return.cc:
Likewise.
* testsuite/23_containers/map/cons/deduction.cc: Likewise.
* testsuite/23_containers/map/modifiers/extract.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/83226.cc:
Likewise.
* testsuite/23_containers/map/modifiers/insert_or_assign/1.cc:
Likewise.
* testsuite/23_containers/map/modifiers/merge.cc: Likewise.
* testsuite/23_containers/map/modifiers/try_emplace/1.cc:
Likewise.
* testsuite/23_containers/multimap/cons/deduction.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/extract.cc:
Likewise.
* testsuite/23_containers/multimap/modifiers/merge.cc: Likewise.
* testsuite/23_containers/multiset/cons/deduction.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/extract.cc:
Likewise.
* testsuite/23_containers/multiset/modifiers/merge.cc: Likewise.
* testsuite/23_containers/priority_queue/deduction.cc: Likewise.
* testsuite/23_containers/queue/deduction.cc: Likewise.
* testsuite/23_containers/queue/members/emplace_cxx17_return.cc:
Likewise.
* testsuite/23_containers/set/cons/deduction.cc: Likewise.
* testsuite/23_containers/set/modifiers/extract.cc: Likewise.
* testsuite/23_containers/set/modifiers/merge.cc: Likewise.
* testsuite/23_containers/set/modifiers/node_swap.cc: Likewise.
* testsuite/23_containers/stack/deduction.cc: Likewise.
* testsuite/23_containers/stack/members/emplace_cxx17_return.cc:
Likewise.
* testsuite/23_containers/unordered_map/cons/deduction.cc:
Likewise.
* testsuite/23_containers/unordered_map/modifiers/extract.cc:
Likewise.
* testsuite/23_containers/unordered_map/modifiers/insert_or_assign.cc:
Likewise.
* testsuite/23_containers/unordered_map/modifiers/merge.cc:
Likewise.
* testsuite/23_containers/unordered_map/modifiers/try_emplace.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/cons/deduction.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/modifiers/extract.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/modifiers/merge.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/cons/deduction.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/modifiers/extract.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/modifiers/merge.cc:
Likewise.
* testsuite/23_containers/unordered_set/cons/deduction.cc:
Likewise.
* testsuite/23_containers/unordered_set/modifiers/extract.cc:
Likewise.
* testsuite/23_containers/unordered_set/modifiers/merge.cc:
Likewise.
* testsuite/23_containers/vector/bool/emplace_cxx17_return.cc:
Likewise.
* testsuite/23_containers/vector/cons/89164_c++17.cc: Likewise.
* testsuite/23_containers/vector/cons/deduction.cc: Likewise.
* testsuite/23_containers/vector/modifiers/emplace/cxx17_return.cc:
Likewise.

(cherry picked from commit 7c85abec763095045ba3f78c6656117dd8f1fd01)

3 years agolibstdc++: Remove redundant -std=gnu++17 option from strings tests
Jonathan Wakely [Mon, 10 May 2021 15:22:53 +0000 (16:22 +0100)]
libstdc++: Remove redundant -std=gnu++17 option from strings tests

GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the
dg-options directive prevents running these tests with different modes
such as -std=c++17 or -std=gnu++20.

libstdc++-v3/ChangeLog:

* testsuite/21_strings/basic_string/79162.cc: Remove
-std=gnu++17 from dg-options directive.
* testsuite/21_strings/basic_string/cons/char/7.cc: Likewise.
* testsuite/21_strings/basic_string/cons/char/79162.cc:
Likewise.
* testsuite/21_strings/basic_string/cons/char/86138.cc:
Likewise.
* testsuite/21_strings/basic_string/cons/char/9.cc: Likewise.
* testsuite/21_strings/basic_string/cons/char/deduction.cc:
Likewise.
* testsuite/21_strings/basic_string/cons/char/moveable2_c++17.cc:
Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/7.cc: Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/79162.cc:
Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/86138.cc:
Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/9.cc: Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc:
Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/moveable2_c++17.cc:
Likewise.
* testsuite/21_strings/basic_string/hash/hash.cc: Likewise.
* testsuite/21_strings/basic_string/lwg2758.cc: Likewise.
* testsuite/21_strings/basic_string/lwg2946.cc: Likewise.
* testsuite/21_strings/basic_string/modifiers/append/char/4.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/append/wchar_t/4.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/assign/char/4.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/4.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/insert/char/3.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/insert/wchar_t/3.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/replace/char/7.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/replace/wchar_t/7.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/compare/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/compare/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/data/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/data/char/86169.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/data/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/find/char/5.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/find/wchar_t/5.cc:
Likewise.
* testsuite/21_strings/basic_string/operators/char/5.cc:
Likewise.
* testsuite/21_strings/basic_string/operators/wchar_t/5.cc:
Likewise.
* testsuite/21_strings/basic_string_view/capacity/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/capacity/empty_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/cons/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/cons/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/cons/char/3.cc:
Likewise.
* testsuite/21_strings/basic_string_view/cons/char/nonnull.cc:
Likewise.
* testsuite/21_strings/basic_string_view/cons/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/cons/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/cons/wchar_t/3.cc:
Likewise.
* testsuite/21_strings/basic_string_view/cons/wchar_t/nonnull.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/char/back_constexpr_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/char/constexpr.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/char/constexpr_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/char/empty.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/char/front_back.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/char/front_back_constexpr.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/char/front_constexpr_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/back_constexpr_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/constexpr.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/constexpr_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/empty.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/front_back.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/front_constexpr_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/include.cc: Likewise.
* testsuite/21_strings/basic_string_view/inserters/94051.cc:
Likewise.
* testsuite/21_strings/basic_string_view/inserters/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/inserters/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/inserters/char/3.cc:
Likewise.
* testsuite/21_strings/basic_string_view/inserters/pod/10081-out.cc:
Likewise.
* testsuite/21_strings/basic_string_view/inserters/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/inserters/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/inserters/wchar_t/3.cc:
Likewise.
* testsuite/21_strings/basic_string_view/literals/types-char8_t.cc:
Likewise.
* testsuite/21_strings/basic_string_view/literals/types.cc:
Likewise.
* testsuite/21_strings/basic_string_view/literals/values-char8_t.cc:
Likewise.
* testsuite/21_strings/basic_string_view/literals/values.cc:
Likewise.
* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/char/13650.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/char/nonnull.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/13650.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/copy/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/copy/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/copy/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/data/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/data/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/char/3.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/char/4.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/char/nonnull.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/wchar_t/4.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/rfind/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/rfind/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/rfind/char/3.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/rfind/char/nonnull.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/3.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/string_conversion/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/substr/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/substr/char/83511.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/substr/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/substr/wchar_t/83511.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operators/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operators/char/89446.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operators/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operators/wchar_t/89446.cc:
Likewise.
* testsuite/21_strings/basic_string_view/range_access/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char16_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char32_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char8_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/requirements/traits_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/requirements/typedefs.cc:
Likewise.
* testsuite/21_strings/basic_string_view/typedefs.cc: Likewise.
* testsuite/21_strings/basic_string_view/types/1.cc: Likewise.
* testsuite/21_strings/char_traits/requirements/char/99181.cc:
Likewise.
* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc:

(cherry picked from commit 8087e70267ce6fa0787152963339ba987e7b514d)

3 years agolibstdc++: Remove redundant -std=gnu++17 option from PMR tests
Jonathan Wakely [Mon, 10 May 2021 15:22:53 +0000 (16:22 +0100)]
libstdc++: Remove redundant -std=gnu++17 option from PMR tests

GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the
dg-options directive prevents running these tests with different modes
such as -std=c++17 or -std=gnu++20.

libstdc++-v3/ChangeLog:

* testsuite/20_util/memory_resource/1.cc: Remove -std=gnu++17
from dg-options directive.
* testsuite/20_util/memory_resource/2.cc: Likewise.
* testsuite/20_util/monotonic_buffer_resource/1.cc: Likewise.
* testsuite/20_util/monotonic_buffer_resource/93208.cc:
Likewise.
* testsuite/20_util/monotonic_buffer_resource/allocate.cc:
Likewise.
* testsuite/20_util/monotonic_buffer_resource/deallocate.cc:
Likewise.
* testsuite/20_util/monotonic_buffer_resource/release.cc:
Likewise.
* testsuite/20_util/monotonic_buffer_resource/upstream_resource.cc:
Likewise.
* testsuite/20_util/polymorphic_allocator/1.cc: Likewise.
* testsuite/20_util/polymorphic_allocator/construct_pair.cc:
Likewise.
* testsuite/20_util/polymorphic_allocator/resource.cc: Likewise.
* testsuite/20_util/polymorphic_allocator/select.cc: Likewise.
* testsuite/20_util/synchronized_pool_resource/allocate.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/allocate_single.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/cons.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/cons_single.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/is_equal.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/multithreaded.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/options.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/release.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/release_single.cc:
Likewise.
* testsuite/20_util/unsynchronized_pool_resource/allocate-max-chunks.cc:
Likewise.
* testsuite/20_util/unsynchronized_pool_resource/allocate.cc:
Likewise.
* testsuite/20_util/unsynchronized_pool_resource/cons.cc:
Likewise.
* testsuite/20_util/unsynchronized_pool_resource/is_equal.cc:
Likewise.
* testsuite/20_util/unsynchronized_pool_resource/options.cc:
Likewise.
* testsuite/20_util/unsynchronized_pool_resource/release.cc:
Likewise.
* testsuite/21_strings/basic_string/types/pmr_typedefs.cc:
Likewise.
* testsuite/23_containers/deque/types/pmr_typedefs.cc: Likewise.
* testsuite/23_containers/deque/types/pmr_typedefs_debug.cc:
Likewise.
* testsuite/23_containers/forward_list/pmr_typedefs.cc:
Likewise.
* testsuite/23_containers/forward_list/pmr_typedefs_debug.cc:
Likewise.
* testsuite/23_containers/list/pmr_typedefs.cc: Likewise.
* testsuite/23_containers/list/pmr_typedefs_debug.cc: Likewise.
* testsuite/23_containers/map/pmr_typedefs.cc: Likewise.
* testsuite/23_containers/map/pmr_typedefs_debug.cc: Likewise.
* testsuite/23_containers/multimap/pmr_typedefs.cc: Likewise.
* testsuite/23_containers/multimap/pmr_typedefs_debug.cc:
Likewise.
* testsuite/23_containers/multiset/pmr_typedefs.cc: Likewise.
* testsuite/23_containers/multiset/pmr_typedefs_debug.cc:
Likewise.
* testsuite/23_containers/set/pmr_typedefs.cc: Likewise.
* testsuite/23_containers/set/pmr_typedefs_debug.cc: Likewise.
* testsuite/23_containers/unordered_map/pmr_typedefs.cc:
Likewise.
* testsuite/23_containers/unordered_map/pmr_typedefs_debug.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/pmr_typedefs.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/pmr_typedefs_debug.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/pmr_typedefs.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/pmr_typedefs_debug.cc:
Likewise.
* testsuite/23_containers/unordered_set/pmr_typedefs.cc:
Likewise.
* testsuite/23_containers/unordered_set/pmr_typedefs_debug.cc:
Likewise.
* testsuite/23_containers/vector/pmr_typedefs.cc: Likewise.
* testsuite/23_containers/vector/types/pmr_typedefs_debug.cc:
Likewise.
* testsuite/28_regex/match_results/pmr_typedefs.cc: Likewise.

(cherry picked from commit 7a4e52e44a8c9e6c59060adc691de5144d3c6940)

3 years agolibstdc++: Remove redundant -std=gnu++17 option from concurrency tests
Jonathan Wakely [Mon, 10 May 2021 15:22:53 +0000 (16:22 +0100)]
libstdc++: Remove redundant -std=gnu++17 option from concurrency tests

GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the
dg-options directive prevents running these tests with different modes
such as -std=c++17 or -std=gnu++20.

libstdc++-v3/ChangeLog:

* testsuite/29_atomics/atomic/69769.cc: Remove -std=gnu++17 from
dg-options.
* testsuite/29_atomics/atomic/is_always_lock_free.cc:
* testsuite/29_atomics/atomic/requirements/typedefs.cc:
* testsuite/29_atomics/atomic_integral/is_always_lock_free.cc:
* testsuite/29_atomics/atomic_integral/requirements/typedefs.cc:
* testsuite/30_threads/lock_guard/cons/deduction.cc: Likewise.
* testsuite/30_threads/scoped_lock/cons/1.cc: Likewise.
* testsuite/30_threads/scoped_lock/cons/deduction.cc: Likewise.
* testsuite/30_threads/scoped_lock/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/30_threads/scoped_lock/requirements/typedefs.cc:
Likewise.
* testsuite/30_threads/shared_lock/70766.cc: Likewise.
* testsuite/30_threads/shared_mutex/cons/1.cc: Likewise.
* testsuite/30_threads/shared_mutex/cons/assign_neg.cc:
Likewise.
* testsuite/30_threads/shared_mutex/cons/copy_neg.cc: Likewise.
* testsuite/30_threads/shared_mutex/requirements/standard_layout.cc:
Likewise.
* testsuite/30_threads/shared_mutex/try_lock/1.cc: Likewise.
* testsuite/30_threads/shared_mutex/try_lock/2.cc: Likewise.
* testsuite/30_threads/shared_mutex/unlock/1.cc: Likewise.
* testsuite/30_threads/unique_lock/cons/deduction.cc: Likewise.

(cherry picked from commit 9cd88c022fcad783997cd4111b2e6c3700c4b15b)

3 years agolibstdc++: Remove redundant -std=gnu++17 option from any/optional/variant tests
Jonathan Wakely [Mon, 10 May 2021 15:22:53 +0000 (16:22 +0100)]
libstdc++: Remove redundant -std=gnu++17 option from any/optional/variant tests

GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the
dg-options directive prevents running these tests with different modes
such as -std=c++17 or -std=gnu++20.

libstdc++-v3/ChangeLog:

* testsuite/20_util/any/assign/1.cc: Remove -std=gnu++17 from
dg-options directive.
* testsuite/20_util/any/assign/2.cc: Likewise.
* testsuite/20_util/any/assign/emplace.cc: Likewise.
* testsuite/20_util/any/assign/exception.cc: Likewise.
* testsuite/20_util/any/assign/self.cc: Likewise.
* testsuite/20_util/any/cons/1.cc: Likewise.
* testsuite/20_util/any/cons/2.cc: Likewise.
* testsuite/20_util/any/cons/90415.cc: Likewise.
* testsuite/20_util/any/cons/92156.cc: Likewise.
* testsuite/20_util/any/cons/aligned.cc: Likewise.
* testsuite/20_util/any/cons/explicit.cc: Likewise.
* testsuite/20_util/any/cons/in_place.cc: Likewise.
* testsuite/20_util/any/cons/nontrivial.cc: Likewise.
* testsuite/20_util/any/make_any.cc: Likewise.
* testsuite/20_util/any/misc/any_cast.cc: Likewise.
* testsuite/20_util/any/misc/any_cast_neg.cc: Likewise.
* testsuite/20_util/any/misc/any_cast_no_rtti.cc: Likewise.
* testsuite/20_util/any/misc/swap.cc: Likewise.
* testsuite/20_util/any/modifiers/1.cc: Likewise.
* testsuite/20_util/any/modifiers/83658.cc: Likewise.
* testsuite/20_util/any/modifiers/92156.cc: Likewise.
* testsuite/20_util/any/observers/type.cc: Likewise.
* testsuite/20_util/any/requirements.cc: Likewise.
* testsuite/20_util/any/typedefs.cc: Likewise.
* testsuite/20_util/optional/77288.cc: Likewise.
* testsuite/20_util/optional/84601.cc: Likewise.
* testsuite/20_util/optional/assignment/1.cc: Likewise.
* testsuite/20_util/optional/assignment/2.cc: Likewise.
* testsuite/20_util/optional/assignment/3.cc: Likewise.
* testsuite/20_util/optional/assignment/4.cc: Likewise.
* testsuite/20_util/optional/assignment/5.cc: Likewise.
* testsuite/20_util/optional/assignment/6.cc: Likewise.
* testsuite/20_util/optional/assignment/7.cc: Likewise.
* testsuite/20_util/optional/assignment/8.cc: Likewise.
* testsuite/20_util/optional/assignment/9.cc: Likewise.
* testsuite/20_util/optional/bad_access.cc: Likewise.
* testsuite/20_util/optional/cons/77727.cc: Likewise.
* testsuite/20_util/optional/cons/85642.cc: Likewise.
* testsuite/20_util/optional/cons/copy.cc: Likewise.
* testsuite/20_util/optional/cons/deduction.cc: Likewise.
* testsuite/20_util/optional/cons/default.cc: Likewise.
* testsuite/20_util/optional/cons/move.cc: Likewise.
* testsuite/20_util/optional/cons/trivial.cc: Likewise.
* testsuite/20_util/optional/cons/value.cc: Likewise.
* testsuite/20_util/optional/cons/value_neg.cc: Likewise.
* testsuite/20_util/optional/constexpr/cons/default.cc:
Likewise.
* testsuite/20_util/optional/constexpr/cons/value.cc: Likewise.
* testsuite/20_util/optional/constexpr/in_place.cc: Likewise.
* testsuite/20_util/optional/constexpr/make_optional.cc:
Likewise.
* testsuite/20_util/optional/constexpr/nullopt.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/1.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/2.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/3.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/4.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/5.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/1.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/2.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/3.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/4.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/5.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/6.cc: Likewise.
* testsuite/20_util/optional/hash.cc: Likewise.
* testsuite/20_util/optional/in_place.cc: Likewise.
* testsuite/20_util/optional/make_optional.cc: Likewise.
* testsuite/20_util/optional/nullopt.cc: Likewise.
* testsuite/20_util/optional/observers/1.cc: Likewise.
* testsuite/20_util/optional/observers/2.cc: Likewise.
* testsuite/20_util/optional/observers/3.cc: Likewise.
* testsuite/20_util/optional/observers/4.cc: Likewise.
* testsuite/20_util/optional/observers/5.cc: Likewise.
* testsuite/20_util/optional/observers/6.cc: Likewise.
* testsuite/20_util/optional/relops/1.cc: Likewise.
* testsuite/20_util/optional/relops/2.cc: Likewise.
* testsuite/20_util/optional/relops/3.cc: Likewise.
* testsuite/20_util/optional/relops/4.cc: Likewise.
* testsuite/20_util/optional/relops/5.cc: Likewise.
* testsuite/20_util/optional/relops/6.cc: Likewise.
* testsuite/20_util/optional/relops/7.cc: Likewise.
* testsuite/20_util/optional/requirements.cc: Likewise.
* testsuite/20_util/optional/swap/1.cc: Likewise.
* testsuite/20_util/optional/swap/2.cc: Likewise.
* testsuite/20_util/optional/typedefs.cc: Likewise.
* testsuite/20_util/variant/80165.cc: Likewise.
* testsuite/20_util/variant/85183.cc: Likewise.
* testsuite/20_util/variant/86874.cc: Likewise.
* testsuite/20_util/variant/87431.cc: Likewise.
* testsuite/20_util/variant/87619.cc: Likewise.
* testsuite/20_util/variant/91807.cc: Likewise.
* testsuite/20_util/variant/any.cc: Likewise.
* testsuite/20_util/variant/compile.cc: Likewise.
* testsuite/20_util/variant/deduction.cc: Likewise.
* testsuite/20_util/variant/exception_safety.cc: Likewise.
* testsuite/20_util/variant/hash.cc: Likewise.
* testsuite/20_util/variant/index_type.cc: Likewise.
* testsuite/20_util/variant/relops/89851.cc: Likewise.
* testsuite/20_util/variant/relops/90008.cc: Likewise.
* testsuite/20_util/variant/run.cc: Likewise.
* testsuite/20_util/variant/visit.cc: Likewise.

(cherry picked from commit 8240175b87e331c87993876e782971eda46f9a6e)

3 years agolibstdc++: Remove redundant -std=gnu++17 options from filesystem tests
Jonathan Wakely [Mon, 10 May 2021 15:22:53 +0000 (16:22 +0100)]
libstdc++: Remove redundant -std=gnu++17 options from filesystem tests

GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the
dg-options directive prevents running these tests with different modes
such as -std=c++17 or -std=gnu++20.

libstdc++-v3/ChangeLog:

* testsuite/27_io/basic_filebuf/open/char/path.cc: Remove
-std=gnu++17 from dg-options directive.
* testsuite/27_io/basic_fstream/cons/char/path.cc: Likewise.
* testsuite/27_io/basic_fstream/open/char/path.cc: Likewise.
* testsuite/27_io/basic_ifstream/cons/char/path.cc: Likewise.
* testsuite/27_io/basic_ifstream/open/char/path.cc: Likewise.
* testsuite/27_io/basic_ofstream/cons/char/path.cc: Likewise.
* testsuite/27_io/basic_ofstream/open/char/path.cc: Likewise.
* testsuite/27_io/filesystem/directory_entry/86597.cc: Likewise.
* testsuite/27_io/filesystem/directory_entry/lwg3171.cc:
Likewise.
* testsuite/27_io/filesystem/file_status/1.cc: Likewise.
* testsuite/27_io/filesystem/filesystem_error/cons.cc: Likewise.
* testsuite/27_io/filesystem/filesystem_error/copy.cc: Likewise.
* testsuite/27_io/filesystem/iterators/91067.cc: Likewise.
* testsuite/27_io/filesystem/iterators/caching.cc: Likewise.
* testsuite/27_io/filesystem/iterators/directory_iterator.cc:
Likewise.
* testsuite/27_io/filesystem/iterators/pop.cc: Likewise.
* testsuite/27_io/filesystem/iterators/recursion_pending.cc:
Likewise.
* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
Likewise.
* testsuite/27_io/filesystem/operations/absolute.cc: Likewise.
* testsuite/27_io/filesystem/operations/all.cc: Likewise.
* testsuite/27_io/filesystem/operations/canonical.cc: Likewise.
* testsuite/27_io/filesystem/operations/copy.cc: Likewise.
* testsuite/27_io/filesystem/operations/copy_file.cc: Likewise.
* testsuite/27_io/filesystem/operations/create_directories.cc:
Likewise.
* testsuite/27_io/filesystem/operations/create_directory.cc:
Likewise.
* testsuite/27_io/filesystem/operations/create_symlink.cc:
Likewise.
* testsuite/27_io/filesystem/operations/current_path.cc:
Likewise.
* testsuite/27_io/filesystem/operations/equivalent.cc: Likewise.
* testsuite/27_io/filesystem/operations/exists.cc: Likewise.
* testsuite/27_io/filesystem/operations/file_size.cc: Likewise.
* testsuite/27_io/filesystem/operations/is_empty.cc: Likewise.
* testsuite/27_io/filesystem/operations/last_write_time.cc:
Likewise.
* testsuite/27_io/filesystem/operations/permissions.cc:
Likewise.
* testsuite/27_io/filesystem/operations/proximate.cc: Likewise.
* testsuite/27_io/filesystem/operations/read_symlink.cc:
Likewise.
* testsuite/27_io/filesystem/operations/relative.cc: Likewise.
* testsuite/27_io/filesystem/operations/remove.cc: Likewise.
* testsuite/27_io/filesystem/operations/remove_all.cc: Likewise.
* testsuite/27_io/filesystem/operations/rename.cc: Likewise.
* testsuite/27_io/filesystem/operations/resize_file.cc:
Likewise.
* testsuite/27_io/filesystem/operations/space.cc: Likewise.
* testsuite/27_io/filesystem/operations/status.cc: Likewise.
* testsuite/27_io/filesystem/operations/symlink_status.cc:
Likewise.
* testsuite/27_io/filesystem/operations/temp_directory_path.cc:
Likewise.
* testsuite/27_io/filesystem/operations/weakly_canonical.cc:
Likewise.
* testsuite/27_io/filesystem/path/append/path.cc: Likewise.
* testsuite/27_io/filesystem/path/append/source.cc: Likewise.
* testsuite/27_io/filesystem/path/assign/assign.cc: Likewise.
* testsuite/27_io/filesystem/path/assign/copy.cc: Likewise.
* testsuite/27_io/filesystem/path/compare/compare.cc: Likewise.
* testsuite/27_io/filesystem/path/compare/lwg2936.cc: Likewise.
* testsuite/27_io/filesystem/path/compare/path.cc: Likewise.
* testsuite/27_io/filesystem/path/compare/strings.cc: Likewise.
* testsuite/27_io/filesystem/path/concat/92853.cc: Likewise.
* testsuite/27_io/filesystem/path/concat/94063.cc: Likewise.
* testsuite/27_io/filesystem/path/concat/path.cc: Likewise.
* testsuite/27_io/filesystem/path/concat/strings.cc: Likewise.
* testsuite/27_io/filesystem/path/construct/80762.cc: Likewise.
* testsuite/27_io/filesystem/path/construct/90281.cc: Likewise.
* testsuite/27_io/filesystem/path/construct/90634.cc: Likewise.
* testsuite/27_io/filesystem/path/construct/copy.cc: Likewise.
* testsuite/27_io/filesystem/path/construct/default.cc:
Likewise.
* testsuite/27_io/filesystem/path/construct/format.cc: Likewise.
* testsuite/27_io/filesystem/path/construct/locale.cc: Likewise.
* testsuite/27_io/filesystem/path/construct/range.cc: Likewise.
* testsuite/27_io/filesystem/path/construct/string_view.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/extension.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/filename.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/parent_path.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/relative_path.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/root_directory.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/root_name.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/root_path.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/stem.cc: Likewise.
* testsuite/27_io/filesystem/path/factory/u8path-char8_t.cc:
Likewise.
* testsuite/27_io/filesystem/path/factory/u8path.cc: Likewise.
* testsuite/27_io/filesystem/path/generation/normal.cc:
Likewise.
* testsuite/27_io/filesystem/path/generation/normal2.cc:
Likewise.
* testsuite/27_io/filesystem/path/generation/proximate.cc:
Likewise.
* testsuite/27_io/filesystem/path/generation/relative.cc:
Likewise.
* testsuite/27_io/filesystem/path/generic/94242.cc: Likewise.
* testsuite/27_io/filesystem/path/generic/generic_string.cc:
Likewise.
* testsuite/27_io/filesystem/path/generic/utf.cc: Likewise.
* testsuite/27_io/filesystem/path/generic/wchar_t.cc: Likewise.
* testsuite/27_io/filesystem/path/io/dr2989.cc: Likewise.
* testsuite/27_io/filesystem/path/itr/components.cc: Likewise.
* testsuite/27_io/filesystem/path/itr/traversal.cc: Likewise.
* testsuite/27_io/filesystem/path/modifiers/clear.cc: Likewise.
* testsuite/27_io/filesystem/path/modifiers/make_preferred.cc:
Likewise.
* testsuite/27_io/filesystem/path/modifiers/remove_filename.cc:
Likewise.
* testsuite/27_io/filesystem/path/modifiers/replace_extension.cc:
Likewise.
* testsuite/27_io/filesystem/path/modifiers/replace_filename.cc:
Likewise.
* testsuite/27_io/filesystem/path/modifiers/swap.cc: Likewise.
* testsuite/27_io/filesystem/path/native/alloc.cc: Likewise.
* testsuite/27_io/filesystem/path/native/string-char8_t.cc:
Likewise.
* testsuite/27_io/filesystem/path/native/string.cc: Likewise.
* testsuite/27_io/filesystem/path/nonmember/append.cc: Likewise.
* testsuite/27_io/filesystem/path/nonmember/cmp.cc: Likewise.
* testsuite/27_io/filesystem/path/nonmember/hash_value.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/empty.cc: Likewise.
* testsuite/27_io/filesystem/path/query/empty_neg.cc:
* testsuite/27_io/filesystem/path/query/has_extension.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_filename.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_parent_path.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_relative_path.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_root_directory.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_root_name.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_root_path.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_stem.cc: Likewise.
* testsuite/27_io/filesystem/path/query/is_absolute.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/is_relative.cc:
Likewise.
* testsuite/experimental/filesystem/path/construct/string_view.cc:
Likewise.

(cherry picked from commit aa60ff1c8879f67557efc188b1d18d008458c76a)

3 years agolibstdc++: Remove redundant -std=gnu++17 options from PSTL tests
Jonathan Wakely [Mon, 10 May 2021 15:22:53 +0000 (16:22 +0100)]
libstdc++: Remove redundant -std=gnu++17 options from PSTL tests

GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the
dg-options directive prevents running these tests with different modes
such as -std=c++17 or -std=gnu++20.

libstdc++-v3/ChangeLog:

* testsuite/20_util/specialized_algorithms/pstl/uninitialized_construct.cc:
Remove -std=gnu++17 from dg-options.
* testsuite/20_util/specialized_algorithms/pstl/uninitialized_copy_move.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/pstl/uninitialized_fill_destroy.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_merge/merge.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/fill.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/generate.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/remove_copy.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/replace.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/swap_ranges.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/transform_binary.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/transform_unary.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/adjacent_find.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/for_each.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/mismatch.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/includes.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/is_heap.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/is_sorted.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/set.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/sort.cc: Likewise.
* testsuite/25_algorithms/pstl/feature_test-2.cc: Likewise.
* testsuite/25_algorithms/pstl/feature_test-3.cc: Likewise.
* testsuite/25_algorithms/pstl/feature_test-4.cc: Likewise.
* testsuite/25_algorithms/pstl/feature_test-5.cc: Likewise.
* testsuite/25_algorithms/pstl/feature_test.cc: Likewise.
* testsuite/26_numerics/pstl/numeric_ops/adjacent_difference.cc:
Likewise.
* testsuite/26_numerics/pstl/numeric_ops/reduce.cc: Likewise.
* testsuite/26_numerics/pstl/numeric_ops/scan.cc: Likewise.
* testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc:
Likewise.
* testsuite/26_numerics/pstl/numeric_ops/transform_scan.cc:
Likewise.

(cherry picked from commit 646e6c652448bfd8fca535d91f588b4606295a72)

3 years agolibstdc++: Adjust expected errors in tests when compiled as C++20
Jonathan Wakely [Mon, 10 May 2021 14:10:45 +0000 (15:10 +0100)]
libstdc++: Adjust expected errors in tests when compiled as C++20

libstdc++-v3/ChangeLog:

* testsuite/20_util/scoped_allocator/69293_neg.cc: Add dg-error
for additional errors in C++20.
* testsuite/20_util/specialized_algorithms/memory_management_tools/destroy_neg.cc:
Likewise.
* testsuite/20_util/uses_allocator/69293_neg.cc: Likewise.
* testsuite/27_io/filesystem/path/io/dr2989.cc: Likewise.

(cherry picked from commit 23972128c83e62011b583f06b32c8501c096b7d8)

3 years agolibstdc++: Rename test type to avoid clashing with std::any
Jonathan Wakely [Mon, 10 May 2021 12:57:49 +0000 (13:57 +0100)]
libstdc++: Rename test type to avoid clashing with std::any

When PCH are enabled this test file includes <any> and so the
using-directive brings std::any into the global scope. It isn't
currently a problem, because the -std option in the dg-options means
that PCH is not used. If that option is removed, the test fails with PCH
and passes without.

This just renames the type to avoid the name classh (and also the 'none'
type for consistency).

libstdc++-v3/ChangeLog:

* testsuite/20_util/variant/compile.cc: Rename 'any' to avoid
clash with std::any.

(cherry picked from commit 2bbacc18b35e44d45676a46eced26129f8f8378a)

3 years agolibstdc++: Fix definition of std::remove_cvref_t
Jonathan Wakely [Thu, 6 May 2021 12:40:53 +0000 (13:40 +0100)]
libstdc++: Fix definition of std::remove_cvref_t

I originally defined std::remove_cvref_t in terms of the internal
__remove_cvref_t trait, to avoid instantiating the remove_cvref class
template. However, as described in P1715R0 that is observable by users
and is thus non-conforming.

This defines remove_cvref_t as specified in the standard.

libstdc++-v3/ChangeLog:

* include/std/type_traits (remove_cvref_t): Define in terms of
remove_cvref.
* testsuite/20_util/remove_cvref/value.cc: Check alias.

(cherry picked from commit 0e79e63026e43ad0577812ffb405dac8fa88af5b)

3 years agolibstdc++: Reject std::make_shared<T[]> [PR 99006]
Jonathan Wakely [Thu, 22 Apr 2021 14:46:51 +0000 (15:46 +0100)]
libstdc++: Reject std::make_shared<T[]> [PR 99006]

Prior to C++20 it should be ill-formed to use std::make_shared with an
array type (and we don't support the C++20 feature to make it valid yet
anyway).

libstdc++-v3/ChangeLog:

PR libstdc++/99006
* include/bits/shared_ptr.h (allocate_shared): Assert that _Tp
is not an array type.
* include/bits/shared_ptr_base.h (__allocate_shared): Likewise.
* testsuite/20_util/shared_ptr/creation/99006.cc: New test.

(cherry picked from commit 55650236cd97d81f42f9fdb4f6bcb12babafe51f)

3 years agolibstdc++: Install libstdc++*-gdb.py more robustly [PR 99453]
Philippe Blain [Sat, 13 Mar 2021 00:26:46 +0000 (19:26 -0500)]
libstdc++: Install libstdc++*-gdb.py more robustly [PR 99453]

In order for GDB to auto-load the pretty printers, they must be installed
as "libstdc++.$ext-gdb.py", where 'libstdc++.$ext' is the name of the
object file that is loaded by GDB [1], i.e. the libstdc++ shared library.

The approach taken in libstdc++-v3/python/Makefile.am is to loop over
files matching 'libstdc++*' in $(DESTDIR)$(toolexeclibdir) and choose
the last file matching that glob that is not a symlink, the Libtool
'*.la' file or a Python file.

That works fine for ELF targets where the matching names are:

  libstdc++.a
  libstdc++.so
  libstdc++.so.6
  libstdc++.so.6.0.29

But not for macOS with:

  libstdc++.6.dylib
  libstdc++.a

Or MinGW with:

  libstdc++-6.dll
  libstdc++.dll.a

Try to make a better job at installing the pretty printers with the
correct name by copying the approach taken by isl [2], that is, using
a sed invocation on the Libtool-generated 'libstdc++.la' to read the
correct name for the current platform.

[1] https://sourceware.org/gdb/onlinedocs/gdb/objfile_002dgdbdotext-file.html
[2] https://repo.or.cz/isl.git/blob/HEAD:/Makefile.am#l611

libstdc++-v3/ChangeLog:

PR libstdc++/99453
* python/Makefile.am: Install libstdc++*-gdb.py more robustly.
* python/Makefile.in: Regenerate.

Co-authored-by: Jonathan Wakely <jwakely@redhat.com>
(cherry picked from commit c2fc1702cb3a3d5cc9c40de47f63b4c8f3f1d09c)

3 years agolibstdc++: Remove extern "C" from Ryu sources
Patrick Palka [Tue, 11 May 2021 17:19:46 +0000 (13:19 -0400)]
libstdc++: Remove extern "C" from Ryu sources

floating_to_chars.cc includes the Ryu sources into an anonymous
namespace as a convenient way to give all its symbols internal linkage.
But an entity declared extern "C" always has external linkage even
from within an anonymous namespace, so this trick doesn't work in the
presence of extern "C", and it causes the Ryu function generic_to_chars
to be visible from libstdc++.a.

This patch removes the only use of extern "C" from our local copy of
Ryu along with some declarations for never-defined functions that GCC
now warns about.

libstdc++-v3/ChangeLog:

* src/c++17/ryu/LOCAL_PATCHES: Update.
* src/c++17/ryu/ryu_generic_128.h: Remove extern "C".
Remove declarations for never-defined functions.
* testsuite/20_util/to_chars/4.cc: New test.

(cherry picked from commit 84b384a16f388c68166b0603e50d0b477d0830a7)

3 years agoaarch64: Avoid duplicating bti j insns for jump tables [PR99988]
Alex Coplan [Wed, 21 Apr 2021 13:42:04 +0000 (14:42 +0100)]
aarch64: Avoid duplicating bti j insns for jump tables [PR99988]

This patch fixes PR99988 which shows us generating large (> 250)
sequences of back-to-back bti j instructions.

The fix is simply to avoid inserting bti j instructions at the target of
a jump table if we've already inserted one for a given label.

Co-Authored-By: Christophe Lyon <clyon@gcc.gnu.org>
gcc/ChangeLog:

PR target/99988
* config/aarch64/aarch64-bti-insert.c (aarch64_bti_j_insn_p): New.
(rest_of_insert_bti): Avoid inserting duplicate bti j insns for
jump table targets.

gcc/testsuite/ChangeLog:

PR target/99988
* gcc.target/aarch64/pr99988.c: New test.

3 years agoDaily bump.
GCC Administrator [Tue, 11 May 2021 00:18:10 +0000 (00:18 +0000)]
Daily bump.

3 years agod: Fix qualifier ignored in alias definition if parentheses are not present
Iain Buclaw [Mon, 10 May 2021 10:03:19 +0000 (12:03 +0200)]
d: Fix qualifier ignored in alias definition if parentheses are not present

Fixes regression where the qualifier was ignored in an alias definition
if parentheses were not present.

gcc/d/ChangeLog:

* dmd/dsymbolsem.c (aliasInstanceSemantic): Merge storage class of old
alias into new symbol.

gcc/testsuite/ChangeLog:

* gdc.test/compilable/test21898.d: New test.

(cherry picked from commit a30ee3aa8210f14fa3b4ee84fd3974c6b6a93047)

3 years agolibphobos: Fix visibility of std.process.searchPathFor
Iain Buclaw [Tue, 4 May 2021 22:28:44 +0000 (00:28 +0200)]
libphobos: Fix visibility of std.process.searchPathFor

This symbol is used by std.file.thisExePath on OpenBSD.

libphobos/ChangeLog:

* src/std/process.d (searchPathFor): Change visibility to package.

(cherry picked from commit cecc437e952e35f8a7907553586605cbd0bba82a)

3 years agoDaily bump.
GCC Administrator [Mon, 10 May 2021 00:18:10 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 9 May 2021 00:18:19 +0000 (00:18 +0000)]
Daily bump.

This page took 0.121717 seconds and 5 git commands to generate.