Commit Graph

185337 Commits

Author SHA1 Message Date
GCC Administrator
6e503ac734 Daily bump. 2021-08-28 00:18:31 +00:00
konglin1
b186040b46 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:22:05 +08:00
GCC Administrator
b72708f59b Daily bump. 2021-08-27 00:18:01 +00:00
Harald Anlauf
65ff948e6f Fortran: fix pointless warning for static variables
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)
2021-08-26 20:41:45 +02:00
GCC Administrator
cb8593a3f2 Daily bump. 2021-08-26 00:18:46 +00:00
Bernd Edlinger
2e7a0f49bc diagnostics: Fix sporadic test failure
it turns out to be reproducible this way:

COLUMNS=80 make check-gcc-c RUNTESTFLAGS="plugin.exp=diagnostic*"

Running /home/ed/gnu/gcc-trunk/gcc/testsuite/gcc.dg/plugin/plugin.exp ...
FAIL: gcc.dg/plugin/diagnostic-test-expressions-1.c
 -fplugin=./diagnostic_plugin_test_tree_expression_range.so  1 blank line(s) in output
FAIL: gcc.dg/plugin/diagnostic-test-expressions-1.c
 -fplugin=./diagnostic_plugin_test_tree_expression_range.so  expected multiline pattern lines 550-551 not found: "                            __builtin_types_compatible_p \(long, int\) \+ f \(i\)\);.*\n                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\^~~~~~~\n"
FAIL: gcc.dg/plugin/diagnostic-test-expressions-1.c
 -fplugin=./diagnostic_plugin_test_tree_expression_range.so (test for excess errors)

a lot more errors happen with COLUMNS=20.

2021-05-29  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* gcc.dg/plugin/diagnostic_plugin_show_trees.c (plugin_init): Fix caret_max_with.
	* gcc.dg/plugin/diagnostic_plugin_test_inlining.c
	(plugin_init): Likewise.
	* gcc.dg/plugin/diagnostic_plugin_test_paths.c (plugin_init): Likewise.
	* gcc.dg/plugin/diagnostic_plugin_test_string_literals.c
	(plugin_init): Likewise.
	* gcc.dg/plugin/diagnostic_plugin_test_tree_expression_range.c
	(plugin_init): Likewise.

(cherry picked from commit ade5ac7c79)
2021-08-25 16:06:00 -07:00
H.J. Lu
918332d17c <x86gprintrin.h>: Add pragma GCC target("general-regs-only")
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)
2021-08-25 05:18:53 -07:00
H.J. Lu
bbd6fcde4e x86: Enable the GPR only instructions for -mgeneral-regs-only
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)
2021-08-25 05:18:53 -07:00
H.J. Lu
7dc952f1c0 x86: Remove OPTION_MASK_ISA_SSE4_2 from CRC32 _builtin functions
Since

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

    x86: Use crc32 target option for CRC32 intrinsics

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

gcc/

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

gcc/testsuite/

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

(cherry picked from commit 7aa28dbc37)
2021-08-25 05:18:53 -07:00
H.J. Lu
5684ef05b2 x86: Use crc32 target option for CRC32 intrinsics
Use crc32 target option for CRC32 intrinsics to support CRC32 intrinsics
without enabling SSE vector instructions.

	* config/i386/i386-c.c (ix86_target_macros_internal): Define
	__CRC32__ for -mcrc32.
	* config/i386/i386-options.c (ix86_option_override_internal):
	Enable crc32 instruction for -msse4.2.
	* config/i386/i386.md (sse4_2_crc32<mode>): Remove TARGET_SSE4_2
	check.
	(sse4_2_crc32di): Likewise.
	* config/i386/ia32intrin.h: Use crc32 target option for CRC32
	intrinsics.

(cherry picked from commit 39671f87b2)
2021-08-25 05:18:53 -07:00
H.J. Lu
8621acaa87 x86: Add -mmwait for -mgeneral-regs-only
Add -mmwait so that the MWAIT and MONITOR intrinsics can be used with
-mgeneral-regs-only and make -msse3 to imply -mmwait.

gcc/

	* config.gcc: Install mwaitintrin.h for i[34567]86-*-* and
	x86_64-*-* targets.
	* lto-streamer.h (LTO_minor_version): Bump.
	* common/config/i386/i386-common.c (OPTION_MASK_ISA2_MWAIT_SET):
	New.
	(OPTION_MASK_ISA2_MWAIT_UNSET): Likewise.
	(ix86_handle_option): Handle -mmwait.
	* config/i386/i386-builtins.c (ix86_init_mmx_sse_builtins):
	Replace OPTION_MASK_ISA_SSE3 with OPTION_MASK_ISA2_MWAIT on
	__builtin_ia32_monitor and __builtin_ia32_mwait.
	* config/i386/i386-options.c (isa2_opts): Add -mmwait.
	(ix86_valid_target_attribute_inner_p): Likewise.
	(ix86_option_override_internal): Enable mwait/monitor
	instructions for -msse3.
	* config/i386/i386.h (TARGET_MWAIT): New.
	(TARGET_MWAIT_P): Likewise.
	* config/i386/i386.opt: Add -mmwait.
	* config/i386/mwaitintrin.h: New file.
	* config/i386/pmmintrin.h: Include <mwaitintrin.h>.
	* config/i386/sse.md (sse3_mwait): Replace TARGET_SSE3 with
	TARGET_MWAIT.
	(@sse3_monitor_<mode>): Likewise.
	* config/i386/x86gprintrin.h: Include <mwaitintrin.h>.
	* doc/extend.texi: Document mwait target attribute.
	* doc/invoke.texi: Document -mmwait.

