gcc/fortran/ChangeLog:
PR fortran/98411
* trans-decl.c (gfc_finish_var_decl): Adjust check to handle
implicit SAVE as well as variables in the main program. Improve
warning message text.
gcc/testsuite/ChangeLog:
PR fortran/98411
* gfortran.dg/pr98411.f90: Adjust testcase options to restrict to
F2008, and verify case of implicit SAVE.
(cherry picked from commit f95946afd1)
1. Intrinsics in <x86gprintrin.h> only require GPR ISAs. Add
#if defined __MMX__ || defined __SSE__
#pragma GCC push_options
#pragma GCC target("general-regs-only")
#define __DISABLE_GENERAL_REGS_ONLY__
#endif
and
#ifdef __DISABLE_GENERAL_REGS_ONLY__
#undef __DISABLE_GENERAL_REGS_ONLY__
#pragma GCC pop_options
#endif /* __DISABLE_GENERAL_REGS_ONLY__ */
to <x86gprintrin.h> to disable non-GPR ISAs so that they can be used in
functions with __attribute__ ((target("general-regs-only"))).
2. When checking always_inline attribute, if callee only uses GPRs,
ignore MASK_80387 since enable MASK_80387 in caller has no impact on
callee inline.
gcc/
PR target/99744
* config/i386/i386.c (ix86_can_inline_p): Ignore MASK_80387 if
callee only uses GPRs.
* config/i386/ia32intrin.h: Revert commit 5463cee277.
* config/i386/serializeintrin.h: Revert commit 71958f740f.
* config/i386/x86gprintrin.h: Add
#pragma GCC target("general-regs-only") and #pragma GCC pop_options
to disable non-GPR ISAs.
gcc/testsuite/
PR target/99744
* gcc.target/i386/pr99744-3.c: New test.
* gcc.target/i386/pr99744-4.c: Likewise.
* gcc.target/i386/pr99744-5.c: Likewise.
* gcc.target/i386/pr99744-6.c: Likewise.
* gcc.target/i386/pr99744-7.c: Likewise.
* gcc.target/i386/pr99744-8.c: Likewise.
(cherry picked from commit 72264a6397)
For -mgeneral-regs-only, enable the GPR only instructions which are
enabled implicitly by SSE ISAs unless they have been disabled explicitly.
gcc/
PR target/101492
* common/config/i386/i386-common.c (ix86_handle_option): For
-mgeneral-regs-only, enable the GPR only instructions which are
enabled implicitly by SSE ISAs unless they have been disabled
explicitly.
gcc/testsuite/
PR target/101492
* gcc.target/i386/pr101492-1.c: New test.
* gcc.target/i386/pr101492-2.c: Likewise.
* gcc.target/i386/pr101492-3.c: Likewise.
* gcc.target/i386/pr101492-4.c: Likewise.
(cherry picked from commit 6ae8aac19c)
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
* testsuite/26_numerics/random/seed_seq/cons/range.cc: Check
construction from input iterators.
(cherry picked from commit 20698ec5b6)
As the PR points out, we removed the debug version of std::array without
any period of deprecation. Although std::array contains all the actual
debug checks now, removing the <debug/arrray> header breaks any code
that was using that explicitly. The manual still lists doing that as
supported.
This restores the <debug/array> header, but simply defines
__gnu_debug::array as an alias for std::array, and declares the alias
with the deprecated attribute. The docs are updated to match.
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
PR libstdc++/100682
* doc/xml/manual/debug_mode.xml: Update documentation about
debug capability of std::array.
* doc/html/*: Regenerate.
* include/debug/array: New file.
(cherry picked from commit 254e5d19a1)
The new contains member of the COW string is defined for non-strict
gnu++20 mode as well as for C++23 modes. I think that was left in the
committed patch unintentionally. It is inconsistent with the SSO string,
and doesn't actually compile because it uses the
basic_string_view::contains member which only defined for C++23.
This makes it only defined for C++23.
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
* include/bits/basic_string.h (basic_string::contains): Do not
define for -std=gnu++20.
(cherry picked from commit 3b3f2f7c26)
This ensures that the std::seed_seq initializer-list constructor will
not be used for list-initialization unless the initializers in the list
are integers. This allows list-initialization syntax to be used with a
pair of pointers and for that to use the appropriate constructor.
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
* include/bits/random.h (seed_seq): Constrain initializer-list
constructor.
* include/bits/random.tcc (seed_seq): Add template parameter.
* testsuite/26_numerics/random/seed_seq/cons/default.cc: Check
for noexcept.
* testsuite/26_numerics/random/seed_seq/cons/initlist.cc: Check
constraints.
(cherry picked from commit 6c63cb231e)
This makes the uses of getsockopt and setsockopt in
<experimental/socket> conditional on the availability of <sys/socket.h>.
It also fixes a test to check for <sys/socket.h> instead of <socket.h>.
libstdc++-v3/ChangeLog:
PR libstdc++/100285
* include/experimental/socket (__basic_socket_impl::set_option)
(__basic_socket_impl::get_option) [!_GLIBCXX_HAVE_SYS_SOCKET_H]:
Just set error code.
* testsuite/experimental/net/socket/socket_base.cc: CHeck
for <sys/socket.h> not <socket.h>.
(cherry picked from commit 0d501c3385)
Define a new effective-target keyword so that tests for the Networking
TS <experimental/internet> header can be skipped on targets where none
of it can be usefully defined.
libstdc++-v3/ChangeLog:
PR libstdc++/100180
PR libstdc++/100286
PR libstdc++/100351
* testsuite/experimental/net/internet/address/v4/comparisons.cc:
Use new effective-target keyword.
* testsuite/experimental/net/internet/address/v4/cons.cc:
Likewise.
* testsuite/experimental/net/internet/address/v4/creation.cc:
Likewise.
* testsuite/experimental/net/internet/address/v4/members.cc:
Likewise.
* testsuite/experimental/net/internet/address/v6/members.cc:
Likewise.
* testsuite/experimental/net/internet/resolver/base.cc:
Likewise.
* testsuite/experimental/net/internet/resolver/ops/lookup.cc:
Likewise.
* testsuite/experimental/net/internet/resolver/ops/reverse.cc:
Likewise.
* testsuite/experimental/net/internet/socket/opt.cc:
Likewise.
* testsuite/experimental/net/internet/tcp.cc:
Likewise.
* testsuite/experimental/net/internet/udp.cc:
Likewise.
* testsuite/lib/libstdc++.exp (check_effective_target_net_ts_ip):
New proc to check net_ts_ip et.
(cherry picked from commit 57028ff2d3)
This improves the use of preprocessor conditionas to enable/disable
members of namespace net::ip according to what is supported by the
target. This fixes PR 100286 by ensuring that the to_string member
functions are always defined for the address_v4 and address_v6 classes.
On the other hand, the IP protocol classes and internet socket option
classes aren't useful at all if the corresponding constants (such as
IPPROTO_TCP or IPV6_MULTICAST_HOPS) aren't define. So those types are
not defined at all if they can't be used.
The net/internet/socket/opt.cc test uses __has_include to check whether
or not to expect the types to be available.
libstdc++-v3/ChangeLog:
PR libstdc++/100286
* include/experimental/internet (resolver_errc, resolver_category())
(make_error_code, make_error_condition): Define unconditionally,
only make enumerators and use of gai_strerror depend on the
availability of <netdb.h>.
(address_v4::to_string): Use correct constant for string length.
(address_v4::to_string, address_v6::to_string): Define
unconditionally, throw if unsupported.
(make_address_v4, make_address_v6): Define unconditionally.
Return an error if unsupported.
(tcp, udp, v6_only, unicast::hops, multicast::*): Define
conditionally,
* testsuite/experimental/net/internet/socket/opt.cc: Check for
<netinet/in.h> and <netinet/tcp.h> before using types from
namespace net::ip.
(cherry picked from commit 9ee35a8685)
The overloaded operators for socket_base::message_flags should only be
defined when the message_flags type itself is defined. Rather than
duplicate the preprocessor conditional, this moves the operators into
the same scope as the type, defining them as hidden friends.
As well as fixing the bug, this has all the usual advantages of hidden
friends (they are not visible to normal name lookup for unrelated
types).
For consistency, do the same for the resolver_base::flags bitmask
operators too.
libstdc++-v3/ChangeLog:
PR libstdc++/100285
* include/experimental/internet (resolver_base::flags):
Define overloaded operators as hidden friends.
* include/experimental/socket (socket_base::message_flags):
Likewise.
(cherry picked from commit 8aadb4fedb)
Similar to the previous commit, this fixes various problems with the
socket options classes in the <internet> header:
- The constructors were not noexcept.
- The __sockopt_base<T>::value() member function was present
unconditionally (so was defined for socket_base::linger which is
incorrect).
- The __socket_crtp<C, T>::operator=(T) assignment operator was not
noexcept, and was hidden in the derived classes.
- The MulticastSocketOptions incorrectly used a union, incorrectly
defined resize and const data() member functions, and their
constructors were unimplemented.
Also, where appropriate:
- Use class instead of struct for the socket option types.
- Define the _S_level and _S_name constants as private.
- Declare the __socket_crtp base as a friend.
libstdc++-v3/ChangeLog:
* include/experimental/internet (tcp::no_delay, v6_only)
(unicast::hops, multicast::hops, multicast::enable_loopback):
Change access of base class and static data members. Add
using-declaration for __socket_crtp::operator=(_Tp).
(multicast::__mcastopt): New type.
(multicast::join_group, multicast::leave_group): Derive from
__mcastopt for common implementation.
* include/experimental/socket: Add comment.
* testsuite/experimental/net/internet/socket/opt.cc: New test.
* testsuite/experimental/net/socket/socket_base.cc: Check for
protected constructor/destructor of socket_base. Check for
explicit constructors of socket option classes.
(cherry picked from commit 2e0b1c6ce3)
This fixes some flaws in the socket option types defined in
net::socket_base:
- The constructors were not noexcept.
- The __sockopt_base<T>::value() member function was present
unconditionally (so was defined for socket_base::linger which is
incorrect).
- The __socket_crtp<C, T>::operator=(T) assignment operator was not
noexcept, and was hidden in the derived classes.
Also:
- Use class instead of struct for the socket option types.
- Define the _S_level and _S_name constants as private.
- Declare the __socket_crtp base as a friend.
libstdc++-v3/ChangeLog:
* include/experimental/bits/net.h (__socket_base): Add
bool template parameter to allow BooleanSocketOption and
IntegerSocketOption to have different __socket_base<int>
base classes.
(__socket_base<bool>): Adjust base class.
(__socket_base<int>): Add partial specialization.
(__socket_crtp::operator=(_Tp)): Add noexcept-specifier.
* include/experimental/socket (socket_base::broadcast)
(socket_base::debug, socket_base::do_not_route)
(socket_base::keep_alive, socket_base::linger)
(socket_base::out_of_band_inline)
(socket_base::receive_buffer_size)
(socket_base::receive_low_watermark)
(socket_base::reuse_address, socket_base::send_buffer_size)
(socket_base::send_low_watermark): Add using-declaration for
__socket_crtp::operator=(_Tp).
* testsuite/experimental/net/socket/socket_base.cc: Check
properties of socket option types.
(cherry picked from commit 06c86a4f21)
libstdc++-v3/ChangeLog:
* include/experimental/internet (resolver_base::flags): Remove
enumerators. Initialize constants directly with desired values.
Make all operators constexpr and noexcept.
* testsuite/experimental/net/internet/resolver/base.cc: Use
__gnu_test::test_bitmask_values for bitmask type. Check
construction and destruction is protected.
(cherry picked from commit 49adc06672)
This adds dummy placeholders to net::io_context so that it can still be
compiled on targets without <poll.h>.
libstdc++-v3/ChangeLog:
PR libstdc++/100180
* include/experimental/io_context (io_context): Define
dummy_pollfd type so that most member functions still compile
without <poll.h> and struct pollfd.
(cherry picked from commit 0e1e7b7790)
Add a comment documenting the __w parameter of the private
ios_context::async_wait function. Add casts to callers, making the
conversions explicit.
libstdc++-v3/ChangeLog:
* include/experimental/io_context (io_context::async_wait): Add
comment.
* include/experimental/socket (basic_socket::async_connect):
Cast wait_type constant to int.
(basic_datagram_socket::async_receive): Likewise.
(basic_datagram_socket::async_receive_from): Likewise.
(basic_datagram_socket::async_send): Likewise.
(basic_datagram_socket::async_send_to): Likewise.
(basic_stream_socket::async_receive): Likewise.
(basic_stream_socket::async_send): Likewise. Use io_context
parameter directly, instead of via an executor.
(basic_socket_acceptor::async_accept): Likewise.
(cherry picked from commit 3517dfe05c)
libstdc++-v3/ChangeLog:
* include/experimental/socket (socket_base::shutdown_type):
(socket_base::wait_type, socket_base::message_flags):
Remove enumerators. Initialize constants directly with desired
values.
(socket_base::message_flags): Make all operators constexpr and
noexcept.
* testsuite/util/testsuite_common_types.h (test_bitmask_values):
New test utility.
* testsuite/experimental/net/socket/socket_base.cc: New test.
(cherry picked from commit a752a43073)
For Armv8.1-m we generate code that emits VLLDM directly and do not
rely on support code in the library, so emit the mitigation directly
as well, when required. In this case, we can use the compiler options
to determine when to apply the fix and when it is safe to omit it.
gcc:
PR target/102035
* config/arm/arm.md (attribute arch): Add fix_vlldm.
(arch_enabled): Use it.
* config/arm/vfp.md (lazy_store_multiple_insn): Add alternative to
use when erratum mitigation is needed.
(cherry picked from commit 30461cf8db)
Add the recommended erratum mitigation sequence to
__gnu_cmse_nonsecure_call for use on Armv8-m.main devices. Since this
is in the library code we cannot know in advance whether the core we
are running on will be affected by this, so always enable it.
libgcc:
PR target/102035
* config/arm/cmse_nonsecure_call.S (__gnu_cmse_nonsecure_call):
Add vlldm erratum work-around.
(cherry picked from commit 574e7950bd)
Add a new option, -mfix-cmse-cve-2021-35465 and document it. Enable it
automatically for cortex-m33, cortex-m35p and cortex-m55.
gcc:
PR target/102035
* config/arm/arm.opt (mfix-cmse-cve-2021-35465): New option.
* doc/invoke.texi (Arm Options): Document it.
* config/arm/arm-cpus.in (quirk_vlldm): New feature bit.
(ALL_QUIRKS): Add quirk_vlldm.
(cortex-m33): Add quirk_vlldm.
(cortex-m35p, cortex-m55): Likewise.
* config/arm/arm.c (arm_option_override): Enable fix_vlldm if
targetting an affected CPU and not explicitly controlled on
the command line.
(cherry picked from commit 3929bca9ca)
The test for CMSE support being available in hardware currently
relies on the compiler not optimizing away a secure gateway operation.
But even that is suspect, because the SG instruction is just a NOP
on armv8-m implementations that do not support the security extension.
Replace the existing test with a new one that reads and checks
the appropriate hardware feature register (memory mapped). This has
to be run from secure mode, but that shouldn't matter, because if we
can't do that we can't really test the CMSE extensions anyway. We
retain the SG instruction to ensure the test can't pass accidentally
if run on pre-armv8-m devices.
gcc/testsuite:
* lib/target-supports.exp (check_effective_target_arm_cmse_hw):
New function.
(cherry picked from commit 79fb2700bd)
Both lazy_store_multiple_insn and lazy_load_multiple_insn contain
invalid RTL (eg they contain a post_inc statement outside of a mem).
What's more, the instructions concerned do not modify their input
address register. We probably got away with this because they are
generated so late in the compilation that no subsequent pass needed to
understand them. Nevertheless, this could cause problems someday, so
fixed to use a simple legal unspec.
gcc:
* config/arm/vfp.md (lazy_store_multiple_insn): Rewrite as valid RTL.
(lazy_load_multiple_insn): Likewise.
(cherry picked from commit 4702d3cf04)
Looks like the existing check using has_gimple_body_p isn't enough
at LTRANS time but I need to check in_other_partition as well.
2021-08-23 Richard Biener <rguenther@suse.de>
PR ipa/97565
* tree-ssa-structalias.c (ipa_pta_execute): Check in_other_partition
in addition to has_gimple_body.
* g++.dg/lto/pr97565_0.C: New testcase.
* g++.dg/lto/pr97565_1.C: Likewise.
(cherry picked from commit 0230e69a3f)
The standard shows this default template argument in the <ranges>
synopsis, but it was missing in libstdc++.
libstdc++-v3/ChangeLog:
* include/std/ranges (basic_istream_view): Add default template
argument.
* testsuite/std/ranges/istream_view.cc: Check it.
(cherry picked from commit 1a129376bb)
The following patch emits DW_AT_location for global register variables
already during early dwarf, since usually late_global_decl hook isn't even
called for those, as nothing needs to be emitted for them.
2021-08-23 Jakub Jelinek <jakub@redhat.com>
PR debug/101905
* dwarf2out.c (gen_variable_die): Add DW_AT_location for global
register variables already during early_dwarf if possible.
* gcc.dg/guality/pr101905.c: New test.
(cherry picked from commit b284053bb7)
PR gcov-profile/89961
gcc/ChangeLog:
* gcov.c (make_gcov_file_name): Rewrite using std::string.
(mangle_name): Simplify, do not used the second argument.
(strip_extention): New function.
(get_md5sum): Likewise.
(get_gcov_intermediate_filename): Handle properly -p and -x
options.
(output_gcov_file): Use string type.
(generate_results): Likewise.
(md5sum_to_hex): Remove.
(cherry picked from commit b777f228b4)
We should document the status of this unimplemented feature.
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
PR libstdc++/100139
* doc/xml/manual/status_cxx2020.xml: Add P1739R4 to status table.
* doc/html/manual/status.html: Regenerate.
(cherry picked from commit 926d4a71c7)