Commit Graph

187626 Commits

Author SHA1 Message Date
GCC Administrator
1e77fd4f17 Daily bump. 2021-08-30 00:16:44 +00:00
Iain Buclaw
392e141079 libiberty: Add support for demangling local D template declarations
The D language now allows multiple different template declarations in
the same function that have the same mangled name.  To make the mangled
names unique, a fake parent in the form `__Sddd' is added to the symbol.
This information is not important for the user, so the demangler now
handles and ignores it.

libiberty/ChangeLog:

	* d-demangle.c (dlang_identifier): Skip over fake parent manglings.
	* testsuite/d-demangle-expected: Add tests.
2021-08-30 01:14:18 +02:00
Iain Buclaw
34f3e0657a libiberty: Add support for demangling D function literals as template value parameters
The D language now allows instantiating templates using struct literals
that have function literal fields as a value argument.

libiberty/ChangeLog:

	* d-demangle.c (dlang_parse_arrayliteral): Add 'info' parameter.
	(dlang_parse_assocarray): Likewise.
	(dlang_parse_structlit): Likewise.
	(dlang_value): Likewise.  Handle function literal symbols.
	(dlang_template_args): Pass 'info' to dlang_value.
	* testsuite/d-demangle-expected: Add new test.
2021-08-30 01:14:18 +02:00
Iain Buclaw
0e32a5aa8b libiberty: Add support for D `typeof(*null)' types
The D language has a new bottom type `typeof(*null)'.  Null types were
also incorrectly being demangled as `none', this has been fixed to be
`typeof(null)'.

libiberty/ChangeLog:

	* d-demangle.c (dlang_attributes): Handle typeof(*null).
	(dlang_type): Likewise.  Demangle 'n' as typeof(null).
	* testsuite/d-demangle-expected: Update tests.
2021-08-30 01:14:18 +02:00
Iain Sandoe
c3c669ac81 Darwin: Fixes for darwin_libc_has_function.
Firstly, the checks for availability need not be run for any
currently supported Darwin version (or for any version of
Darwin on x86).  In fact, the only test that is needed that
differs from the default is for the availbaility of sincos.
Test that and then fall back to the default implementation.

Secondly, the funtion appears to be called from the Jit library
before the value of darwin_macosx_version_min has been set up -
at present we work around this by guarding the checks on having
a non-null pointer for darwin_macosx_version_min.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config/darwin.c (darwin_libc_has_function): Do not run
	the checks for x86 or modern Darwin.  Make sure that there
	is a value set for darwin_macosx_version_min before testing.
2021-08-29 20:51:29 +01:00
Iain Buclaw
766f5f8726 d: Call the assertp and boundsp variants for assert and array contract failures.
gcc/d/ChangeLog:

	* d-codegen.cc: Include dmd/module.h.
	(build_filename_from_loc): New function.
	(d_assert_call): Rename to...
	(build_assert_call): ...this.
	(build_array_bounds_call): Call arrayboundsp variant of the array
	bounds failure callback.
	(build_bounds_condition): Rename to...
	(build_bounds_index_condition): ...this.  Update signature.
	(build_bounds_slice_condition): New function.
	(checkaction_trap_p): New function.
	(d_assert_call): Call assertp variant of assert failure callback.
	* d-tree.h (class IndexExp): Declare.
	(class SliceExp): Declare.
	(build_bounds_condition): Remove.
	(build_assert_call): Declare.
	(build_bounds_index_condition): Declare.
	(build_bounds_slice_condition): Declare.
	(checkaction_trap_p): Declare.
	(d_assert_call): Remove.
	* expr.cc (ExprVisitor::visit(IndexExp *)): Call
	build_bounds_index_condition.
	(ExprVisitor::visit(SliceExp *)): Call build_bounds_slice_condition.
	(ExprVisitor::visit(AssertExp *)): Update setting of libcall.
	* runtime.cc (enum d_libcall_type): Add LCT_IMMUTABLE_CHARPTR.
	(get_libcall_type): Handle LCT_IMMUTABLE_CHARPTR.
	* runtime.def (ASSERT): Rename to...
	(ASSERTP): ...this.  Update signature.
	(UNITTEST): Rename to...
	(UNITTESTP): ...this.  Update signature.
	(ARRAY_BOUNDS): Rename to...
	(ARRAYBOUNDSP): ...this.  Updates signature.
	* toir.cc (IRVisitor::visit(SwitchErrorStatement *)): Update call.
2021-08-29 17:19:03 +02:00
Iain Buclaw
118a559df9 d: Update comment for TypeInfoVisitor::layout_base
gcc/d/ChangeLog:

	* typeinfo.cc (class TypeInfoVisitor::layout_base): Update comment.
2021-08-29 17:19:02 +02:00
Iain Buclaw
2b8543a8ce d: Use int to store class and struct flags
gcc/d/ChangeLog:

	* typeinfo.cc (TypeInfoVisitor::visit(TypeInfoClassDeclaration *)):
	Use int to store type flags.
	(TypeInfoVisitor::visit(TypeInfoStructDeclaration *)): Likewise.
2021-08-29 17:19:02 +02:00
Iain Buclaw
0abfd7f4f4 d: Get __c_wchar_t type from build_frontend_type
gcc/d/ChangeLog:

	* types.cc (TypeVisitor::visit(TypeEnum*)): Get wchar_t type from
	build_frontend_type.
2021-08-29 17:19:02 +02:00
Iain Buclaw
ce15a3e757 d: Convert convert_for_rvalue switch statement into if condition
gcc/d/ChangeLog:

	* d-convert.cc (convert_for_rvalue): Convert switch statement into if
	condition.
2021-08-29 17:19:02 +02:00
Iain Buclaw
1925e514b4 d: Use POINTER_SIZE for testing whether to predefine D_LP64
gcc/d/ChangeLog:

	* d-builtins.cc (d_init_versions): Use POINTER_SIZE for testing
	whether to predefine D_LP64.
2021-08-29 17:19:02 +02:00
Iain Buclaw
07984707be d: ICE in gimple_register_canonical_type_1, at lto/lto-common.c:430 (PR102094)
User defined types have the TYPE_CXX_ODR_P flag set, but closure frames
did not.  This mismatch led to an ICE in the conflict detection for ODR
and interoperable non-ODR types.  As a given closure frame is tied
explicitly to a function, it already conforms to ODR.

	PR d/102094

gcc/d/ChangeLog:

	* d-codegen.cc (build_frame_type): Set TYPE_CXX_ODR_P.

gcc/testsuite/ChangeLog:

	* gdc.dg/lto/pr102094_0.d: New test.
2021-08-29 17:19:02 +02:00
Iain Sandoe
dc033e0149 testsuite, Darwin : Skip a test requiring strndup in libc.
Before Darwin11 there is no strndup in libc. This test fails with
warning output because of that - so skip it on these versions (since
they are not able to use strndup anyway).

gcc/testsuite/ChangeLog:

	* gcc.dg/analyzer/strndup-1.c: Skip for Darwin versions
	without strndup support in libc.
2021-08-29 07:53:18 +01:00
Iain Sandoe
fc3e9f58ec Darwin, X86 : Implement __cache_clear.
We had a NOP cache clear, but there is a suitable mechanism provided
by a system call.  This connects it up.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config/i386/darwin.h (CLEAR_INSN_CACHE): New.
2021-08-29 07:50:52 +01:00
GCC Administrator
a21e5de421 Daily bump. 2021-08-29 00:16:41 +00:00
Jan Hubicka
f5ff3a8ed4 Improve handling of table overflows in modref_ref_node
gcc/ChangeLog:

	* ipa-modref-tree.h (modref_access_node::merge): Break out
	logic combining offsets and logic merging ranges to ...
	(modref_access_node::combined_offsets): ... here
	(modref_access_node::update2): ... here
	(modref_access_node::closer_pair_p): New member function.
	(modref_access_node::forced_merge): New member function.
	(modre_ref_node::insert): Do merging when table is full.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/modref-9.c: New test.
2021-08-28 20:57:08 +02:00
Harald Anlauf
f9809ef570 Fortran - reject function entries with mismatched characteristics
gcc/fortran/ChangeLog:

	PR fortran/87737
	* resolve.c (resolve_entries): For functions of type CHARACTER
	tighten the checks for matching characteristics.

gcc/testsuite/ChangeLog:

	PR fortran/87737
	* gfortran.dg/entry_24.f90: New test.
2021-08-28 20:09:44 +02:00
Jonathan Wakely
754fca77e8 libstdc++: Fix std::allocator<void> for versioned namespace
Removing the allocator<void> specialization for the versioned namespace
breaks _Extptr_allocator<void> because the allocator<void>
specialization was still declared in <bits/memoryfwd.h>, making it an
incomplete type.  It wrong to remove that specialization anyway, because
it is still needed pre-C++20.

This removes the #if ! _GLIBCXX_INLINE_VERSION check, so that
allocator<void> is still explicitly specialized for the versioned
namespace, consistent with the normal unversioned namespace mode.

To make _Extptr_allocator<void> usable as a ProtoAllocator, this change
adds a default constructor and converting constructor. That is
consistent with std::allocator<void> since C++20 (and harmless to do for
earlier standards).

I'm also explicitly specializing allocator_traits<allocator<void>> so
that it doesn't need to use allocator<void>::construct and destroy.
Doing that allows those members to be removed, further simplifying
allocator<void>.  That new explicit specialization can delete the
allocate, deallocate and max_size members, which are always ill-formed
for allocator<void>.

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

libstdc++-v3/ChangeLog:

	* include/bits/alloc_traits.h (allocator_traits): Add explicit
	specialization for allocator<void>. Improve doxygen comments.
	* include/bits/allocator.h (allocator<void>): Restore for the
	versioned namespace.
	(allocator<void>::construct, allocator<void>::destroy): Remove.
	* include/ext/extptr_allocator.h (_Extptr_allocator<void>):
	Add default constructor and converting constructor.
2021-08-28 14:37:19 +01:00
Jonathan Wakely
dd3e5859fc libstdc++: Fix comment typo
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/bits/stl_uninitialized.h: Fix typo in comment.
2021-08-28 11:52:22 +01:00
Jonathan Wakely
07b990ee23 libstdc++: Fix inefficiency in filesystem::absolute [PR99876]
When the path is already absolute, the call to current_path() is
wasteful, because operator/ will ignore the left operand anyway.

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

libstdc++-v3/ChangeLog:

	PR libstdc++/99876
	* src/c++17/fs_ops.cc (fs::absolute): Call non-throwing form,
	to avoid unnecessary current_path() call.
2021-08-28 11:52:22 +01:00
Jonathan Wakely
952095bb05 libstdc++: Name std::function template parameter
This avoids "<template-parameter-2-2>" being shown in the diagnostics
for ill-formed uses of std::function constructor:

In instantiation of 'std::function<_Res(_ArgTypes ...)>::function(_Functor&&)
[with _Functor = f(f()::_Z1fv.frame*)::<lambda()>;
<template-parameter-2-2> = void; _Res = void; _ArgTypes = {}]'

Instead we get:

In instantiation of 'std::function<_Res(_ArgTypes ...)>::function(_Functor&&)
[with _Functor = f(f()::_Z1fv.frame*)::<lambda()>;
_Constraints = void; _Res = void; _ArgTypes = {}]'

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

libstdc++-v3/ChangeLog:

	* include/bits/std_function.h (function::function(F&&)): Give
	name to defaulted template parameter, to improve diagnostics.
	Use markdown for more doxygen comments.
2021-08-28 11:52:22 +01:00
YunQiang Su
91f78b673b
MIPS: use N64 ABI by default if the triple end with -gnuabi64
gcc/ChangeLog:

	PR target/102089
	* config.gcc: MIPS: use N64 ABI by default if the triple end
	  with -gnuabi64, which is used by Debian since 2013.
2021-08-28 14:52:09 +08:00
Alexandre Oliva
aa49a05808 fix latent bootstrap-debug issue
I've hit a bootstrap-debug error involving large subprograms in
gcc/ada/sem_ch12.adb.  I'm afraid I couldn't narrow it down to a
reasonable testcase.

thread1 made different decisions about a block containing a
builtin_eh_filter call because in one compilation, estimate_num_insns
found a cgraph_node for the builtin and could thus get to the
is_simple_builtin test, but in the other it didn't.  With different
insn counts, one stage jump-threaded and the other didn't, and the
resulting code diverged quite a bit.

The reason the builtin had a cgraph_node in one case but not the other
was that modref got a chance to analyze the builtin call when it was
the first stmt in the block, and that created the cgraph_node.
However, when it was preceded by debug stmts, the loop in
analyze_function was cut short after the first debug stmt, because the
summary so far was not useful.

This patch fixes both issues: skip debug stmts in the analyze_function
loop, so as to prevent them from affecting any decisions in the loop,
and enable the insn count estimator to get to the is_simple_builtin
test when a cgraph_node has not been created for the builtin.


for  gcc/ChangeLog

	* ipa-modref.c (analyze_function): Skip debug stmts.
	* tree-inline.c (estimate_num_insn): Consider builtins even
	without a cgraph_node.
2021-08-28 00:40:14 -03:00
GCC Administrator
1e52538d2b Daily bump. 2021-08-28 00:16:42 +00:00
Jason Merrill
771fd4aef9 c++: Set type on dependent ARROW_EXPR
Even if the operand of -> has dependent type, if it's a pointer we know
that the result will be the target type of that pointer.  This should avoid
some unnecessary TYPEOF_EXPR when looking up a name after ->.

gcc/cp/ChangeLog:

	* typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
	a dependent pointer.
2021-08-27 17:37:58 -04:00
Jeff Law
ee914ec4f8 Support limited setcc for H8
gcc/

	* config/h8300/bitfield.md (cstore<mode>4): Remove expander.
	* config/h8300/h8300.c (h8300_expand_branch): Remove function.
	* config/h8300/h8300-protos.h (h8300_expadn_branch): Remove prototype.
	* config/h8300/h8300.md (eqne): New code iterator.
	(geultu, geultu_to_c): Similarly.
	* config/h8300/testcompare.md (cstore<mode>4): Dummy expander.
	(store_c_<mode>, store_c_i_<mode>): New define_insn_and_splits
	(cmp<mode>_c): New pattern
2021-08-27 17:01:37 -04:00
Michael Meissner
10c834f976 Update comments in float128-call.c test.
Segher asked that I update the comments to include the d-form vector stores
(even though they wouldn't be generated by this test).

2021-08-25  Michael Meissner  <meissner@linux.ibm.com>

gcc/testsuite/
	* gcc.target/powerpc/float128-call.c: Update comments.
2021-08-27 16:07:50 -04:00
Jeff Law
ac6d5c9112 Reduce vector comparison of uniform vectors to a scalar comparison
gcc/
	* tree-ssa-dom.c (reduce_vector_comparison_to_scalar_comparison): New
	function.
	(dom_opt_dom_walker::optimize_stmt): Use it.
2021-08-27 15:29:22 -04:00
Michael Meissner
94a047359f Fix float128-call.c test for power8 IEEE 128 and power10.
I built a compiler on a little endian power8 system where the default long
double was IEEE 128-bit instead of IBM 128-bit.  I discovered that on
power8, we would generate a lxvd2x and xxpermdi to deal with the endianess
instead of the Altivec lxv.

In addition, I noticed the constant that was being loaded (1.0q) could be
loaded by the lxvkq instruction.

I rewrote the test to handle all forms of vector load and store that can
be generated.

2021-08-27  Michael Meissner  <meissner@linux.ibm.com>

gcc/testsuite/
	* gcc.target/powerpc/float128-call.c: Fix test for IEEE 128-bit
	long double and power10.
2021-08-27 13:19:54 -04:00
Iain Sandoe
66526c6a1c Darwin : Mark the mod init/term section starts with a linker-visible sym.
Some newer assemblers emit section start temp symbols for mod init and term
sections if there is no suitable symbol present already.
The temp symbols are linker visible and therefore appear in the symbol tables.
Since the temp symbol number can vary when debug is enabled, that causes
compare-debug fails.  The solution is to provide a stable linker-visible
symbol.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config/darwin.c (finalize_ctors): Add a section-start linker-
	visible symbol.
	(finalize_dtors): Likewise.
	* config/darwin.h (MIN_LD64_INIT_TERM_START_LABELS): New.
2021-08-27 17:02:12 +01:00
Bill Schmidt
ff6bb9dde1 rs6000: Execute the automatic built-in initialization code
2021-08-27  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000-call.c (rs6000-builtins.h): New #include.
	(rs6000_init_builtins): Call rs6000_init_generated_builtins.  Skip the
	old initialization logic when new builtins are enabled.
	* config/rs6000/rs6000-gen-builtins.c (write_decls): Rename
	rs6000_autoinit_builtins to rs6000_init_generated_builtins.
	(write_init_file): Likewise.
2021-08-27 10:58:20 -05:00
Iain Sandoe
9b025925ec libgfortran: Use the libtool macro to determine libm availability.
We recently had a report of build failure against a Darwin branch on
the latest OS release.  This was because (temporarily) the symlink
from libm.dylib => libSystem.dylib had been removed/omitted.

libm is not needed on Darwin, and should not be added unconditionally
even if that is (mostly) harmless since it is a symlink to libc.

There could be cases where the addition was not completely harmless
because the presentation of the symlink would cause the symbols exposed
in libSystem to be considered ahead of ones presented in convenience
libraries.

libgfortran/ChangeLog:

	* Makefile.am: Use configured libm availability.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Use libtool macro to find libm availability.
	* libgfortran.spec.in: Use configured libm availability.
2021-08-27 16:50:19 +01:00
Iain Sandoe
e42ea63bcc testsuite, Darwin : Do not claim 'GAS' for cctools assembler.
Although the cctools assembler is based of GNU GAS, it is from a
very old version (1.38) which does not support many of the features
that the target supports test is expecting.

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp: Exclude cctools assembler based on
	GAS 1.38.
2021-08-27 16:49:21 +01:00
Iain Sandoe
e5d9873fcb configure: Adjust several assembler checks to remove an unused parm.
In r12-3048-ge0b6d0b39c6, the GAS version parameter was removed from
the gcc_GAS_CHECK_FEATURE macro.  It seems that overlapping comit/test
cycles resulted in several AMDGCN and one Darwin commit with the now
extra parameter still present.

This causes wrong configure code to be generated when autoreconf is
used in the gcc directory.

Fixed by removing the extraneous parm from the AMDGCN and Darwin cases.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* configure.ac (darwin2[[0-9]]* | darwin19*): Alter use of
	gcc_GAS_CHECK_FEATURE to remove an extraneous parameter.
	(amdgcn-* | gcn-*) Likewise.
2021-08-27 16:47:31 +01:00
Anthony Sharp
fccd5b48ad call_summary: add missing template keyword
Without the 'template', this function template compares 'traverse' to 'f',
and then compares the result to 'a'.  Evidently it hasn't been instantiated
yet.

gcc/ChangeLog:

	* symbol-summary.h: Added missing template keyword.
2021-08-27 10:08:28 -04:00
Richard Biener
41439e1f6d tree-optimization/45178 - DCE of dead control flow in infinite loop
This fixes DCE to be able to elide dead control flow in an
infinite loop without an exit edge.  This special situation is
handled well by the code finding an edge to preserve since there's
no chance it will find the exit edge and make the loop finite.

2021-08-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/45178
	* tree-ssa-dce.c (find_obviously_necessary_stmts): For
	infinite loops without exit do not mark control dependent
	edges of the latch necessary.

	* gcc.dg/tree-ssa/ssa-dce-3.c: Adjust testcase.
2021-08-27 09:51:26 +02:00
konglin1
44a545a6ab i386: Fix wrong optimization for consecutive masked scatters [PR 101472]
gcc/ChangeLog:

	PR target/101472
	* config/i386/sse.md: (<avx512>scattersi<mode>): Add mask operand to
	UNSPEC_VSIBADDR.
	(<avx512>scattersi<mode>): Likewise.
	(*avx512f_scattersi<VI48F:mode>): Merge mask operand to set_dest.
	(*avx512f_scatterdi<VI48F:mode>): Likewise

gcc/testsuite/ChangeLog:

	PR target/101472
	* gcc.target/i386/avx512f-pr101472.c: New test.
	* gcc.target/i386/avx512vl-pr101472.c: New test.
2021-08-27 13:19:43 +08:00
Kewen Lin
26f5ea5e14 rs6000: Make some BIFs vectorized on P10
This patch is to add the support to make vectorizer able to
vectorize some built-in function scalar versions on Power10.

gcc/ChangeLog:

	* config/rs6000/rs6000.c (rs6000_builtin_md_vectorized_function): Add
	support for built-in functions MISC_BUILTIN_DIVWE, MISC_BUILTIN_DIVWEU,
	MISC_BUILTIN_DIVDE, MISC_BUILTIN_DIVDEU, P10_BUILTIN_CFUGED,
	P10_BUILTIN_CNTLZDM, P10_BUILTIN_CNTTZDM, P10_BUILTIN_PDEPD and
	P10_BUILTIN_PEXTD on Power10.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/dive-vectorize-1.c: New test.
	* gcc.target/powerpc/dive-vectorize-1.h: New test.
	* gcc.target/powerpc/dive-vectorize-2.c: New test.
	* gcc.target/powerpc/dive-vectorize-2.h: New test.
	* gcc.target/powerpc/dive-vectorize-run-1.c: New test.
	* gcc.target/powerpc/dive-vectorize-run-2.c: New test.
	* gcc.target/powerpc/p10-bifs-vectorize-1.c: New test.
	* gcc.target/powerpc/p10-bifs-vectorize-1.h: New test.
	* gcc.target/powerpc/p10-bifs-vectorize-run-1.c: New test.
2021-08-26 20:23:58 -05:00
Kewen Lin
2e64eec671 rs6000: Add missing unsigned info for some P10 bifs
This patch is to make prototypes of some Power10 built-in
functions consistent with what's in the documentation, as
well as the vector version.  Otherwise, useless conversions
can be generated in gimple IR, and the vectorized versions
will have inconsistent types.

gcc/ChangeLog:

	* config/rs6000/rs6000-call.c (builtin_function_type): Add unsigned
	signedness for some Power10 bifs.
2021-08-26 20:23:17 -05:00
David Edelsohn
5faf712039 aix: packed struct alignment [PR102068]
Further fixes to structure alignment when the structure is packed
and contains double.  This patch checks for packed attribute
at the top level.

gcc/ChangeLog:

	PR target/102068
	* config/rs6000/rs6000.c (rs6000_adjust_field_align): Use
	computed alignment if the entire struct has attribute packed.
2021-08-26 21:19:22 -04:00
liuhongt
0fa4787bf3 Fold more shuffle builtins to VEC_PERM_EXPR.
A follow-up to https://gcc.gnu.org/pipermail/gcc-patches/2019-May/521983.html

gcc/
	PR target/98167
	PR target/43147
	* config/i386/i386.c (ix86_gimple_fold_builtin): Fold
	IX86_BUILTIN_SHUFPD512, IX86_BUILTIN_SHUFPS512,
	IX86_BUILTIN_SHUFPD256, IX86_BUILTIN_SHUFPS,
	IX86_BUILTIN_SHUFPS256.
	(ix86_masked_all_ones): New function.

gcc/testsuite/
	* gcc.target/i386/avx512f-vshufpd-1.c: Adjust testcase.
	* gcc.target/i386/avx512f-vshufps-1.c: Adjust testcase.
	* gcc.target/i386/pr43147.c: New test.
2021-08-27 08:50:49 +08:00
GCC Administrator
ccc1914543 Daily bump. 2021-08-27 00:16:22 +00:00
Jonathan Wakely
3a32a8ad7c libstdc:: Use markdown for Doxygen comments in std::function
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/bits/std_function.h (function): Adjust doxygen
	comments.
	* include/bits/unique_ptr.h (make_unique_for_overwrite):
	Change parameter name to match doxygen comment.
2021-08-27 00:12:54 +01:00
Jonathan Wakely
d38d26be33 libstdc++: Avoid a move in std::function construction (LWG 2447)
This makes the std::function constructor use perfect forwarding, to
avoid an unnecessary move-construction of the target. This means we need
to rewrite the _Function_base::_Base_manager::_M_init_functor function
to use a forwarding reference, and so can reuse it for the clone
operation.

Also simplify the SFINAE constraints on the constructor, by combining
the !is_same_v<remove_cvref_t<F>, function> constraint into the
_Callable trait.

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

libstdc++-v3/ChangeLog:

	* include/bits/std_function.h (_function_base::_Base_manager):
	Replace _M_init_functor with a function template using a
	forwarding reference, and a pair of _M_create function
	templates. Reuse _M_create for the clone operation.
	(function::_Decay_t): New alias template.
	(function::_Callable): Simplify by using _Decay.
	(function::function(F)): Change parameter to forwarding
	reference, as per LWG 2447. Add noexcept-specifier. Simplify
	constraints.
	(function::operator=(F&&)): Add noexcept-specifier.
	* testsuite/20_util/function/cons/lwg2774.cc: New test.
	* testsuite/20_util/function/cons/noexcept.cc: New test.
2021-08-27 00:12:54 +01:00
Jonathan Wakely
8cf428bfd3 libstdc++: Add static assertions for std::function requirements
Add static assertions to std::function, so that more user-friendly
diagnostics are given when trying to store a non-copyable target object.

These preconditions were added as "Mandates:" by LWG 2447, but I'm
committing them separately from implementing that, to allow just this
change to be backported more easily.

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

libstdc++-v3/ChangeLog:

	* include/bits/std_function.h (function::function(F)): Add
	static assertions to check constructibility requirements.
2021-08-27 00:12:54 +01:00
David Edelsohn
5889e842ae rs6000: inline ldouble __gcc_qsub
While performing some tests of IEEE 128 float for PPC64LE, Michael
Meissner noticed that __gcc_qsub is substantially slower than
__gcc_qadd.  __gcc_qsub calls __gcc_add with the second operand
negated.  Because the functions normally are invoked through
libgcc shared object, the extra PLT overhead has a large impact
on the overall time of the function.  This patch converts
__gcc_qadd to a static inline function invoked by __gcc_qadd
and __gcc_qsub.

libgcc/ChangeLog:

	* config/rs6000/ibm-ldouble.c (ldouble_qadd_internal): Rename from
	__gcc_qadd.
	(__gcc_qadd): Call ldouble_qadd_internal.
	(__gcc_qsub): Call ldouble_qadd_internal with second long double
	argument negated.
2021-08-26 19:13:39 -04:00
Uros Bizjak
5a6c626710 [i386] Call force_reg unconditionally.
There is no point to check RTXes before calling force_reg,
force_reg checks for REG RTX by itself.

2021-08-26  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	* config/i386/i386.md (*btr<mode>_1): Call force_reg unconditionally.
	(conditional moves with memory inputs splitters): Ditto.
	* config/i386/sse.md (one_cmpl<mode>2): Simplify.
2021-08-26 22:09:20 +02:00
Jan Hubicka
352d5e85a7 Fix ipa-modref verification ices
* ipa-modref-tree.h (modref_access_node::try_merge_with): Restart
	search after merging.
2021-08-26 21:37:46 +02:00
Bill Schmidt
e2693a7270 rs6000: Add remaining overloads
2021-08-26  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000-overload.def: Add remaining overloads.
2021-08-26 14:34:00 -05:00
Bill Schmidt
a7f13a5199 rs6000: Add Cell builtins
2021-06-07  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000-builtin-new.def: Add cell stanza.
2021-08-26 14:31:19 -05:00