diff options
author | Martin Liska <mliska@suse.cz> | 2021-06-14 15:38:04 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2021-06-14 15:38:04 +0200 |
commit | 1775bce3a2c144c9a4dbea941298a14f01d2c6b3 (patch) | |
tree | b704d2d7f4c7a7fdf32c20eee3534cae0bfe4d61 | |
parent | c0f8bdc00d1b604f88bd1f4faa428dfa0bdca00d (diff) | |
parent | f389f2a03527de610d3dd1bae9b54a61419ac5d8 (diff) | |
download | gcc-1775bce3a2c144c9a4dbea941298a14f01d2c6b3.zip gcc-1775bce3a2c144c9a4dbea941298a14f01d2c6b3.tar.gz gcc-1775bce3a2c144c9a4dbea941298a14f01d2c6b3.tar.bz2 |
Merge branch 'master' into devel/sphinx
-rw-r--r-- | gcc/config.gcc | 44 | ||||
-rw-r--r-- | gcc/config/arc/arc.h | 4 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 4 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/sms-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/sms-10.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/sms-2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/sms-3.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/sms-4.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/sms-6.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/sms-8.c | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/std/tuple | 2 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/compare | 51 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc | 1 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc | 1 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/18_support/comparisons/algorithms/fallback.cc | 42 |
17 files changed, 118 insertions, 53 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc index 4dc4fe0..1be8d96 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -4260,18 +4260,52 @@ case "${target}" in ;; arc*-*-*) - supported_defaults="cpu" + supported_defaults="cpu fpu" + new_cpu=hs38_linux if [ x"$with_cpu" = x ] \ - || grep "^ARC_CPU ($with_cpu," \ - ${srcdir}/config/arc/arc-cpus.def \ - > /dev/null; then + || grep -q -E "^ARC_CPU[[:blank:]]*\($with_cpu," \ + ${srcdir}/config/arc/arc-cpus.def + then # Ok - true + new_cpu=$with_cpu else echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2 exit 1 fi + + # see if --with-fpu matches any of the supported FPUs + case "$with_fpu" in + "") + # OK + ;; + fpus | fpus_div | fpus_fma | fpus_all) + # OK if em or hs + flags_ok="[emhs]+" + ;; + fpuda | fpuda_div | fpuda_fma | fpuda_all) + # OK only em + flags_ok="em" + ;; + fpud | fpud_div | fpud_fma | fpud_all) + # OK only hs + flags_ok="hs" + ;; + *) + echo "Unknown floating point type used in "\ + "--with-fpu=$with_fpu" 1>&2 + exit 1 + ;; + esac + + if [ -n "$flags_ok" ] \ + && ! grep -q -E "^ARC_CPU[[:blank:]]*\($new_cpu,[[:blank:]]*$flags_ok," \ + ${srcdir}/config/arc/arc-cpus.def + then + echo "Unknown floating point type used in "\ + "--with-fpu=$with_fpu for cpu $new_cpu" 1>&2 + exit 1 + fi ;; csky-*-*) diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index 0224ae6..8cd6350 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -100,7 +100,11 @@ extern const char *arc_cpu_to_as (int argc, const char **argv); "%:cpu_to_as(%{mcpu=*:%*}) %{mspfp*} %{mdpfp*} " \ "%{mfpu=fpuda*:-mfpuda} %{mcode-density}" +/* Support for a compile-time default CPU and FPU. The rules are: + --with-cpu is ignored if -mcpu, mARC*, marc*, mA7, mA6 are specified. + --with-fpu is ignored if -mfpu is specified. */ #define OPTION_DEFAULT_SPECS \ + {"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}"}, \ {"cpu", "%{!mcpu=*:%{!mARC*:%{!marc*:%{!mA7:%{!mA6:-mcpu=%(VALUE)}}}}}" } #ifndef DRIVER_ENDIAN_SELF_SPECS diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 1c4fbf2..c4c3b42 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1139,8 +1139,8 @@ See RS/6000 and PowerPC Options. -mriscv-attribute -mmo-riscv-attribute @gol -malign-data=@var{type} @gol -mbig-endian -mlittle-endian @gol -+-mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol -+-mstack-protector-guard-offset=@var{offset}} +-mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol +-mstack-protector-guard-offset=@var{offset}} @emph{RL78 Options} @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=g14 -mallregs @gol diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index a37ad66..45c3ad3 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -5709,7 +5709,6 @@ resolve_variable (gfc_expr *e) part_ref. */ gfc_ref *ref = gfc_get_ref (); ref->type = REF_ARRAY; - ref->u.ar = *gfc_get_array_ref(); ref->u.ar.type = AR_FULL; if (sym->as) { diff --git a/gcc/testsuite/gcc.dg/sms-1.c b/gcc/testsuite/gcc.dg/sms-1.c index 26868c3..098e1aa 100644 --- a/gcc/testsuite/gcc.dg/sms-1.c +++ b/gcc/testsuite/gcc.dg/sms-1.c @@ -40,5 +40,3 @@ main () return 0; } -/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target powerpc*-*-* } } } */ - diff --git a/gcc/testsuite/gcc.dg/sms-10.c b/gcc/testsuite/gcc.dg/sms-10.c index d85e8e2..df3bba2 100644 --- a/gcc/testsuite/gcc.dg/sms-10.c +++ b/gcc/testsuite/gcc.dg/sms-10.c @@ -113,6 +113,3 @@ main () return 0; } - -/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target powerpc*-*-* } } } */ - diff --git a/gcc/testsuite/gcc.dg/sms-2.c b/gcc/testsuite/gcc.dg/sms-2.c index 7b96f55..f8375f9 100644 --- a/gcc/testsuite/gcc.dg/sms-2.c +++ b/gcc/testsuite/gcc.dg/sms-2.c @@ -31,5 +31,3 @@ fun (nb) sy = 0; } } - -/* { dg-final { scan-rtl-dump-times "SMS loop many exits" 1 "sms" { target powerpc*-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/sms-3.c b/gcc/testsuite/gcc.dg/sms-3.c index 822b516..5e56ecf 100644 --- a/gcc/testsuite/gcc.dg/sms-3.c +++ b/gcc/testsuite/gcc.dg/sms-3.c @@ -38,6 +38,3 @@ main () foo (6, 3); return 0; } - -/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target powerpc*-*-* } } } */ - diff --git a/gcc/testsuite/gcc.dg/sms-4.c b/gcc/testsuite/gcc.dg/sms-4.c index f5ebb55..8416b8b 100644 --- a/gcc/testsuite/gcc.dg/sms-4.c +++ b/gcc/testsuite/gcc.dg/sms-4.c @@ -34,6 +34,3 @@ main () foo (5, a, b, c, dst); return 0; } - -/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target powerpc*-*-* } } } */ - diff --git a/gcc/testsuite/gcc.dg/sms-6.c b/gcc/testsuite/gcc.dg/sms-6.c index e57e015..d6fa45a 100644 --- a/gcc/testsuite/gcc.dg/sms-6.c +++ b/gcc/testsuite/gcc.dg/sms-6.c @@ -41,5 +41,3 @@ int main() return 0; } - -/* { dg-final { scan-rtl-dump-times "SMS succeeded" 3 "sms" { target powerpc*-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/sms-8.c b/gcc/testsuite/gcc.dg/sms-8.c index 7ccaa45..dc0a3fc 100644 --- a/gcc/testsuite/gcc.dg/sms-8.c +++ b/gcc/testsuite/gcc.dg/sms-8.c @@ -34,7 +34,3 @@ main () res = foo (3, 4); return 0; } - -/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target powerpc*-*-* } } } */ - - diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 3b771c5..2d562f8 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -73,7 +73,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool = __empty_not_final<_Head>::value> struct _Head_base; -#if __has_cpp_attribute(no_unique_address) +#if __has_cpp_attribute(__no_unique_address__) template<size_t _Idx, typename _Head> struct _Head_base<_Idx, _Head, true> { diff --git a/libstdc++-v3/libsupc++/compare b/libstdc++-v3/libsupc++/compare index 82d0088..dd0ec5f 100644 --- a/libstdc++-v3/libsupc++/compare +++ b/libstdc++-v3/libsupc++/compare @@ -600,6 +600,9 @@ namespace std // FIXME: || floating_point<remove_reference_t<_Tp>> || __cmp3way<strong_ordering, _Tp, _Up>; + template<typename _Tp, typename _Up> + concept __decayed_same_as = same_as<decay_t<_Tp>, decay_t<_Up>>; + class _Strong_order { template<typename _Tp, typename _Up> @@ -620,14 +623,12 @@ namespace std friend class _Strong_fallback; public: - template<typename _Tp, typename _Up> + template<typename _Tp, __decayed_same_as<_Tp> _Up> requires __strongly_ordered<_Tp, _Up> constexpr strong_ordering operator()(_Tp&& __e, _Up&& __f) const noexcept(_S_noexcept<_Tp, _Up>()) { - static_assert(same_as<decay_t<_Tp>, decay_t<_Up>>); - /* FIXME: if constexpr (floating_point<decay_t<_Tp>>) return __cmp_cust::__fp_strong_order(__e, __f); @@ -669,14 +670,12 @@ namespace std friend class _Weak_fallback; public: - template<typename _Tp, typename _Up> + template<typename _Tp, __decayed_same_as<_Tp> _Up> requires __weakly_ordered<_Tp, _Up> constexpr weak_ordering operator()(_Tp&& __e, _Up&& __f) const noexcept(_S_noexcept<_Tp, _Up>()) { - static_assert(same_as<decay_t<_Tp>, decay_t<_Up>>); - if constexpr (floating_point<decay_t<_Tp>>) return __cmp_cust::__fp_weak_ordering(__e, __f); else if constexpr (__adl_weak<_Tp, _Up>) @@ -716,14 +715,12 @@ namespace std friend class _Partial_fallback; public: - template<typename _Tp, typename _Up> + template<typename _Tp, __decayed_same_as<_Tp> _Up> requires __partially_ordered<_Tp, _Up> constexpr partial_ordering operator()(_Tp&& __e, _Up&& __f) const noexcept(_S_noexcept<_Tp, _Up>()) { - static_assert(same_as<decay_t<_Tp>, decay_t<_Up>>); - if constexpr (__adl_partial<_Tp, _Up>) return partial_ordering(partial_order(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f))); @@ -759,18 +756,16 @@ namespace std } public: - template<typename _Tp, typename _Up> + template<typename _Tp, __decayed_same_as<_Tp> _Up> requires __strongly_ordered<_Tp, _Up> || __op_eq_lt<_Tp, _Up> - constexpr decltype(auto) + constexpr strong_ordering operator()(_Tp&& __e, _Up&& __f) const noexcept(_S_noexcept<_Tp, _Up>()) { - static_assert(same_as<decay_t<_Tp>, decay_t<_Up>>); - if constexpr (__strongly_ordered<_Tp, _Up>) return _Strong_order{}(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f)); - else if constexpr (__op_eq_lt<_Tp, _Up>) + else // __op_eq_lt<_Tp, _Up> return static_cast<_Tp&&>(__e) == static_cast<_Up&&>(__f) ? strong_ordering::equal : static_cast<_Tp&&>(__e) < static_cast<_Up&&>(__f) @@ -793,18 +788,16 @@ namespace std } public: - template<typename _Tp, typename _Up> + template<typename _Tp, __decayed_same_as<_Tp> _Up> requires __weakly_ordered<_Tp, _Up> || __op_eq_lt<_Tp, _Up> - constexpr decltype(auto) + constexpr weak_ordering operator()(_Tp&& __e, _Up&& __f) const noexcept(_S_noexcept<_Tp, _Up>()) { - static_assert(same_as<decay_t<_Tp>, decay_t<_Up>>); - if constexpr (__weakly_ordered<_Tp, _Up>) return _Weak_order{}(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f)); - else if constexpr (__op_eq_lt<_Tp, _Up>) + else // __op_eq_lt<_Tp, _Up> return static_cast<_Tp&&>(__e) == static_cast<_Up&&>(__f) ? weak_ordering::equivalent : static_cast<_Tp&&>(__e) < static_cast<_Up&&>(__f) @@ -813,6 +806,16 @@ namespace std } }; + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 3465. compare_partial_order_fallback requires F < E + template<typename _Tp, typename _Up> + concept __op_eq_lt_lt = __op_eq_lt<_Tp, _Up> + && requires(_Tp&& __t, _Up&& __u) + { + { static_cast<_Up&&>(__u) < static_cast<_Tp&&>(__t) } + -> convertible_to<bool>; + }; + class _Partial_fallback { template<typename _Tp, typename _Up> @@ -827,18 +830,16 @@ namespace std } public: - template<typename _Tp, typename _Up> - requires __partially_ordered<_Tp, _Up> || __op_eq_lt<_Tp, _Up> - constexpr decltype(auto) + template<typename _Tp, __decayed_same_as<_Tp> _Up> + requires __partially_ordered<_Tp, _Up> || __op_eq_lt_lt<_Tp, _Up> + constexpr partial_ordering operator()(_Tp&& __e, _Up&& __f) const noexcept(_S_noexcept<_Tp, _Up>()) { - static_assert(same_as<decay_t<_Tp>, decay_t<_Up>>); - if constexpr (__partially_ordered<_Tp, _Up>) return _Partial_order{}(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f)); - else if constexpr (__op_eq_lt<_Tp, _Up>) + else // __op_eq_lt_lt<_Tp, _Up> return static_cast<_Tp&&>(__e) == static_cast<_Up&&>(__f) ? partial_ordering::equivalent : static_cast<_Tp&&>(__e) < static_cast<_Up&&>(__f) diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc index c5c94ad..c38fc7d 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc @@ -28,6 +28,7 @@ # define deprecated 1 # define visibility 1 #endif +#define no_unique_address 1 #define packed 1 #define pure 1 // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc index c8f0362..65d273d 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc @@ -28,6 +28,7 @@ # define deprecated 1 # define visibility 1 #endif +#define no_unique_address 1 #define packed 1 #define pure 1 // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc index c4e38d6..ea2c7d2 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// { dg-options "-std=gnu++17" } // { dg-do compile { target c++17 } } // Ensure the library only uses the __name__ form for attributes. @@ -26,6 +27,7 @@ # define cold 1 # define visibility 1 #endif +#define no_unique_address 1 #define packed 1 #define pure 1 // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. diff --git a/libstdc++-v3/testsuite/18_support/comparisons/algorithms/fallback.cc b/libstdc++-v3/testsuite/18_support/comparisons/algorithms/fallback.cc new file mode 100644 index 0000000..05e1bf7 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/comparisons/algorithms/fallback.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=gnu++20" } +// { dg-do compile { target c++20 } } + +#include <compare> + +using std::strong_ordering; +using std::partial_ordering; + +namespace adl +{ + struct S { }; + void strong_ordering(const S&, const S&); + bool operator==(const S&, S&) { return true; } + bool operator<(const S&, S&) { return true; } +} + +template<typename T, typename U> + concept has_strong_order_fallback = requires (T& t, U& u) { + std::compare_strong_order_fallback(t, u); + }; + +template<typename T, typename U> + concept has_weak_order_fallback = requires (T& t, U& u) { + std::compare_weak_order_fallback(t, u); + }; + +template<typename T, typename U> + concept has_partial_order_fallback = requires (T& t, U& u) { + std::compare_partial_order_fallback(t, u); + }; + +using adl::S; + +static_assert( has_strong_order_fallback<S, S> ); +static_assert( has_strong_order_fallback<const S, S> ); +static_assert( ! has_strong_order_fallback<const S, const S> ); +static_assert( has_weak_order_fallback<S, S> ); +static_assert( has_weak_order_fallback<const S, S> ); +static_assert( ! has_weak_order_fallback<const S, const S> ); +static_assert( has_partial_order_fallback<S, S> ); +static_assert( ! has_partial_order_fallback<const S, S> ); // LWG 3465 +static_assert( ! has_partial_order_fallback<const S, const S> ); |