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.
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.
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.
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.
gcc/d/ChangeLog:
* typeinfo.cc (TypeInfoVisitor::visit(TypeInfoClassDeclaration *)):
Use int to store type flags.
(TypeInfoVisitor::visit(TypeInfoStructDeclaration *)): Likewise.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.