gcc/testsuite/

	* gcc.target/i386/monitor-2.c: New test.

(cherry picked from commit d8c6cc2ca3)
2021-08-25 05:18:53 -07:00
konglin1
6604b33651 i386: Fix _mm512_fpclass_ps_mask in O0 [PR 101471]
gcc/ChangeLog:

	PR target/101471
	* config/i386/avx512dqintrin.h (_mm512_fpclass_ps_mask): Fix
	macro define in O0.
	(_mm512_mask_fpclass_ps_mask): Ditto.

gcc/testsuite/ChangeLog:

	PR target/101471
	* gcc.target/i386/avx512f-pr101471.c: New test.
2021-08-25 15:15:04 +08:00
GCC Administrator
26eb90ba36 Daily bump. 2021-08-25 00:18:39 +00:00
Jonathan Wakely
8334ee1922 libstdc++: Don't check always-true condition [PR101965]
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	PR libstdc++/101965
	* include/std/charconv (__to_chars_i): Remove redundant check.

(cherry picked from commit 85a7095950)
2021-08-24 15:19:14 +01:00
Jonathan Wakely
3fbc38f35f libstdc++: Test std::seed_seq construction from input iterators
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)
2021-08-24 15:18:49 +01:00
Jonathan Wakely
743df0fa0d libstdc++: Restore __gnu_debug::array [PR100682]
As the PR points out, we removed the debug version of std::array without
any period of deprecation. Although std::array contains all the actual
debug checks now, removing the <debug/arrray> header breaks any code
that was using that explicitly. The manual still lists doing that as
supported.

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

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

libstdc++-v3/ChangeLog:

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

(cherry picked from commit 254e5d19a1)
2021-08-24 15:16:51 +01:00
Jonathan Wakely
0e19dc8582 libstdc++: Only define basic_string::contains for C++23
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)
2021-08-24 15:16:13 +01:00
Jonathan Wakely
60de2b5874 libstdc++: Add missing headers for errno and std::terminate
libstdc++-v3/ChangeLog:

	* include/bits/semaphore_base.h: Include <exception> and <errno.h>.

(cherry picked from commit a38b1a59f8)
2021-08-24 15:13:18 +01:00
Jonathan Wakely
88caed8772 libstdc++: Implement LWG 3422 for std::seed_seq
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)
2021-08-24 15:13:18 +01:00
Jonathan Wakely
f9325e99bb libstdc++: Use <sys/socket.h> features conditionally [PR 100285]
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)
2021-08-24 15:13:18 +01:00
Jonathan Wakely
2cf1aae145 libstdc++: Define effective-target for net::ip features [PR 100351]
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)
2021-08-24 15:13:17 +01:00
Jonathan Wakely
d1bdd54b03 libstdc++: Minor refactoring in <experimental/internet>
libstdc++-v3/ChangeLog:

	* include/experimental/internet (address_v6::bytes_type): Adjust
	formatting.
	(basic_endpoint): Define _M_is_v6() to put all checks for
	AF_INET6 in one place.
	(basic_endpoint::resize): Simplify.
	(operator==(const tcp&, const tcp&)): Add constexpr and noexcept.
	(operator!=(const tcp&, const tcp&)): Likewise.
	(operator==(const udp&, const udp&)): Likewise.
	(operator!=(const udp&, const udp&)): Likewise.
	* testsuite/experimental/net/internet/tcp.cc: New test.
	* testsuite/experimental/net/internet/udp.cc: New test.

(cherry picked from commit 39073938b4)
2021-08-24 15:13:17 +01:00
Jonathan Wakely
a42b4a9df3 libstdc++: Better preprocessor conditions in net::ip [PR 100286]
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)
2021-08-24 15:13:17 +01:00
Jonathan Wakely
fb7ca13de4 libstdc++: Define net::socket_base::message_flags operators as friends [PR 100285]
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)
2021-08-24 15:13:17 +01:00
Jonathan Wakely
fc5325158f libstdc++: Fix internet socket option classes
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)
2021-08-24 15:13:17 +01:00
Jonathan Wakely
91e84187e4 libstdc++: Fix socket option classes
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)
2021-08-24 15:13:17 +01:00
Jonathan Wakely
edcf1b0de4 libstdc++: Simplify definition of net::ip::resolver_base constants
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)
2021-08-24 15:13:16 +01:00
Jonathan Wakely
530a8f5c82 libstdc++: Allow net::io_context to compile without <poll.h> [PR 100180]
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)
2021-08-24 15:13:16 +01:00
Jonathan Wakely
8140362761 libstdc++: Clarify argument to net::io_context::async_wait
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)
2021-08-24 15:13:16 +01:00
Jonathan Wakely
576ec38045 libstdc++: Simplify definition of net::socket_base constants
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)
2021-08-24 15:13:13 +01:00
Richard Earnshaw
41ccd2b324 arm: Add tests for VLLDM mitigation [PR102035]
New tests for the erratum mitigation.

gcc/testsuite:
	PR target/102035
	* gcc.target/arm/cmse/mainline/8_1m/soft/cmse-13a.c: New test.
	* gcc.target/arm/cmse/mainline/8_1m/soft/cmse-7a.c: Likewise.
	* gcc.target/arm/cmse/mainline/8_1m/soft/cmse-8a.c: Likewise.
	* gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-7a.c: Likewise.
	* gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-8a.c: Likewise.
	* gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-13a.c: Likewise.
	* gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-7a.c: Likewise.
	* gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-8a.c: Likewise.

(cherry picked from commit 809330ab84)
2021-08-24 14:25:51 +01:00
Richard Earnshaw
8933c1b66a arm: fix vlldm erratum for Armv8.1-m [PR102035]
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)
2021-08-24 14:25:51 +01:00
Richard Earnshaw
2539763c89 arm: add erratum mitigation to __gnu_cmse_nonsecure_call [PR102035]
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)
2021-08-24 14:25:51 +01:00
Richard Earnshaw
80e7c46384 arm: Add command-line option for enabling CVE-2021-35465 mitigation [PR102035]
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)
2021-08-24 14:25:51 +01:00
Richard Earnshaw
e5b56e8058 arm: testsuite: improve detection of CMSE hardware.
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)
2021-08-24 14:25:51 +01:00
Richard Earnshaw
931d1c208a arm: Fix general issues with patterns for VLLDM and VLSTM
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)
2021-08-24 14:25:50 +01:00
Jan Hubicka
e527b92b18 Fix previous ipa-modref patch
gcc/ChangeLog:

	PR middle-end/101949
	* ipa-modref.c (analyze_ssa_name_flags): Fix merging of
	EAF_NOCLOBBER

(cherry picked from commit 5bd4ab9166)
2021-08-24 10:24:48 +02:00
Jan Hubicka
d0adc557a2 Clear EAF_NOCLOBBER for indirect calls
gcc/ChangeLog:

2021-08-22  Jan Hubicka  <hubicka@ucw.cz>
	    Martin Liska  <mliska@suse.cz>

	PR middle-end/101949
	* ipa-modref.c (analyze_ssa_name_flags): Indirect call implies
	~EAF_NOCLOBBER.

gcc/testsuite/ChangeLog:

2021-08-22  Jan Hubicka  <hubicka@ucw.cz>
	    Martin Liska  <mliska@suse.cz>

	* gcc.dg/lto/pr101949_0.c: New test.
	* gcc.dg/lto/pr101949_1.c: New test.

(cherry picked from commit 9b08f7764c)
2021-08-24 10:24:47 +02:00
Richard Biener
5bc33f0318 ipa/97565 - fix IPA PTA body availability check
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)
2021-08-24 08:44:41 +02:00
GCC Administrator
c62cf32d05 Daily bump. 2021-08-24 00:18:52 +00:00
Jonathan Wakely
f918470940 libstdc++: Add default template argument to basic_istream_view
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)
2021-08-23 17:02:53 +01:00
Christophe Lyon
05dbde3bfb arm: Fix __arm_vctp16q return type in arm_mve.h
__arm_vctp16q actually returns mve_pred16_t rather than int64_t.

2021-08-23  Christophe Lyon  <christophe.lyon@foss.st.com>

	gcc/
	* config/arm/arm_mve.h: Fix __arm_vctp16q return type.

(cherry picked from commit ac3bcc813f)
2021-08-23 11:40:30 +00:00
Jakub Jelinek
513c543bb5 dwarf2out: Emit DW_AT_location for global register vars during early dwarf [PR101905]
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)
2021-08-23 11:55:42 +02:00
Martin Liska
f7134a12cd gcov: fix output location for JSON mode.
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)
2021-08-23 10:54:46 +02:00
GCC Administrator
0597b6e259 Daily bump. 2021-08-23 00:18:05 +00:00
GCC Administrator
d056e29c7f Daily bump. 2021-08-22 00:18:16 +00:00
GCC Administrator
2e90914b79 Daily bump. 2021-08-21 00:18:05 +00:00
GCC Administrator
ffd2d701ad Daily bump. 2021-08-20 00:18:08 +00:00
Jonathan Wakely
46a1acba89 libstdc++: Move status table entry to be with other ranges papers
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* doc/xml/manual/status_cxx2020.xml: Move row  earlier in table.
	* doc/html/manual/status.html: Regenerate.

(cherry picked from commit c5e0f954ae)
2021-08-19 15:06:47 +01:00
Jonathan Wakely
31433e154f libstdc++: Document P1739R4 status [PR100139]
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)
2021-08-19 14:59:14 +01:00