diff -pruN 11.3.0-14/debian/changelog 11.3.0-15/debian/changelog
--- 11.3.0-14/debian/changelog	2023-05-10 09:23:29.000000000 +0000
+++ 11.3.0-15/debian/changelog	2023-05-23 07:08:39.000000000 +0000
@@ -1,3 +1,15 @@
+gcc-11 (11.3.0-15) unstable; urgency=medium
+
+  * Update to git 20230523 from the gcc-11 branch (11.4 release candidate).
+    - Fix PR c++/98821, PR target/70243 (PPC), PR target/104871 (Darwin),
+      PR target/105599 (Darwin), PR c++/108998, PR c++/100295, PR c++/107579,
+      PR c++/107864, PR c++/107179, PR c++/100474, PR c++/104527,
+      PR c++/92752, PR c++/101118, PR fortran/109846, PR libstdc++/107801,
+      PR libstdc++/107801, PR libstdc++/91456, PR libstdc++/104875,
+      PR libstdc++/108118, PR libstdc++/108265.
+
+ -- Matthias Klose <doko@debian.org>  Tue, 23 May 2023 09:08:39 +0200
+
 gcc-11 (11.3.0-14) unstable; urgency=medium
 
   * Update to git 20230510 from the gcc-11 branch.
diff -pruN 11.3.0-14/debian/patches/git-updates.diff 11.3.0-15/debian/patches/git-updates.diff
--- 11.3.0-14/debian/patches/git-updates.diff	2023-05-10 09:23:29.000000000 +0000
+++ 11.3.0-15/debian/patches/git-updates.diff	2023-05-23 07:07:57.000000000 +0000
@@ -1,13 +1,1679 @@
-# DP: updates from the 11 branch upto 20230510 (531d5439021).
+# DP: updates from the 11 branch upto 20230523 (d7dc696304b).
 
 LANG=C git diff --no-renames --src-prefix=a/src/ --dst-prefix=b/src/ \
-	2d280e7eafc086e9df85f50ed1a6526d6a3a204d 531d5439021fb6402cf3f8606b9d9e13f9d03e5a \
+	2d280e7eafc086e9df85f50ed1a6526d6a3a204d d7dc696304bcf03de97f5b44355f940c296e3e19 \
 	| awk '/^diff .*\.texi/ {skip=1; next} /^diff / { skip=0 } skip==0' \
 	| grep -v -E '^(diff|index)'
 
+--- a/src/ChangeLog
++++ b/src/ChangeLog
+@@ -1,3 +1,11 @@
++2023-05-16  Iain Sandoe  <iain@sandoe.co.uk>
++
++	Backported from master:
++	2022-06-26  Iain Sandoe  <iain@sandoe.co.uk>
++
++	* configure: Regenerate.
++	* configure.ac: Correct use of $host.
++
+ 2022-04-21  Release Manager
+ 
+ 	* GCC 11.3.0 released.
+--- a/src/c++tools/ChangeLog
++++ b/src/c++tools/ChangeLog
+@@ -1,3 +1,20 @@
++2023-05-18  Iain Sandoe  <iain@sandoe.co.uk>
++
++	Backported from master:
++	2021-07-21  Iain Sandoe  <iain@sandoe.co.uk>
++		    Jakub Jelinek  <jakub@redhat.com>
++
++	PR c++/98821
++	* config.h.in: Regenerate.
++	* configure: Regenerate.
++	* configure.ac: Configure using C++.  Pull logic to
++	detect enabled checking modes; default to release
++	checking.
++	* server.cc (AI_NUMERICSERV): Define a fallback value.
++	(gcc_assert): New.
++	(gcc_unreachable): New.
++	(fancy_abort): Only build when checking is enabled.
++
+ 2022-04-21  Release Manager
+ 
+ 	* GCC 11.3.0 released.
+--- a/src/c++tools/config.h.in
++++ b/src/c++tools/config.h.in
+@@ -1,5 +1,8 @@
+ /* config.h.in.  Generated from configure.ac by autoheader.  */
+ 
++/* Define if you want assertions enabled. This is a cheap check. */
++#undef ENABLE_ASSERT_CHECKING
++
+ /* Define if accept4 provided. */
+ #undef HAVE_ACCEPT4
+ 
+--- a/src/c++tools/configure
++++ b/src/c++tools/configure
+@@ -626,10 +626,7 @@ NETLIBS
+ get_gcc_base_ver
+ EGREP
+ GREP
+-CPP
+-ac_ct_CC
+-CFLAGS
+-CC
++CXXCPP
+ PIEFLAG
+ MAINTAINER
+ CXX_AUX_TOOLS
+@@ -701,6 +698,7 @@ ac_user_opts='
+ enable_option_checking
+ enable_c___tools
+ enable_maintainer_mode
++enable_checking
+ enable_default_pie
+ with_gcc_major_version_only
+ '
+@@ -713,9 +711,7 @@ LDFLAGS
+ LIBS
+ CPPFLAGS
+ CCC
+-CC
+-CFLAGS
+-CPP'
++CXXCPP'
+ 
+ 
+ # Initialize some variables set by options.
+@@ -1332,6 +1328,10 @@ Optional Features:
+   --enable-maintainer-mode
+                           enable maintainer mode. Add rules to rebuild
+                           configurey bits
++  --enable-checking[=LIST]
++                          enable expensive run-time checks. With LIST, enable
++                          only specific categories of checks. Categories are:
++                          yes,no,all,none,release.
+   --enable-default-pie    enable Position Independent Executable as default
+ 
+ Optional Packages:
+@@ -1348,9 +1348,7 @@ Some influential environment variables:
+   LIBS        libraries to pass to the linker, e.g. -l<library>
+   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+               you have headers in a nonstandard directory <include dir>
+-  CC          C compiler command
+-  CFLAGS      C compiler flags
+-  CPP         C preprocessor
++  CXXCPP      C++ preprocessor
+ 
+ Use these variables to override the choices made by `configure' or to help
+ it to find libraries and programs with nonstandard names/locations.
+@@ -1470,48 +1468,10 @@ fi
+ 
+ } # ac_fn_cxx_try_compile
+ 
+-# ac_fn_c_try_compile LINENO
+-# --------------------------
+-# Try to compile conftest.$ac_ext, and return whether this succeeded.
+-ac_fn_c_try_compile ()
+-{
+-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+-  rm -f conftest.$ac_objext
+-  if { { ac_try="$ac_compile"
+-case "(($ac_try" in
+-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+-  *) ac_try_echo=$ac_try;;
+-esac
+-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+-$as_echo "$ac_try_echo"; } >&5
+-  (eval "$ac_compile") 2>conftest.err
+-  ac_status=$?
+-  if test -s conftest.err; then
+-    grep -v '^ *+' conftest.err >conftest.er1
+-    cat conftest.er1 >&5
+-    mv -f conftest.er1 conftest.err
+-  fi
+-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+-  test $ac_status = 0; } && {
+-	 test -z "$ac_c_werror_flag" ||
+-	 test ! -s conftest.err
+-       } && test -s conftest.$ac_objext; then :
+-  ac_retval=0
+-else
+-  $as_echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-	ac_retval=1
+-fi
+-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+-  as_fn_set_status $ac_retval
+-
+-} # ac_fn_c_try_compile
+-
+-# ac_fn_c_try_cpp LINENO
+-# ----------------------
++# ac_fn_cxx_try_cpp LINENO
++# ------------------------
+ # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+-ac_fn_c_try_cpp ()
++ac_fn_cxx_try_cpp ()
+ {
+   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+   if { { ac_try="$ac_cpp conftest.$ac_ext"
+@@ -1530,7 +1490,7 @@ $as_echo "$ac_try_echo"; } >&5
+   fi
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; } > conftest.i && {
+-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
++	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ 	 test ! -s conftest.err
+        }; then :
+   ac_retval=0
+@@ -1543,14 +1503,14 @@ fi
+   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+   as_fn_set_status $ac_retval
+ 
+-} # ac_fn_c_try_cpp
++} # ac_fn_cxx_try_cpp
+ 
+-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+-# -------------------------------------------------------
++# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES
++# ---------------------------------------------------------
+ # Tests whether HEADER exists, giving a warning if it cannot be compiled using
+ # the include files in INCLUDES and setting the cache variable VAR
+ # accordingly.
+-ac_fn_c_check_header_mongrel ()
++ac_fn_cxx_check_header_mongrel ()
+ {
+   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+   if eval \${$3+:} false; then :
+@@ -1571,7 +1531,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ $4
+ #include <$2>
+ _ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
++if ac_fn_cxx_try_compile "$LINENO"; then :
+   ac_header_compiler=yes
+ else
+   ac_header_compiler=no
+@@ -1587,7 +1547,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #include <$2>
+ _ACEOF
+-if ac_fn_c_try_cpp "$LINENO"; then :
++if ac_fn_cxx_try_cpp "$LINENO"; then :
+   ac_header_preproc=yes
+ else
+   ac_header_preproc=no
+@@ -1597,7 +1557,7 @@ rm -f conftest.err conftest.i conftest.$ac_ext
+ $as_echo "$ac_header_preproc" >&6; }
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
++case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #((
+   yes:no: )
+     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+ $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+@@ -1630,13 +1590,13 @@ $as_echo "$ac_res" >&6; }
+ fi
+   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ 
+-} # ac_fn_c_check_header_mongrel
++} # ac_fn_cxx_check_header_mongrel
+ 
+-# ac_fn_c_try_run LINENO
+-# ----------------------
++# ac_fn_cxx_try_run LINENO
++# ------------------------
+ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+ # that executables *can* be run.
+-ac_fn_c_try_run ()
++ac_fn_cxx_try_run ()
+ {
+   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+   if { { ac_try="$ac_link"
+@@ -1672,13 +1632,13 @@ fi
+   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+   as_fn_set_status $ac_retval
+ 
+-} # ac_fn_c_try_run
++} # ac_fn_cxx_try_run
+ 
+-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+-# -------------------------------------------------------
++# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES
++# ---------------------------------------------------------
+ # Tests whether HEADER exists and can be compiled using the include files in
+ # INCLUDES, setting the cache variable VAR accordingly.
+-ac_fn_c_check_header_compile ()
++ac_fn_cxx_check_header_compile ()
+ {
+   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+@@ -1691,7 +1651,7 @@ else
+ $4
+ #include <$2>
+ _ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
++if ac_fn_cxx_try_compile "$LINENO"; then :
+   eval "$3=yes"
+ else
+   eval "$3=no"
+@@ -1703,12 +1663,12 @@ eval ac_res=\$$3
+ $as_echo "$ac_res" >&6; }
+   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ 
+-} # ac_fn_c_check_header_compile
++} # ac_fn_cxx_check_header_compile
+ 
+-# ac_fn_c_try_link LINENO
+-# -----------------------
++# ac_fn_cxx_try_link LINENO
++# -------------------------
+ # Try to link conftest.$ac_ext, and return whether this succeeded.
+-ac_fn_c_try_link ()
++ac_fn_cxx_try_link ()
+ {
+   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+   rm -f conftest.$ac_objext conftest$ac_exeext
+@@ -1728,7 +1688,7 @@ $as_echo "$ac_try_echo"; } >&5
+   fi
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; } && {
+-	 test -z "$ac_c_werror_flag" ||
++	 test -z "$ac_cxx_werror_flag" ||
+ 	 test ! -s conftest.err
+        } && test -s conftest$ac_exeext && {
+ 	 test "$cross_compiling" = yes ||
+@@ -1749,7 +1709,7 @@ fi
+   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+   as_fn_set_status $ac_retval
+ 
+-} # ac_fn_c_try_link
++} # ac_fn_cxx_try_link
+ cat >config.log <<_ACEOF
+ This file contains any messages produced by compilers while
+ running configure, to aid debugging if configure makes a mistake.
+@@ -2955,6 +2915,13 @@ done
+ test -n "$AUTOHEADER" || AUTOHEADER="$MISSING autoheader"
+ 
+ 
++ac_ext=cpp
++ac_cpp='$CXXCPP $CPPFLAGS'
++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build C++ tools" >&5
+ $as_echo_n "checking whether to build C++ tools... " >&6; }
+   # Check whether --enable-c++-tools was given.
+@@ -2989,556 +2956,48 @@ $as_echo "$maintainer_mode" >&6; }
+ test "$maintainer_mode" = yes && MAINTAINER=yes
+ 
+ 
+-# Check whether --enable-default-pie was given.
+-# Check whether --enable-default-pie was given.
+-if test "${enable_default_pie+set}" = set; then :
+-  enableval=$enable_default_pie; PIEFLAG=-fPIE
+-else
+-  PIEFLAG=
+-fi
+-
+-
+-
+-# Check if O_CLOEXEC is defined by fcntl
+-ac_ext=c
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+-if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}gcc; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_prog_CC+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-  if test -n "$CC"; then
+-  ac_cv_prog_CC="$CC" # Let the user override the test.
+-else
+-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+-  IFS=$as_save_IFS
+-  test -z "$as_dir" && as_dir=.
+-    for ac_exec_ext in '' $ac_executable_extensions; do
+-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+-    break 2
+-  fi
+-done
+-  done
+-IFS=$as_save_IFS
+-
+-fi
+-fi
+-CC=$ac_cv_prog_CC
+-if test -n "$CC"; then
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+-$as_echo "$CC" >&6; }
+-else
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+-
+-fi
+-if test -z "$ac_cv_prog_CC"; then
+-  ac_ct_CC=$CC
+-  # Extract the first word of "gcc", so it can be a program name with args.
+-set dummy gcc; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-  if test -n "$ac_ct_CC"; then
+-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+-else
+-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+-  IFS=$as_save_IFS
+-  test -z "$as_dir" && as_dir=.
+-    for ac_exec_ext in '' $ac_executable_extensions; do
+-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+-    ac_cv_prog_ac_ct_CC="gcc"
+-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+-    break 2
+-  fi
+-done
+-  done
+-IFS=$as_save_IFS
+-
+-fi
+-fi
+-ac_ct_CC=$ac_cv_prog_ac_ct_CC
+-if test -n "$ac_ct_CC"; then
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+-$as_echo "$ac_ct_CC" >&6; }
+-else
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+-  if test "x$ac_ct_CC" = x; then
+-    CC=""
+-  else
+-    case $cross_compiling:$ac_tool_warned in
+-yes:)
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+-ac_tool_warned=yes ;;
+-esac
+-    CC=$ac_ct_CC
+-  fi
+-else
+-  CC="$ac_cv_prog_CC"
+-fi
++# Handle configuration of checking; for the tools in this directory we
++# default to release checking and stricter checks do not change this.
+ 
+-if test -z "$CC"; then
+-          if test -n "$ac_tool_prefix"; then
+-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}cc; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_prog_CC+:} false; then :
+-  $as_echo_n "(cached) " >&6
++# Check whether --enable-checking was given.
++if test "${enable_checking+set}" = set; then :
++  enableval=$enable_checking; ac_checking_flags="${enableval}"
+ else
+-  if test -n "$CC"; then
+-  ac_cv_prog_CC="$CC" # Let the user override the test.
+-else
+-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+-  IFS=$as_save_IFS
+-  test -z "$as_dir" && as_dir=.
+-    for ac_exec_ext in '' $ac_executable_extensions; do
+-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+-    ac_cv_prog_CC="${ac_tool_prefix}cc"
+-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+-    break 2
+-  fi
+-done
+-  done
+-IFS=$as_save_IFS
+-
+-fi
+-fi
+-CC=$ac_cv_prog_CC
+-if test -n "$CC"; then
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+-$as_echo "$CC" >&6; }
+-else
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+ 
++# Default to checking.
++ac_checking_flags=yes
+ 
+-  fi
+-fi
+-if test -z "$CC"; then
+-  # Extract the first word of "cc", so it can be a program name with args.
+-set dummy cc; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_prog_CC+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-  if test -n "$CC"; then
+-  ac_cv_prog_CC="$CC" # Let the user override the test.
+-else
+-  ac_prog_rejected=no
+-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+-  IFS=$as_save_IFS
+-  test -z "$as_dir" && as_dir=.
+-    for ac_exec_ext in '' $ac_executable_extensions; do
+-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+-       ac_prog_rejected=yes
+-       continue
+-     fi
+-    ac_cv_prog_CC="cc"
+-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+-    break 2
+-  fi
+-done
+-  done
+-IFS=$as_save_IFS
+-
+-if test $ac_prog_rejected = yes; then
+-  # We found a bogon in the path, so make sure we never use it.
+-  set dummy $ac_cv_prog_CC
+-  shift
+-  if test $# != 0; then
+-    # We chose a different compiler from the bogus one.
+-    # However, it has the same basename, so the bogon will be chosen
+-    # first if we set CC to just the basename; use the full file name.
+-    shift
+-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+-  fi
+-fi
+-fi
+-fi
+-CC=$ac_cv_prog_CC
+-if test -n "$CC"; then
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+-$as_echo "$CC" >&6; }
+-else
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+-
+-fi
+-if test -z "$CC"; then
+-  if test -n "$ac_tool_prefix"; then
+-  for ac_prog in cl.exe
+-  do
+-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_prog_CC+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-  if test -n "$CC"; then
+-  ac_cv_prog_CC="$CC" # Let the user override the test.
+-else
+-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+-  IFS=$as_save_IFS
+-  test -z "$as_dir" && as_dir=.
+-    for ac_exec_ext in '' $ac_executable_extensions; do
+-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+-    break 2
+-  fi
+-done
+-  done
+-IFS=$as_save_IFS
+-
+-fi
+-fi
+-CC=$ac_cv_prog_CC
+-if test -n "$CC"; then
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+-$as_echo "$CC" >&6; }
+-else
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+ fi
+ 
+-
+-    test -n "$CC" && break
+-  done
+-fi
+-if test -z "$CC"; then
+-  ac_ct_CC=$CC
+-  for ac_prog in cl.exe
+-do
+-  # Extract the first word of "$ac_prog", so it can be a program name with args.
+-set dummy $ac_prog; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-  if test -n "$ac_ct_CC"; then
+-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+-else
+-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
++IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="$IFS,"
++for check in release $ac_checking_flags
+ do
+-  IFS=$as_save_IFS
+-  test -z "$as_dir" && as_dir=.
+-    for ac_exec_ext in '' $ac_executable_extensions; do
+-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+-    ac_cv_prog_ac_ct_CC="$ac_prog"
+-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+-    break 2
+-  fi
+-done
+-  done
+-IFS=$as_save_IFS
+-
+-fi
+-fi
+-ac_ct_CC=$ac_cv_prog_ac_ct_CC
+-if test -n "$ac_ct_CC"; then
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+-$as_echo "$ac_ct_CC" >&6; }
+-else
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+-
+-  test -n "$ac_ct_CC" && break
+-done
+-
+-  if test "x$ac_ct_CC" = x; then
+-    CC=""
+-  else
+-    case $cross_compiling:$ac_tool_warned in
+-yes:)
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+-ac_tool_warned=yes ;;
+-esac
+-    CC=$ac_ct_CC
+-  fi
+-fi
+-
+-fi
+-
+-
+-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-as_fn_error $? "no acceptable C compiler found in \$PATH
+-See \`config.log' for more details" "$LINENO" 5; }
+-
+-# Provide some information about the compiler.
+-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+-set X $ac_compile
+-ac_compiler=$2
+-for ac_option in --version -v -V -qversion; do
+-  { { ac_try="$ac_compiler $ac_option >&5"
+-case "(($ac_try" in
+-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+-  *) ac_try_echo=$ac_try;;
+-esac
+-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+-$as_echo "$ac_try_echo"; } >&5
+-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+-  ac_status=$?
+-  if test -s conftest.err; then
+-    sed '10a\
+-... rest of stderr output deleted ...
+-         10q' conftest.err >conftest.er1
+-    cat conftest.er1 >&5
+-  fi
+-  rm -f conftest.er1 conftest.err
+-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+-  test $ac_status = 0; }
++	case $check in
++	# these set all the flags to specific states
++	yes|all|release|assert) ac_assert_checking=1 ; ;;
++	no|none) ac_assert_checking= ; ;;
++	*) ;;
++	esac
+ done
++IFS="$ac_save_IFS"
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+-if ${ac_cv_c_compiler_gnu+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-
+-int
+-main ()
+-{
+-#ifndef __GNUC__
+-       choke me
+-#endif
++if test x$ac_assert_checking != x ; then
+ 
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
+-  ac_compiler_gnu=yes
+-else
+-  ac_compiler_gnu=no
+-fi
+-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+-ac_cv_c_compiler_gnu=$ac_compiler_gnu
++$as_echo "#define ENABLE_ASSERT_CHECKING 1" >>confdefs.h
+ 
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+-if test $ac_compiler_gnu = yes; then
+-  GCC=yes
+-else
+-  GCC=
+-fi
+-ac_test_CFLAGS=${CFLAGS+set}
+-ac_save_CFLAGS=$CFLAGS
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+-$as_echo_n "checking whether $CC accepts -g... " >&6; }
+-if ${ac_cv_prog_cc_g+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-  ac_save_c_werror_flag=$ac_c_werror_flag
+-   ac_c_werror_flag=yes
+-   ac_cv_prog_cc_g=no
+-   CFLAGS="-g"
+-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-
+-int
+-main ()
+-{
+-
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
+-  ac_cv_prog_cc_g=yes
+-else
+-  CFLAGS=""
+-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+ 
+-int
+-main ()
+-{
+-
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
+-
+-else
+-  ac_c_werror_flag=$ac_save_c_werror_flag
+-	 CFLAGS="-g"
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-
+-int
+-main ()
+-{
+-
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
+-  ac_cv_prog_cc_g=yes
+-fi
+-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+-fi
+-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+-fi
+-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+-   ac_c_werror_flag=$ac_save_c_werror_flag
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+-$as_echo "$ac_cv_prog_cc_g" >&6; }
+-if test "$ac_test_CFLAGS" = set; then
+-  CFLAGS=$ac_save_CFLAGS
+-elif test $ac_cv_prog_cc_g = yes; then
+-  if test "$GCC" = yes; then
+-    CFLAGS="-g -O2"
+-  else
+-    CFLAGS="-g"
+-  fi
+-else
+-  if test "$GCC" = yes; then
+-    CFLAGS="-O2"
+-  else
+-    CFLAGS=
+-  fi
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+-if ${ac_cv_prog_cc_c89+:} false; then :
+-  $as_echo_n "(cached) " >&6
++# Check whether --enable-default-pie was given.
++# Check whether --enable-default-pie was given.
++if test "${enable_default_pie+set}" = set; then :
++  enableval=$enable_default_pie; PIEFLAG=-fPIE
+ else
+-  ac_cv_prog_cc_c89=no
+-ac_save_CC=$CC
+-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-#include <stdarg.h>
+-#include <stdio.h>
+-struct stat;
+-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+-struct buf { int x; };
+-FILE * (*rcsopen) (struct buf *, struct stat *, int);
+-static char *e (p, i)
+-     char **p;
+-     int i;
+-{
+-  return p[i];
+-}
+-static char *f (char * (*g) (char **, int), char **p, ...)
+-{
+-  char *s;
+-  va_list v;
+-  va_start (v,p);
+-  s = g (p, va_arg (v,int));
+-  va_end (v);
+-  return s;
+-}
+-
+-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+-   function prototypes and stuff, but not '\xHH' hex character constants.
+-   These don't provoke an error unfortunately, instead are silently treated
+-   as 'x'.  The following induces an error, until -std is added to get
+-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+-   array size at least.  It's necessary to write '\x00'==0 to get something
+-   that's true only with -std.  */
+-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+-
+-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+-   inside strings and character constants.  */
+-#define FOO(x) 'x'
+-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+-
+-int test (int i, double x);
+-struct s1 {int (*f) (int a);};
+-struct s2 {int (*f) (double a);};
+-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+-int argc;
+-char **argv;
+-int
+-main ()
+-{
+-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+-do
+-  CC="$ac_save_CC $ac_arg"
+-  if ac_fn_c_try_compile "$LINENO"; then :
+-  ac_cv_prog_cc_c89=$ac_arg
+-fi
+-rm -f core conftest.err conftest.$ac_objext
+-  test "x$ac_cv_prog_cc_c89" != "xno" && break
+-done
+-rm -f conftest.$ac_ext
+-CC=$ac_save_CC
+-
++  PIEFLAG=
+ fi
+-# AC_CACHE_VAL
+-case "x$ac_cv_prog_cc_c89" in
+-  x)
+-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+-$as_echo "none needed" >&6; } ;;
+-  xno)
+-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+-$as_echo "unsupported" >&6; } ;;
+-  *)
+-    CC="$CC $ac_cv_prog_cc_c89"
+-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+-esac
+-if test "x$ac_cv_prog_cc_c89" != xno; then :
+ 
+-fi
+ 
+-ac_ext=c
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ 
++# Check if O_CLOEXEC is defined by fcntl
+ 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
+ $as_echo_n "checking for O_CLOEXEC... " >&6; }
+@@ -3559,7 +3018,7 @@ return open ("/dev/null", O_RDONLY | O_CLOEXEC);
+   return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
++if ac_fn_cxx_try_compile "$LINENO"; then :
+   ac_cv_o_cloexec=yes
+ else
+   ac_cv_o_cloexec=no
+@@ -3574,26 +3033,22 @@ $as_echo "#define HOST_HAS_O_CLOEXEC 1" >>confdefs.h
+ 
+ fi
+ 
+-ac_ext=c
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+-$as_echo_n "checking how to run the C preprocessor... " >&6; }
+-# On Suns, sometimes $CPP names a directory.
+-if test -n "$CPP" && test -d "$CPP"; then
+-  CPP=
+-fi
+-if test -z "$CPP"; then
+-  if ${ac_cv_prog_CPP+:} false; then :
++ac_ext=cpp
++ac_cpp='$CXXCPP $CPPFLAGS'
++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
++$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
++if test -z "$CXXCPP"; then
++  if ${ac_cv_prog_CXXCPP+:} false; then :
+   $as_echo_n "(cached) " >&6
+ else
+-      # Double quotes because CPP needs to be expanded
+-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
++      # Double quotes because CXXCPP needs to be expanded
++    for CXXCPP in "$CXX -E" "/lib/cpp"
+     do
+       ac_preproc_ok=false
+-for ac_c_preproc_warn_flag in '' yes
++for ac_cxx_preproc_warn_flag in '' yes
+ do
+   # Use a header file that comes with gcc, so configuring glibc
+   # with a fresh cross-compiler works.
+@@ -3610,7 +3065,7 @@ do
+ #endif
+ 		     Syntax error
+ _ACEOF
+-if ac_fn_c_try_cpp "$LINENO"; then :
++if ac_fn_cxx_try_cpp "$LINENO"; then :
+ 
+ else
+   # Broken: fails on valid input.
+@@ -3624,7 +3079,7 @@ rm -f conftest.err conftest.i conftest.$ac_ext
+ /* end confdefs.h.  */
+ #include <ac_nonexistent.h>
+ _ACEOF
+-if ac_fn_c_try_cpp "$LINENO"; then :
++if ac_fn_cxx_try_cpp "$LINENO"; then :
+   # Broken: success on invalid input.
+ continue
+ else
+@@ -3642,17 +3097,17 @@ if $ac_preproc_ok; then :
+ fi
+ 
+     done
+-    ac_cv_prog_CPP=$CPP
++    ac_cv_prog_CXXCPP=$CXXCPP
+ 
+ fi
+-  CPP=$ac_cv_prog_CPP
++  CXXCPP=$ac_cv_prog_CXXCPP
+ else
+-  ac_cv_prog_CPP=$CPP
++  ac_cv_prog_CXXCPP=$CXXCPP
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+-$as_echo "$CPP" >&6; }
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
++$as_echo "$CXXCPP" >&6; }
+ ac_preproc_ok=false
+-for ac_c_preproc_warn_flag in '' yes
++for ac_cxx_preproc_warn_flag in '' yes
+ do
+   # Use a header file that comes with gcc, so configuring glibc
+   # with a fresh cross-compiler works.
+@@ -3669,7 +3124,7 @@ do
+ #endif
+ 		     Syntax error
+ _ACEOF
+-if ac_fn_c_try_cpp "$LINENO"; then :
++if ac_fn_cxx_try_cpp "$LINENO"; then :
+ 
+ else
+   # Broken: fails on valid input.
+@@ -3683,7 +3138,7 @@ rm -f conftest.err conftest.i conftest.$ac_ext
+ /* end confdefs.h.  */
+ #include <ac_nonexistent.h>
+ _ACEOF
+-if ac_fn_c_try_cpp "$LINENO"; then :
++if ac_fn_cxx_try_cpp "$LINENO"; then :
+   # Broken: success on invalid input.
+ continue
+ else
+@@ -3701,15 +3156,15 @@ if $ac_preproc_ok; then :
+ else
+   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
++as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+ See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ 
+-ac_ext=c
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+-ac_compiler_gnu=$ac_cv_c_compiler_gnu
++ac_ext=cpp
++ac_cpp='$CXXCPP $CPPFLAGS'
++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ 
+ 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+@@ -3862,7 +3317,7 @@ main ()
+   return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
++if ac_fn_cxx_try_compile "$LINENO"; then :
+   ac_cv_header_stdc=yes
+ else
+   ac_cv_header_stdc=no
+@@ -3935,7 +3390,7 @@ main ()
+   return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_run "$LINENO"; then :
++if ac_fn_cxx_try_run "$LINENO"; then :
+ 
+ else
+   ac_cv_header_stdc=no
+@@ -3959,7 +3414,7 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ 		  inttypes.h stdint.h unistd.h
+ do :
+   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
++ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+ "
+ if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+   cat >>confdefs.h <<_ACEOF
+@@ -3973,7 +3428,7 @@ done
+ 
+ for ac_header in sys/mman.h
+ do :
+-  ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default"
++  ac_fn_cxx_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default"
+ if test "x$ac_cv_header_sys_mman_h" = xyes; then :
+   cat >>confdefs.h <<_ACEOF
+ #define HAVE_SYS_MMAN_H 1
+@@ -4016,7 +3471,7 @@ connect (fd, (sockaddr *)&un, sizeof (un));
+   return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
++if ac_fn_cxx_try_compile "$LINENO"; then :
+   ac_cv_af_unix=yes
+ else
+   ac_cv_af_unix=no
+@@ -4070,7 +3525,7 @@ connect (fd, (sockaddr *)&in6, sizeof (in6));
+   return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
++if ac_fn_cxx_try_compile "$LINENO"; then :
+   ac_cv_af_inet6=yes
+ else
+   ac_cv_af_inet6=no
+@@ -4111,7 +3566,7 @@ epoll_pwait (fd, 0, 0, -1, 0);
+   return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
++if ac_fn_cxx_try_compile "$LINENO"; then :
+   ac_cv_epoll=yes
+ else
+   ac_cv_epoll=no
+@@ -4147,7 +3602,7 @@ pselect (0, 0, 0, 0, 0, 0);
+   return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
++if ac_fn_cxx_try_compile "$LINENO"; then :
+   ac_cv_pselect=yes
+ else
+   ac_cv_pselect=no
+@@ -4184,7 +3639,7 @@ select (0, 0, 0, 0, 0);
+   return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
++if ac_fn_cxx_try_compile "$LINENO"; then :
+   ac_cv_select=yes
+ else
+   ac_cv_select=no
+@@ -4220,7 +3675,7 @@ int err = accept4 (1, 0, 0, SOCK_NONBLOCK);
+   return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
++if ac_fn_cxx_try_compile "$LINENO"; then :
+   ac_cv_accept4=yes
+ else
+   ac_cv_accept4=no
+@@ -4259,7 +3714,7 @@ const char *str = inet_ntop (AF_INET6, &in6, buf, sizeof (buf));
+   return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
++if ac_fn_cxx_try_compile "$LINENO"; then :
+   ac_cv_inet_ntop=yes
+ else
+   ac_cv_inet_ntop=no
+@@ -4325,7 +3780,7 @@ for ac_lib in '' nsl; do
+     ac_res=-l$ac_lib
+     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+   fi
+-  if ac_fn_c_try_link "$LINENO"; then :
++  if ac_fn_cxx_try_link "$LINENO"; then :
+   ac_cv_search_gethostbyname=$ac_res
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+@@ -4381,7 +3836,7 @@ for ac_lib in '' socket; do
+     ac_res=-l$ac_lib
+     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+   fi
+-  if ac_fn_c_try_link "$LINENO"; then :
++  if ac_fn_cxx_try_link "$LINENO"; then :
+   ac_cv_search_socket=$ac_res
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+@@ -4431,7 +3886,7 @@ return socket ();
+   return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_link "$LINENO"; then :
++if ac_fn_cxx_try_link "$LINENO"; then :
+   ac_cv_lib_socket_socket=yes
+ else
+   ac_cv_lib_socket_socket=no
+--- a/src/c++tools/configure.ac
++++ b/src/c++tools/configure.ac
+@@ -41,6 +41,8 @@ MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
+ AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf])
+ AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
+ 
++AC_LANG(C++)
++
+ dnl Enabled by default
+ AC_MSG_CHECKING([whether to build C++ tools])
+   AC_ARG_ENABLE(c++-tools, 
+@@ -67,6 +69,35 @@ AC_MSG_RESULT([$maintainer_mode])
+ test "$maintainer_mode" = yes && MAINTAINER=yes
+ AC_SUBST(MAINTAINER)
+ 
++# Handle configuration of checking; for the tools in this directory we
++# default to release checking and stricter checks do not change this.
++
++AC_ARG_ENABLE(checking,
++[AS_HELP_STRING([[--enable-checking[=LIST]]],
++		[enable expensive run-time checks.  With LIST,
++		 enable only specific categories of checks.
++		 Categories are: yes,no,all,none,release.])],
++[ac_checking_flags="${enableval}"],[
++# Default to checking.
++ac_checking_flags=yes
++])
++IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="$IFS,"
++for check in release $ac_checking_flags
++do
++	case $check in
++	# these set all the flags to specific states
++	yes|all|release|assert) ac_assert_checking=1 ; ;;
++	no|none) ac_assert_checking= ; ;;
++	*) ;;
++	esac
++done
++IFS="$ac_save_IFS"
++
++if test x$ac_assert_checking != x ; then
++  AC_DEFINE(ENABLE_ASSERT_CHECKING, 1,
++[Define if you want assertions enabled.  This is a cheap check.])
++fi
++
+ # Check whether --enable-default-pie was given.
+ AC_ARG_ENABLE(default-pie,
+ [AS_HELP_STRING([--enable-default-pie],
+--- a/src/c++tools/server.cc
++++ b/src/c++tools/server.cc
+@@ -61,6 +61,10 @@ along with GCC; see the file COPYING3.  If not see
+ # define gai_strerror(X) ""
+ #endif
+ 
++#ifndef AI_NUMERICSERV
++#define AI_NUMERICSERV 0
++#endif
++
+ #include <getopt.h>
+ 
+ // Select or epoll
+@@ -92,6 +96,28 @@ along with GCC; see the file COPYING3.  If not see
+ #define DIR_SEPARATOR '/'
+ #endif
+ 
++/* Imported from libcpp/system.h
++   Use gcc_assert(EXPR) to test invariants.  */
++#if ENABLE_ASSERT_CHECKING
++#define gcc_assert(EXPR)                                                \
++   ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
++#elif (GCC_VERSION >= 4005)
++#define gcc_assert(EXPR)                                                \
++  ((void)(__builtin_expect (!(EXPR), 0) ? __builtin_unreachable (), 0 : 0))
++#else
++/* Include EXPR, so that unused variable warnings do not occur.  */
++#define gcc_assert(EXPR) ((void)(0 && (EXPR)))
++#endif
++
++/* Use gcc_unreachable() to mark unreachable locations (like an
++   unreachable default case of a switch.  Do not use gcc_assert(0).  */
++#if (GCC_VERSION >= 4005) && !ENABLE_ASSERT_CHECKING
++#define gcc_unreachable() __builtin_unreachable ()
++#else
++#define gcc_unreachable() (fancy_abort (__FILE__, __LINE__, __FUNCTION__))
++#endif
++
++
+ #if NETWORKING
+ struct netmask {
+   in6_addr addr;
+@@ -202,11 +228,13 @@ internal_error (const char *fmt, ...)
+ 
+ /* Hooked to from gcc_assert & gcc_unreachable.  */
+ 
++#if ENABLE_ASSERT_CHECKING
+ void ATTRIBUTE_NORETURN ATTRIBUTE_COLD
+ fancy_abort (const char *file, int line, const char *func)
+ {
+   internal_error ("in %s, at %s:%d", func, trim_src_file (file), line);
+ }
++#endif
+ 
+ /* Exploded on a signal.  */
+ 
+--- a/src/configure
++++ b/src/configure
+@@ -8277,7 +8277,7 @@ fi
+ # Check whether --enable-host-shared was given.
+ if test "${enable_host_shared+set}" = set; then :
+   enableval=$enable_host_shared; host_shared=$enableval
+- case $target in
++ case $host in
+    x86_64-*-darwin* | aarch64-*-darwin*)
+      if test x$host_shared != xyes ; then
+        # PIC is the default, and actually cannot be switched off.
+@@ -8287,7 +8287,7 @@ if test "${enable_host_shared+set}" = set; then :
+   *) ;;
+  esac
+ else
+-  case $target in
++  case $host in
+   x86_64-*-darwin* | aarch64-*-darwin*) host_shared=yes ;;
+   *) host_shared=no ;;
+  esac
+--- a/src/configure.ac
++++ b/src/configure.ac
+@@ -1872,7 +1872,7 @@ AC_ARG_ENABLE(host-shared,
+ [AS_HELP_STRING([--enable-host-shared],
+ 		[build host code as shared libraries])],
+ [host_shared=$enableval
+- case $target in
++ case $host in
+    x86_64-*-darwin* | aarch64-*-darwin*)
+      if test x$host_shared != xyes ; then
+        # PIC is the default, and actually cannot be switched off.
+@@ -1881,7 +1881,7 @@ AC_ARG_ENABLE(host-shared,
+      fi ;;
+   *) ;;
+  esac],
+-[case $target in
++[case $host in
+   x86_64-*-darwin* | aarch64-*-darwin*) host_shared=yes ;;
+   *) host_shared=no ;;
+  esac])
+--- a/src/fixincludes/ChangeLog
++++ b/src/fixincludes/ChangeLog
+@@ -1,3 +1,23 @@
++2023-05-16  Iain Sandoe  <iain@sandoe.co.uk>
++
++	Backported from master:
++	2023-01-21  Iain Sandoe  <iain@sandoe.co.uk>
++
++	* fixincl.x: Regenerate.
++	* inclhack.def (darwin_objc_runtime_1): New hack.
++	* tests/base/objc/runtime.h: New file.
++
++2023-05-16  Iain Sandoe  <iain@sandoe.co.uk>
++
++	Backported from master:
++	2023-01-21  Iain Sandoe  <iain@sandoe.co.uk>
++
++	PR target/107568
++	* fixincl.x: Regenerate.
++	* inclhack.def: Add a fix for MacOS13 SDK function deprecations
++	in stdio.h.
++	* tests/base/stdio.h (__deprecated_msg): New test.
++
+ 2022-04-21  Release Manager
+ 
+ 	* GCC 11.3.0 released.
+--- a/src/fixincludes/fixincl.x
++++ b/src/fixincludes/fixincl.x
+@@ -2,11 +2,11 @@
+  *
+  * DO NOT EDIT THIS FILE   (fixincl.x)
+  *
+- * It has been AutoGen-ed  July  1, 2021 at 03:44:46 PM by AutoGen 5.18.7
++ * It has been AutoGen-ed  May 15, 2023 at 11:55:05 PM by AutoGen 5.18.7
+  * From the definitions    inclhack.def
+  * and the template file   fixincl
+  */
+-/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Jul  1 15:44:46 CEST 2021
++/* DO NOT SVN-MERGE THIS FILE, EITHER Mon May 15 23:55:05 BST 2023
+  *
+  * You must regenerate it.  Use the ./genfixes script.
+  *
+@@ -15,7 +15,7 @@
+  * certain ANSI-incompatible system header files which are fixed to work
+  * correctly with ANSI C and placed in a directory that GNU C will search.
+  *
+- * This file contains 260 fixup descriptions.
++ * This file contains 262 fixup descriptions.
+  *
+  * See README for more information.
+  *
+@@ -2608,6 +2608,46 @@ static const char* apzBsd_Stdio_Attrs_ConflictPatch[] = {
+ int vfscanf(FILE *, const char *, __builtin_va_list) __asm__ (_BSD_STRING(__USER_LABEL_PREFIX__) \"__svfscanf\");",
+     (char*)NULL };
+ 
++/* * * * * * * * * * * * * * * * * * * * * * * * * *
++ *
++ *  Description of Apple_Local_Stdio_Fn_Deprecation fix
++ */
++tSCC zApple_Local_Stdio_Fn_DeprecationName[] =
++     "apple_local_stdio_fn_deprecation";
++
++/*
++ *  File name selection pattern
++ */
++tSCC zApple_Local_Stdio_Fn_DeprecationList[] =
++  "stdio.h\0";
++/*
++ *  Machine/OS name selection pattern
++ */
++tSCC* apzApple_Local_Stdio_Fn_DeprecationMachs[] = {
++        "*-*-*darwin2*",
++        (const char*)NULL };
++
++/*
++ *  content selection pattern - do fix if pattern found
++ */
++tSCC zApple_Local_Stdio_Fn_DeprecationSelect0[] =
++       "__deprecated_msg([^\n\
++]*)$";
++
++#define    APPLE_LOCAL_STDIO_FN_DEPRECATION_TEST_CT  1
++static tTestDesc aApple_Local_Stdio_Fn_DeprecationTests[] = {
++  { TT_EGREP,    zApple_Local_Stdio_Fn_DeprecationSelect0, (regex_t*)NULL }, };
++
++/*
++ *  Fix Command Arguments for Apple_Local_Stdio_Fn_Deprecation
++ */
++static const char* apzApple_Local_Stdio_Fn_DeprecationPatch[] = {
++    "format",
++    "#if defined(__APPLE_LOCAL_DEPRECATIONS)\n\
++%0\n\
++#endif",
++    (char*)NULL };
++
+ /* * * * * * * * * * * * * * * * * * * * * * * * * *
+  *
+  *  Description of Ctrl_Quotes_Def fix
+@@ -3044,6 +3084,53 @@ static const char* apzDarwin_Os_Trace_2Patch[] = {
+ #endif",
+     (char*)NULL };
+ 
++/* * * * * * * * * * * * * * * * * * * * * * * * * *
++ *
++ *  Description of Darwin_Objc_Runtime_1 fix
++ */
++tSCC zDarwin_Objc_Runtime_1Name[] =
++     "darwin_objc_runtime_1";
++
++/*
++ *  File name selection pattern
++ */
++tSCC zDarwin_Objc_Runtime_1List[] =
++  "objc/runtime.h\0";
++/*
++ *  Machine/OS name selection pattern
++ */
++tSCC* apzDarwin_Objc_Runtime_1Machs[] = {
++        "*-*-darwin2*",
++        (const char*)NULL };
++
++/*
++ *  content selection pattern - do fix if pattern found
++ */
++tSCC zDarwin_Objc_Runtime_1Select0[] =
++       "OBJC_EXPORT void.*\n\
++objc_enumerateClasses.*\n\
++.*\n\
++.*\n\
++.*\n\
++.*void \\(\\^ _Nonnull block.*\n\
++.*\n\
++.*\n\
++.*OBJC_REFINED_FOR_SWIFT.*";
++
++#define    DARWIN_OBJC_RUNTIME_1_TEST_CT  1
++static tTestDesc aDarwin_Objc_Runtime_1Tests[] = {
++  { TT_EGREP,    zDarwin_Objc_Runtime_1Select0, (regex_t*)NULL }, };
++
++/*
++ *  Fix Command Arguments for Darwin_Objc_Runtime_1
++ */
++static const char* apzDarwin_Objc_Runtime_1Patch[] = {
++    "format",
++    "#if __BLOCKS__\n\
++%0\n\
++#endif",
++    (char*)NULL };
++
+ /* * * * * * * * * * * * * * * * * * * * * * * * * *
+  *
+  *  Description of Darwin_Os_Trace_3 fix
+@@ -10560,9 +10647,9 @@ static const char* apzX11_SprintfPatch[] = {
+  *
+  *  List of all fixes
+  */
+-#define REGEX_COUNT          298
++#define REGEX_COUNT          300
+ #define MACH_LIST_SIZE_LIMIT 187
+-#define FIX_COUNT            260
++#define FIX_COUNT            262
+ 
+ /*
+  *  Enumerate the fixes
+@@ -10629,6 +10716,7 @@ typedef enum {
+     BROKEN_CABS_FIXIDX,
+     BROKEN_NAN_FIXIDX,
+     BSD_STDIO_ATTRS_CONFLICT_FIXIDX,
++    APPLE_LOCAL_STDIO_FN_DEPRECATION_FIXIDX,
+     CTRL_QUOTES_DEF_FIXIDX,
+     CTRL_QUOTES_USE_FIXIDX,
+     CXX_UNREADY_FIXIDX,
+@@ -10640,6 +10728,7 @@ typedef enum {
+     DARWIN_LONGJMP_NORETURN_FIXIDX,
+     DARWIN_OS_TRACE_1_FIXIDX,
+     DARWIN_OS_TRACE_2_FIXIDX,
++    DARWIN_OBJC_RUNTIME_1_FIXIDX,
+     DARWIN_OS_TRACE_3_FIXIDX,
+     DARWIN_OS_BASE_1_FIXIDX,
+     DARWIN_DISPATCH_OBJECT_1_FIXIDX,
+@@ -11136,6 +11225,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
+      BSD_STDIO_ATTRS_CONFLICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+      aBsd_Stdio_Attrs_ConflictTests,   apzBsd_Stdio_Attrs_ConflictPatch, 0 },
+ 
++  {  zApple_Local_Stdio_Fn_DeprecationName,    zApple_Local_Stdio_Fn_DeprecationList,
++     apzApple_Local_Stdio_Fn_DeprecationMachs,
++     APPLE_LOCAL_STDIO_FN_DEPRECATION_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
++     aApple_Local_Stdio_Fn_DeprecationTests,   apzApple_Local_Stdio_Fn_DeprecationPatch, 0 },
++
+   {  zCtrl_Quotes_DefName,    zCtrl_Quotes_DefList,
+      apzCtrl_Quotes_DefMachs,
+      CTRL_QUOTES_DEF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+@@ -11191,6 +11285,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
+      DARWIN_OS_TRACE_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+      aDarwin_Os_Trace_2Tests,   apzDarwin_Os_Trace_2Patch, 0 },
+ 
++  {  zDarwin_Objc_Runtime_1Name,    zDarwin_Objc_Runtime_1List,
++     apzDarwin_Objc_Runtime_1Machs,
++     DARWIN_OBJC_RUNTIME_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
++     aDarwin_Objc_Runtime_1Tests,   apzDarwin_Objc_Runtime_1Patch, 0 },
++
+   {  zDarwin_Os_Trace_3Name,    zDarwin_Os_Trace_3List,
+      apzDarwin_Os_Trace_3Machs,
+      DARWIN_OS_TRACE_3_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+--- a/src/fixincludes/inclhack.def
++++ b/src/fixincludes/inclhack.def
+@@ -1269,6 +1269,18 @@ fix = {
+     test_text = '#define  vfscanf	__svfscanf';
+ };
+ 
++fix = {
++    hackname  = apple_local_stdio_fn_deprecation;
++    mach      = "*-*-*darwin2*";
++    files     = stdio.h;
++    select    = "__deprecated_msg([^\n]*)$";
++    c_fix     = format;
++    c_fix_arg = "#if defined(__APPLE_LOCAL_DEPRECATIONS)\n"
++                "%0\n"
++                "#endif";
++    test_text = '__deprecated_msg("This function is provided for compat...")';
++};
++
+ /*
+  *  Fix various macros used to define ioctl numbers.
+  *  The traditional syntax was:
+@@ -1479,6 +1491,41 @@ fix = {
+   test_text = "typedef void (^os_trace_payload_t)(xpc_object_t xdict);";
+ };
+ 
++/*
++ *  macOSX 13.0 SDK objc/runtime.h uses Apple Blocks extension without a guard.
++ */
++
++fix = {
++  hackname  = darwin_objc_runtime_1;
++  mach      = "*-*-darwin2*";
++  files     = objc/runtime.h;
++  select    =   <<- _EOSelect_
++	OBJC_EXPORT void.*
++	objc_enumerateClasses.*
++	.*
++	.*
++	.*
++	.*void \(\^ _Nonnull block.*
++	.*
++	.*
++	.*OBJC_REFINED_FOR_SWIFT.*
++	_EOSelect_;
++  c_fix     = format;
++  c_fix_arg = "#if __BLOCKS__\n%0\n#endif";
++  test_text = <<- _OBJC_RUNTIME_1
++OBJC_EXPORT void
++objc_enumerateClasses(const void * _Nullable image,
++                      const char * _Nullable namePrefix,
++                      Protocol * _Nullable conformingTo,
++                      Class _Nullable subclassing,
++                      void (^ _Nonnull block)(Class _Nonnull aClass, BOOL * _Nonnull stop)
++                      OBJC_NOESCAPE)
++OBJC_AVAILABLE(13.0, 16.0, 16.0, 9.0, 7.0)
++OBJC_REFINED_FOR_SWIFT;
++_OBJC_RUNTIME_1;
++};
++
++
+ /*
+  *  In Mac OS X 10.1[012] <os/trace.h>, need to guard users of
+  *  os_trace_payload_t typedef, too.
+new file mode 100644
+--- /dev/null
++++ b/src/fixincludes/tests/base/objc/runtime.h
+@@ -0,0 +1,24 @@
++/*  DO NOT EDIT THIS FILE.
++
++    It has been auto-edited by fixincludes from:
++
++	"fixinc/tests/inc/objc/runtime.h"
++
++    This had to be done to correct non-standard usages in the
++    original, manufacturer supplied header file.  */
++
++
++
++#if defined( DARWIN_OBJC_RUNTIME_1_CHECK )
++#if __BLOCKS__
++OBJC_EXPORT void
++objc_enumerateClasses(const void * _Nullable image,
++                      const char * _Nullable namePrefix,
++                      Protocol * _Nullable conformingTo,
++                      Class _Nullable subclassing,
++                      void (^ _Nonnull block)(Class _Nonnull aClass, BOOL * _Nonnull stop)
++                      OBJC_NOESCAPE)
++OBJC_AVAILABLE(13.0, 16.0, 16.0, 9.0, 7.0)
++OBJC_REFINED_FOR_SWIFT;
++#endif
++#endif  /* DARWIN_OBJC_RUNTIME_1_CHECK */
+--- a/src/fixincludes/tests/base/stdio.h
++++ b/src/fixincludes/tests/base/stdio.h
+@@ -41,6 +41,13 @@ int vfscanf(FILE *, const char *, __builtin_va_list) __asm__ (_BSD_STRING(__USER
+ #endif  /* BSD_STDIO_ATTRS_CONFLICT_CHECK */
+ 
+ 
++#if defined( APPLE_LOCAL_STDIO_FN_DEPRECATION_CHECK )
++#if defined(__APPLE_LOCAL_DEPRECATIONS)
++__deprecated_msg("This function is provided for compat...")
++#endif
++#endif  /* APPLE_LOCAL_STDIO_FN_DEPRECATION_CHECK */
++
++
+ #if defined( HPUX10_STDIO_DECLARATIONS_CHECK )
+ #  define _iob __iob
+ 
 --- a/src/gcc/ChangeLog
 +++ b/src/gcc/ChangeLog
-@@ -1,3 +1,1957 @@
+@@ -1,3 +1,2028 @@
++2023-05-22   Michael Meissner  <meissner@linux.ibm.com>
++
++	PR target/70243
++	* config/rs6000/vsx.md (vsx_fmav4sf4): Do not generate vmaddfp.  Back
++	port from master 04/10/2023.
++	(vsx_nfmsv4sf4): Do not generate vnmsubfp.
++
++2023-05-16  Simon Wright  <simon@pushface.org>
++
++	Backported from master:
++	2022-06-12  Simon Wright  <simon@pushface.org>
++
++	PR target/104871
++	* config/darwin-driver.c (darwin_find_version_from_kernel): If the OS
++	version is darwin20 (macOS 11) or greater, truncate the version to the
++	major number.
++
++2023-05-16  Mark Mentovai  <mark@mentovai.com>
++
++	Backported from master:
++	2022-06-12  Mark Mentovai  <mark@mentovai.com>
++
++	* config/darwin-c.c: Make -mmacosx-version-min more future-proof.
++
++2023-05-16  Iain Sandoe  <iain@sandoe.co.uk>
++
++	Backported from master:
++	2022-05-29  Iain Sandoe  <iain@sandoe.co.uk>
++
++	PR target/105599
++	* config/darwin.h: Move versions-specific handling of multiply_defined
++	from SUBTARGET_DRIVER_SELF_SPECS to LINK_SPEC.
++
++2023-05-16  Iain Sandoe  <iain@sandoe.co.uk>
++
++	Backported from master:
++	2021-12-24  Iain Sandoe  <iain@sandoe.co.uk>
++
++	* config.gcc: Emit L2_MAX_OFILE_ALIGNMENT with suitable
++	values for the host.
++	* config/darwin.c (darwin_emit_common): Error for alignment
++	values > 32768.
++	* config/darwin.h (MAX_OFILE_ALIGNMENT): Rework to use the
++	configured L2_MAX_OFILE_ALIGNMENT.
++
++2023-05-16  François-Xavier Coudert  <fxcoudert@gcc.gnu.org>
++
++	Backported from master:
++	2021-12-18  François-Xavier Coudert  <fxcoudert@gcc.gnu.org>
++
++	* config/darwin-driver.c: Make version code more future-proof.
++	* config.gcc: Homogeneize darwin versions.
++	* configure.ac: Homogeneize darwin versions.
++	* configure: Regenerate.
++
++2023-05-15  Iain Sandoe  <iain@sandoe.co.uk>
++
++	* config/i386/darwin.h (ENDFILE_SPEC): Fix trailing '\'.
++
++2023-05-15  liuhongt  <hongtao.liu@intel.com>
++
++	* config/i386/cygwin.h (ENDFILE_SPEC): Link crtfastmath.o
++	whenever -mdaz-ftz is specified. Don't link crtfastmath.o
++	when -mno-daz-ftz is specified.
++	* config/i386/darwin.h (ENDFILE_SPEC): Ditto.
++	* config/i386/gnu-user-common.h
++	(GNU_USER_TARGET_MATHFILE_SPEC): Ditto.
++	* config/i386/mingw32.h (ENDFILE_SPEC): Ditto.
++	* config/i386/i386.opt (mdaz-ftz): New option.
++	* doc/invoke.texi (x86 options): Document mftz-daz.
++
 +2023-05-09  Jakub Jelinek  <jakub@redhat.com>
 +
 +	Backported from master:
@@ -1969,7 +3635,7 @@ LANG=C git diff --no-renames --src-prefi
 +++ b/src/gcc/DATESTAMP
 @@ -1 +1 @@
 -20220421
-+20230510
++20230523
 --- a/src/gcc/alias.c
 +++ b/src/gcc/alias.c
 @@ -389,6 +389,20 @@ refs_same_for_tbaa_p (tree earlier, tree later)
@@ -2853,6 +4519,47 @@ LANG=C git diff --no-renames --src-prefi
  };
  
  /* Any new types or subtypes have to be inserted at the end. */
+--- a/src/gcc/config.gcc
++++ b/src/gcc/config.gcc
+@@ -699,6 +699,20 @@ case ${target} in
+     macos_min=0
+   fi
+   def_ld64=85.2
++  # Tools hosted on earlier versions of Darwin constrained all object
++  # alignment to be 2^15 or smaller.  From Darwin11 (macOS 10.7) the
++  # alignment of non-common is allowed to be up to 2^28.  Note that the
++  # larger alignment is permitted when targeting 10.6 from 10.7 so that
++  # the constraint only need be applied per host (and only if the host
++  # is Darwin).
++  case ${host} in
++      *-*-darwin[4-9]* | *-*-darwin10*)
++          tm_defines="$tm_defines L2_MAX_OFILE_ALIGNMENT=15U"
++          ;;
++      *)
++          tm_defines="$tm_defines L2_MAX_OFILE_ALIGNMENT=28U"
++          ;;
++  esac
+   case ${target} in
+       # Darwin 4 to 19 correspond to macOS 10.0 to 10.15
+       *-*-darwin[4-9]* | *-*-darwin1[0-9]*)
+@@ -1872,7 +1886,7 @@ hppa[12]*-*-hpux11*)
+ 		dwarf2=no
+ 	fi
+ 	;;
+-i[34567]86-*-darwin1[89]*)
++i[34567]86-*-darwin1[89]* | i[34567]86-*-darwin2*)
+ 	echo "Error: 32bit target is not supported after Darwin17" 1>&2
+ 	;;
+ i[34567]86-*-darwin*)
+@@ -1882,7 +1896,7 @@ i[34567]86-*-darwin*)
+ 	tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch t-slibgcc"
+ 	tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
+ 	;;
+-x86_64-*-darwin1[89]* | x86_64-*-darwin2[01]*)
++x86_64-*-darwin1[89]* | x86_64-*-darwin2*)
+ 	# Only 64b from now
+ 	with_cpu=${with_cpu:-core2}
+ 	tmake_file="${tmake_file} t-slibgcc"
 --- a/src/gcc/config/aarch64/aarch64-builtins.c
 +++ b/src/gcc/config/aarch64/aarch64-builtins.c
 @@ -523,6 +523,12 @@ enum aarch64_builtins
@@ -4278,9 +5985,136 @@ LANG=C git diff --no-renames --src-prefi
  })
  
  (define_insn "mve_vshlq_<supf><mode>"
+--- a/src/gcc/config/darwin-c.c
++++ b/src/gcc/config/darwin-c.c
+@@ -691,7 +691,8 @@ macosx_version_as_macro (void)
+   if (!version_array)
+     goto fail;
+ 
+-  if (version_array[MAJOR] < 10 || version_array[MAJOR] > 12)
++  /* System tools accept up to 99 as a major version.  */
++  if (version_array[MAJOR] < 10 || version_array[MAJOR] > 99)
+     goto fail;
+ 
+   if (version_array[MAJOR] == 10 && version_array[MINOR] < 10)
+--- a/src/gcc/config/darwin-driver.c
++++ b/src/gcc/config/darwin-driver.c
+@@ -64,7 +64,8 @@ validate_macosx_version_min (const char *version_str)
+ 
+   major = strtoul (version_str, &end, 10);
+ 
+-  if (major < 10 || major > 12 ) /* macOS 10, 11, and 12 are known. */
++  /* macOS 10, 11, and 12 are known. clang accepts up to 99.  */
++  if (major < 10 || major > 99)
+     return NULL;
+ 
+   /* Skip a separating period, if there's one.  */
+@@ -159,20 +160,13 @@ darwin_find_version_from_kernel (void)
+     goto parse_failed;
+ 
+   /* Darwin20 sees a transition to macOS 11.  In this, it seems that the
+-     mapping to macOS minor version is now shifted to the kernel minor
+-     version - 1 (at least for the initial releases).  At this stage, we
+-     don't know what macOS version will correspond to Darwin21.  */
++     mapping to macOS minor version and patch level is now always 0, 0
++     (at least for macOS 11 and 12).  */
+   if (major_vers >= 20)
+     {
+-      int minor_vers = *version_p++ - '0';
+-      if (ISDIGIT (*version_p))
+-	minor_vers = minor_vers * 10 + (*version_p++ - '0');
+-      if (*version_p++ != '.')
+-	goto parse_failed;
+-      if (minor_vers > 0)
+-	minor_vers -= 1; /* Kernel 20.3 => macOS 11.2.  */
+-      /* It's not yet clear whether patch level will be considered.  */
+-      asprintf (&new_flag, "%d.%02d.00", major_vers - 9, minor_vers);
++      /* Apple clang doesn't include the minor version or the patch level
++	 in the object file, nor does it pass it to ld  */
++      asprintf (&new_flag, "%d.00.00", major_vers - 9);
+     }
+   else if (major_vers - 4 <= 4)
+     /* On 10.4 and earlier, the old linker is used which does not
+--- a/src/gcc/config/darwin.c
++++ b/src/gcc/config/darwin.c
+@@ -2556,7 +2556,6 @@ darwin_emit_common (FILE *fp, const char *name,
+     rounded = (size + (align-1)) & ~(align-1);
+ 
+   l2align = floor_log2 (align);
+-  gcc_assert (l2align <= L2_MAX_OFILE_ALIGNMENT);
+ 
+   in_section = comm_section;
+   /* We mustn't allow multiple public symbols to share an address when using
+@@ -2707,6 +2706,10 @@ darwin_asm_output_aligned_decl_common (FILE *fp, tree decl, const char *name,
+ #ifdef DEBUG_DARWIN_MEM_ALLOCATORS
+ fprintf (fp, "# adcom: %s (%d,%d) decl=0x0\n", name, (int)size, (int)align);
+ #endif
++     /* Common variables are limited to a maximum alignment of 2^15.  */
++      if (align > 32768)
++	error_at (UNKNOWN_LOCATION, "common variables must have an alignment"
++		  " of 32678 or less");
+       darwin_emit_common (fp, name, size, align);
+       return;
+     }
+@@ -2734,7 +2737,7 @@ fprintf (fp, "# adcom: %s (%lld,%d) ro %d cst %d stat %d com %d pub %d"
+     }
+ 
+   /* We shouldn't be messing with this if the decl has a section name.  */
+-  gcc_assert (DECL_SECTION_NAME (decl) == NULL);
++  gcc_checking_assert (DECL_SECTION_NAME (decl) == NULL);
+ 
+   /* We would rather not have to check this here - but it seems that we might
+      be passed a decl that should be in coalesced space.  */
+@@ -2763,10 +2766,16 @@ fprintf (fp, "# adcom: %s (%lld,%d) ro %d cst %d stat %d com %d pub %d"
+ 
+   l2align = floor_log2 (align / BITS_PER_UNIT);
+   /* Check we aren't asking for more aligment than the platform allows.  */
+-  gcc_assert (l2align <= L2_MAX_OFILE_ALIGNMENT);
++  gcc_checking_assert (l2align <= L2_MAX_OFILE_ALIGNMENT);
+ 
+   if (TREE_PUBLIC (decl) != 0)
+-    darwin_emit_common (fp, name, size, align);
++    {
++      /* Common variables are limited to a maximum alignment of 2^15.  */
++      if (l2align > 15)
++	error_at (DECL_SOURCE_LOCATION (decl), "common variables must have"
++		  " an alignment of 32678 or less");
++      darwin_emit_common (fp, name, size, align);
++    }
+   else
+     darwin_emit_local_bss (fp, decl, name, size, l2align);
+ }
 --- a/src/gcc/config/darwin.h
 +++ b/src/gcc/config/darwin.h
-@@ -445,6 +445,7 @@ extern GTY(()) int darwin_ms_struct;
+@@ -141,10 +141,7 @@ extern GTY(()) int darwin_ms_struct;
+    Right now there's no mechanism to split up the "variable portion" (%*) of
+    the matched spec string, so where we have some driver specs that take 2
+    or 3 arguments, these cannot be processed here, but are deferred until the
+-   LINK_SPEC, where they are copied verbatim.
+-   We have a "safe" version of the MacOS version string, that's been sanity-
+-   checked and truncated to minor version.  If the 'tiny' (3rd) portion of the
+-   value is not significant, it's better to use this in version-compare().  */
++   LINK_SPEC, where they are copied verbatim.  */
+ 
+ #undef SUBTARGET_DRIVER_SELF_SPECS
+ #define SUBTARGET_DRIVER_SELF_SPECS					\
+@@ -218,13 +215,8 @@ extern GTY(()) int darwin_ms_struct;
+   "%{image_base*:-Xlinker -image_base -Xlinker %*} %<image_base*",	\
+   "%{init*:-Xlinker -init -Xlinker %*} %<init*",			\
+   "%{multi_module:-Xlinker -multi_module} %<multi_module",		\
+-  "%{multiply_defined*:-Xlinker -multiply_defined -Xlinker %*; \
+-     :%{shared-libgcc: \
+-       %:version-compare(< 10.5 asm_macosx_version_min= -Xlinker) \
+-       %:version-compare(< 10.5 asm_macosx_version_min= -multiply_defined) \
+-       %:version-compare(< 10.5 asm_macosx_version_min= -Xlinker) \
+-       %:version-compare(< 10.5 asm_macosx_version_min= suppress)}} \
+-     %<multiply_defined*",						\
++  "%{multiply_defined*:-Xlinker -multiply_defined -Xlinker %*} \
++     %<multiply_defined* ",						\
+   "%{multiplydefinedunused*:\
+      -Xlinker -multiply_defined_unused -Xlinker %*} \
+      %<multiplydefinedunused* ",					\
+@@ -445,12 +437,16 @@ extern GTY(()) int darwin_ms_struct;
                       %:replace-outfile(-lobjc libobjc-gnu.a%s); \
                      :%:replace-outfile(-lobjc -lobjc-gnu )}}\
     %{static|static-libgcc|static-libgfortran:%:replace-outfile(-lgfortran libgfortran.a%s)}\
@@ -4288,6 +6122,33 @@ LANG=C git diff --no-renames --src-prefi
     %{static|static-libgcc|static-libstdc++|static-libgfortran:%:replace-outfile(-lgomp libgomp.a%s)}\
     %{static|static-libgcc|static-libstdc++:%:replace-outfile(-lstdc++ libstdc++.a%s)}\
     %{force_cpusubtype_ALL:-arch %(darwin_arch)} \
+    %{!force_cpusubtype_ALL:-arch %(darwin_subarch)} "\
+    LINK_SYSROOT_SPEC \
+   "%{mmacosx-version-min=*:-macosx_version_min %*} \
++   %{!multiply_defined*:%{shared-libgcc: \
++     %:version-compare(< 10.5 mmacosx-version-min= -multiply_defined) \
++     %:version-compare(< 10.5 mmacosx-version-min= suppress) }} \
+    %{sectalign*} %{sectcreate*} %{sectobjectsymbols*}  %{sectorder*} \
+    %{segaddr*} %{segcreate*} %{segprot*} "
+ 
+@@ -867,13 +863,12 @@ int darwin_label_is_anonymous_local_objc_name (const char *name);
+   if ((LOG) != 0)			\
+     fprintf (FILE, "\t%s\t%d\n", ALIGN_ASM_OP, (LOG))
+ 
+-/* The maximum alignment which the object file format can support in
+-   bits.  For Mach-O, this is 2^15 bytes.  */
++/* The maximum alignment which the object file format can support in bits
++   which depends on the OS version and whether the object is a common
++   variable.  */
+ 
+ #undef	MAX_OFILE_ALIGNMENT
+-#define MAX_OFILE_ALIGNMENT (0x8000 * 8)
+-
+-#define L2_MAX_OFILE_ALIGNMENT 15
++#define MAX_OFILE_ALIGNMENT ((1U << L2_MAX_OFILE_ALIGNMENT) * 8U)
+ 
+ /*  These are the three variants that emit referenced blank space.  */
+ #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN)		\
 --- a/src/gcc/config/i386/avx512fintrin.h
 +++ b/src/gcc/config/i386/avx512fintrin.h
 @@ -3244,31 +3244,67 @@ _mm_maskz_scalef_round_ss (__mmask8 __U, __m128 __A, __m128 __B, const int __R)
@@ -4378,6 +6239,39 @@ LANG=C git diff --no-renames --src-prefi
  #endif
  
  #define _mm_mask_scalef_sd(W, U, A, B) \
+--- a/src/gcc/config/i386/cygwin.h
++++ b/src/gcc/config/i386/cygwin.h
+@@ -57,7 +57,7 @@ along with GCC; see the file COPYING3.  If not see
+ 
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+-  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}\
++  "%{mdaz-ftz:crtfastmath.o%s;Ofast|ffast-math|funsafe-math-optimizations:%{!mno-daz-ftz:crtfastmath.o%s}} \
+    %{!shared:%:if-exists(default-manifest.o%s)}\
+    %{fvtable-verify=none:%s; \
+     fvtable-verify=preinit:vtv_end.o%s; \
+--- a/src/gcc/config/i386/darwin.h
++++ b/src/gcc/config/i386/darwin.h
+@@ -123,7 +123,7 @@ along with GCC; see the file COPYING3.  If not see
+ 
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+-  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
++  "%{mdaz-ftz:crtfastmath.o%s;Ofast|ffast-math|funsafe-math-optimizations:%{!mno-daz-ftz:crtfastmath.o%s}} \
+    %{mpc32:crtprec32.o%s} \
+    %{mpc64:crtprec64.o%s} \
+    %{mpc80:crtprec80.o%s}" TM_DESTRUCTOR
+--- a/src/gcc/config/i386/gnu-user-common.h
++++ b/src/gcc/config/i386/gnu-user-common.h
+@@ -47,7 +47,7 @@ along with GCC; see the file COPYING3.  If not see
+ 
+ /* Similar to standard GNU userspace, but adding -ffast-math support.  */
+ #define GNU_USER_TARGET_MATHFILE_SPEC \
+-  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
++  "%{mdaz-ftz:crtfastmath.o%s;Ofast|ffast-math|funsafe-math-optimizations:%{!mno-daz-ftz:crtfastmath.o%s}} \
+    %{mpc32:crtprec32.o%s} \
+    %{mpc64:crtprec64.o%s} \
+    %{mpc80:crtprec80.o%s}"
 --- a/src/gcc/config/i386/i386-builtin.def
 +++ b/src/gcc/config/i386/i386-builtin.def
 @@ -2742,30 +2742,30 @@ BDESC (0, OPTION_MASK_ISA2_VAES, CODE_FOR_vaesenclast_v64qi, "__builtin_ia32_vae
@@ -4663,6 +6557,28 @@ LANG=C git diff --no-renames --src-prefi
  
  ;; -masm=
  TargetSave
+@@ -416,6 +416,10 @@ mpc80
+ Target RejectNegative
+ Set 80387 floating-point precision to 80-bit.
+ 
++mdaz-ftz
++Target
++Set the FTZ and DAZ Flags.
++
+ mpreferred-stack-boundary=
+ Target RejectNegative Joined UInteger Var(ix86_preferred_stack_boundary_arg)
+ Attempt to keep stack aligned to this power of 2.
+--- a/src/gcc/config/i386/mingw32.h
++++ b/src/gcc/config/i386/mingw32.h
+@@ -197,7 +197,7 @@ along with GCC; see the file COPYING3.  If not see
+ 
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+-  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
++  "%{mdaz-ftz:crtfastmath.o%s;Ofast|ffast-math|funsafe-math-optimizations:%{!mno-daz-ftz:crtfastmath.o%s}} \
+    %{!shared:%:if-exists(default-manifest.o%s)}\
+    %{fvtable-verify=none:%s; \
+     fvtable-verify=preinit:vtv_end.o%s; \
 --- a/src/gcc/config/i386/predicates.md
 +++ b/src/gcc/config/i386/predicates.md
 @@ -1851,11 +1851,11 @@ (define_predicate "encodekey128_operation"
@@ -8951,7 +10867,63 @@ LANG=C git diff --no-renames --src-prefi
  
    else if (<MODE>mode == V8HImode)
      emit_insn (gen_altivec_vupkhsb  (op0, tmp));
-@@ -4892,27 +4892,9 @@ (define_insn "vsx_sign_extend_v2di_v1ti"
+@@ -1972,22 +1972,20 @@ (define_insn "*vsx_tsqrt<mode>2_internal"
+   "x<VSv>tsqrt<sd>p %0,%x1"
+   [(set_attr "type" "<VStype_simple>")])
+ 
+-;; Fused vector multiply/add instructions. Support the classical Altivec
+-;; versions of fma, which allows the target to be a separate register from the
+-;; 3 inputs.  Under VSX, the target must be either the addend or the first
+-;; multiply.
+-
++;; Fused vector multiply/add instructions. Do not generate the Altivec versions
++;; of fma (vmaddfp and vnmsubfp).  These instructions allows the target to be a
++;; separate register from the 3 inputs, but they have different rounding
++;; behaviors than the VSX instructions.
+ (define_insn "*vsx_fmav4sf4"
+-  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa,wa,v")
++  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa,wa")
+ 	(fma:V4SF
+-	  (match_operand:V4SF 1 "vsx_register_operand" "%wa,wa,v")
+-	  (match_operand:V4SF 2 "vsx_register_operand" "wa,0,v")
+-	  (match_operand:V4SF 3 "vsx_register_operand" "0,wa,v")))]
++	  (match_operand:V4SF 1 "vsx_register_operand" "%wa,wa")
++	  (match_operand:V4SF 2 "vsx_register_operand" "wa,0")
++	  (match_operand:V4SF 3 "vsx_register_operand" "0,wa")))]
+   "VECTOR_UNIT_VSX_P (V4SFmode)"
+   "@
+    xvmaddasp %x0,%x1,%x2
+-   xvmaddmsp %x0,%x1,%x3
+-   vmaddfp %0,%1,%2,%3"
++   xvmaddmsp %x0,%x1,%x3"
+   [(set_attr "type" "vecfloat")])
+ 
+ (define_insn "*vsx_fmav2df4"
+@@ -2029,18 +2027,17 @@ (define_insn "*vsx_nfma<mode>4"
+   [(set_attr "type" "<VStype_mul>")])
+ 
+ (define_insn "*vsx_nfmsv4sf4"
+-  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa,wa,v")
++  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa,wa")
+ 	(neg:V4SF
+ 	 (fma:V4SF
+-	   (match_operand:V4SF 1 "vsx_register_operand" "%wa,wa,v")
+-	   (match_operand:V4SF 2 "vsx_register_operand" "wa,0,v")
++	   (match_operand:V4SF 1 "vsx_register_operand" "%wa,wa")
++	   (match_operand:V4SF 2 "vsx_register_operand" "wa,0")
+ 	   (neg:V4SF
+-	     (match_operand:V4SF 3 "vsx_register_operand" "0,wa,v")))))]
++	     (match_operand:V4SF 3 "vsx_register_operand" "0,wa")))))]
+   "VECTOR_UNIT_VSX_P (V4SFmode)"
+   "@
+    xvnmsubasp %x0,%x1,%x2
+-   xvnmsubmsp %x0,%x1,%x3
+-   vnmsubfp %0,%1,%2,%3"
++   xvnmsubmsp %x0,%x1,%x3"
+   [(set_attr "type" "vecfloat")])
+ 
+ (define_insn "*vsx_nfmsv2df4"
+@@ -4892,27 +4889,9 @@ (define_insn "vsx_sign_extend_v2di_v1ti"
   "vextsd2q %0,%1"
  [(set_attr "type" "vecexts")])
  
@@ -8980,7 +10952,7 @@ LANG=C git diff --no-renames --src-prefi
    [(set (match_operand:VSINT_84 0 "vsx_register_operand" "=v")
  	(unspec:VSINT_84
  	 [(match_operand:V16QI 1 "vsx_register_operand" "v")]
-@@ -4921,25 +4903,7 @@ (define_insn "vsx_sign_extend_qi_<mode>"
+@@ -4921,25 +4900,7 @@ (define_insn "vsx_sign_extend_qi_<mode>"
    "vextsb2<wd> %0,%1"
    [(set_attr "type" "vecexts")])
  
@@ -9007,7 +10979,7 @@ LANG=C git diff --no-renames --src-prefi
    [(set (match_operand:VSINT_84 0 "vsx_register_operand" "=v")
  	(unspec:VSINT_84
  	 [(match_operand:V8HI 1 "vsx_register_operand" "v")]
-@@ -4948,25 +4912,7 @@ (define_insn "vsx_sign_extend_hi_<mode>"
+@@ -4948,25 +4909,7 @@ (define_insn "vsx_sign_extend_hi_<mode>"
    "vextsh2<wd> %0,%1"
    [(set_attr "type" "vecexts")])
  
@@ -9034,7 +11006,7 @@ LANG=C git diff --no-renames --src-prefi
    [(set (match_operand:V2DI 0 "vsx_register_operand" "=v")
  	(unspec:V2DI [(match_operand:V4SI 1 "vsx_register_operand" "v")]
  		     UNSPEC_VSX_SIGN_EXTEND))]
-@@ -4974,24 +4920,6 @@ (define_insn "vsx_sign_extend_si_v2di"
+@@ -4974,24 +4917,6 @@ (define_insn "vsx_sign_extend_si_v2di"
    "vextsw2d %0,%1"
    [(set_attr "type" "vecexts")])
  
@@ -10890,9 +12862,133 @@ LANG=C git diff --no-renames --src-prefi
  	  DONE;
  	}
  
+--- a/src/gcc/configure
++++ b/src/gcc/configure
+@@ -27016,7 +27016,7 @@ $as_echo "$as_me: WARNING: LTO for $target requires binutils >= 2.20.1, but vers
+ 	;;
+     esac
+     case $target_os in
+-       darwin2[0-9]* | darwin19*)
++       darwin2* | darwin19*)
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for llvm assembler x86-pad-for-align option" >&5
+ $as_echo_n "checking assembler for llvm assembler x86-pad-for-align option... " >&6; }
+ if ${gcc_cv_as_mllvm_x86_pad_for_align+:} false; then :
+--- a/src/gcc/configure.ac
++++ b/src/gcc/configure.ac
+@@ -4772,7 +4772,7 @@ foo:	nop
+ 	;;
+     esac
+     case $target_os in
+-       darwin2[[0-9]]* | darwin19*)
++       darwin2* | darwin19*)
+         gcc_GAS_CHECK_FEATURE([llvm assembler x86-pad-for-align option],
+           gcc_cv_as_mllvm_x86_pad_for_align,,
+           [-mllvm -x86-pad-for-align=false], [.text],,
 --- a/src/gcc/cp/ChangeLog
 +++ b/src/gcc/cp/ChangeLog
-@@ -1,3 +1,436 @@
+@@ -1,3 +1,538 @@
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2023-03-03  Patrick Palka  <ppalka@redhat.com>
++
++	PR c++/108998
++	* pt.c (el_data::skipped_trees): New data member.
++	(extract_locals_r): Push to skipped_trees any unevaluated
++	contexts that we skipped over.
++	(extract_local_specs): For the second walk, start from each
++	tree in skipped_trees.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2022-12-15  Patrick Palka  <ppalka@redhat.com>
++
++	PR c++/100295
++	PR c++/107579
++	* pt.c (el_data::skip_unevaluated_operands): New data member.
++	(extract_locals_r): If skip_unevaluated_operands is true,
++	don't walk into unevaluated contexts.
++	(extract_local_specs): Walk the pattern twice, first with
++	skip_unevaluated_operands true followed by it set to false.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2022-11-29  Patrick Palka  <ppalka@redhat.com>
++
++	PR c++/107864
++	* decl.c (function_requirements_equivalent_p): Don't check
++	DECL_TEMPLATE_SPECIALIZATION.
++	* pt.c (determine_specialization): Propagate constraints when
++	specializing a function template too.  Simplify by using
++	add_outermost_template_args.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2022-11-03  Patrick Palka  <ppalka@redhat.com>
++
++	PR c++/107179
++	* constraint.cc (tsubst_requires_expr): Make sure we're not
++	deferring access checks.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2022-03-30  Patrick Palka  <ppalka@redhat.com>
++
++	PR c++/100474
++	* constraint.cc (diagnose_trait_expr): Handle all remaining
++	traits appropriately.  Remove default case.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2022-03-12  Patrick Palka  <ppalka@redhat.com>
++
++	PR c++/104527
++	* constraint.cc (normalize_atom): Set
++	ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
++	(get_mapped_args):  Make static, adjust parameters.  Always
++	return a vector whose depth corresponds to the template depth of
++	the context of the atomic constraint expression.  Micro-optimize
++	by passing false as exact to safe_grow_cleared and by collapsing
++	a multi-level depth-one argument vector.
++	(satisfy_atom): Adjust call to get_mapped_args and
++	diagnose_atomic_constraint.
++	(diagnose_atomic_constraint): Replace map parameter with an args
++	parameter.
++	* cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
++	(get_mapped_args): Remove declaration.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2022-01-28  Patrick Palka  <ppalka@redhat.com>
++		    Jason Merrill  <jason@redhat.com>
++
++	PR c++/92752
++	* typeck.c (build_ptrmemfunc): Cast a nullptr constant to the
++	unqualified pointer type not the qualified one.
++
++2023-05-16  Iain Sandoe  <iain@sandoe.co.uk>
++
++	Backported from master:
++	2023-04-09  Iain Sandoe  <iain@sandoe.co.uk>
++
++	* coroutines.cc (coro_rewrite_function_body): Ensure that added
++	bind expressions have scope blocks.
++
++2023-05-16  Iain Sandoe  <iain@sandoe.co.uk>
++
++	Backported from master:
++	2023-04-01  Iain Sandoe  <iain@sandoe.co.uk>
++
++	PR c++/101118
++	* coroutines.cc (flatten_await_stmt): Use the current count of
++	promoted temporaries to build a unique name for the frame entries.
++
 +2023-05-09  Jason Merrill  <jason@redhat.com>
 +
 +	PR c++/106740
@@ -11599,6 +13695,215 @@ LANG=C git diff --no-renames --src-prefi
    tree target = NULL_TREE;
    return potential_constant_expression_1 (t, want_rval, strict, now,
  					  flags, &target);
+--- a/src/gcc/cp/constraint.cc
++++ b/src/gcc/cp/constraint.cc
+@@ -788,6 +788,15 @@ normalize_atom (tree t, tree args, norm_info info)
+   tree ci = build_tree_list (t, info.context);
+ 
+   tree atom = build1 (ATOMIC_CONSTR, ci, map);
++
++  /* Remember whether the expression of this atomic constraint belongs to
++     a concept definition by inspecting in_decl, which should always be set
++     in this case either by norm_info::update_context (when recursing into a
++     concept-id during normalization) or by normalize_concept_definition
++     (when starting out with a concept-id).  */
++  if (info.in_decl && concept_definition_p (info.in_decl))
++    ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P (atom) = true;
++
+   if (!info.generate_diagnostics ())
+     {
+       /* Cache the ATOMIC_CONSTRs that we return, so that sat_hasher::equal
+@@ -2292,6 +2301,9 @@ tsubst_requires_expr (tree t, tree args, sat_info info)
+ {
+   local_specialization_stack stack (lss_copy);
+ 
++  /* We need to check access during the substitution.  */
++  deferring_access_check_sentinel acs (dk_no_deferred);
++
+   /* A requires-expression is an unevaluated context.  */
+   cp_unevaluated u;
+ 
+@@ -2870,33 +2882,37 @@ satisfaction_value (tree t)
+     return boolean_true_node;
+ }
+ 
+-/* Build a new template argument list with template arguments corresponding
+-   to the parameters used in an atomic constraint.  */
++/* Build a new template argument vector corresponding to the parameter
++   mapping of the atomic constraint T, using arguments from ARGS.  */
+ 
+-tree
+-get_mapped_args (tree map)
++static tree
++get_mapped_args (tree t, tree args)
+ {
++  tree map = ATOMIC_CONSTR_MAP (t);
++
+   /* No map, no arguments.  */
+   if (!map)
+     return NULL_TREE;
+ 
+-  /* Find the mapped parameter with the highest level.  */
+-  int count = 0;
+-  for (tree p = map; p; p = TREE_CHAIN (p))
+-    {
+-      int level;
+-      int index;
+-      template_parm_level_and_index (TREE_VALUE (p), &level, &index);
+-      if (level > count)
+-        count = level;
+-    }
++  /* Determine the depth of the resulting argument vector.  */
++  int depth;
++  if (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P (t))
++    /* The expression of this atomic constraint comes from a concept definition,
++       whose template depth is always one, so the resulting argument vector
++       will also have depth one.  */
++    depth = 1;
++  else
++    /* Otherwise, the expression of this atomic constraint comes from
++       the context of the constrained entity, whose template depth is that
++       of ARGS.  */
++    depth = TMPL_ARGS_DEPTH (args);
+ 
+   /* Place each argument at its corresponding position in the argument
+      list. Note that the list will be sparse (not all arguments supplied),
+      but instantiation is guaranteed to only use the parameters in the
+      mapping, so null arguments would never be used.  */
+-  auto_vec< vec<tree> > lists (count);
+-  lists.quick_grow_cleared (count);
++  auto_vec< vec<tree> > lists (depth);
++  lists.quick_grow_cleared (depth);
+   for (tree p = map; p; p = TREE_CHAIN (p))
+     {
+       int level;
+@@ -2906,12 +2922,12 @@ get_mapped_args (tree map)
+       /* Insert the argument into its corresponding position.  */
+       vec<tree> &list = lists[level - 1];
+       if (index >= (int)list.length ())
+-	list.safe_grow_cleared (index + 1, true);
++	list.safe_grow_cleared (index + 1, /*exact=*/false);
+       list[index] = TREE_PURPOSE (p);
+     }
+ 
+   /* Build the new argument list.  */
+-  tree args = make_tree_vec (lists.length ());
++  args = make_tree_vec (lists.length ());
+   for (unsigned i = 0; i != lists.length (); ++i)
+     {
+       vec<tree> &list = lists[i];
+@@ -2923,6 +2939,15 @@ get_mapped_args (tree map)
+     }
+   SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (args, 0);
+ 
++  if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (args)
++      && TMPL_ARGS_DEPTH (args) == 1)
++    {
++      /* Get rid of the redundant outer TREE_VEC.  */
++      tree level = TMPL_ARGS_LEVEL (args, 1);
++      ggc_free (args);
++      args = level;
++    }
++
+   return args;
+ }
+ 
+@@ -2977,7 +3002,7 @@ satisfy_atom (tree t, tree args, sat_info info)
+     }
+ 
+   /* Rebuild the argument vector from the parameter mapping.  */
+-  args = get_mapped_args (map);
++  args = get_mapped_args (t, args);
+ 
+   /* Apply the parameter mapping (i.e., just substitute).  */
+   tree expr = ATOMIC_CONSTR_EXPR (t);
+@@ -2999,7 +3024,7 @@ satisfy_atom (tree t, tree args, sat_info info)
+   if (!same_type_p (TREE_TYPE (result), boolean_type_node))
+     {
+       if (info.noisy ())
+-	diagnose_atomic_constraint (t, map, result, info);
++	diagnose_atomic_constraint (t, args, result, info);
+       return cache.save (inst_cache.save (error_mark_node));
+     }
+ 
+@@ -3018,7 +3043,7 @@ satisfy_atom (tree t, tree args, sat_info info)
+     }
+   result = satisfaction_value (result);
+   if (result == boolean_false_node && info.diagnose_unsatisfaction_p ())
+-    diagnose_atomic_constraint (t, map, result, info);
++    diagnose_atomic_constraint (t, args, result, info);
+ 
+   return cache.save (inst_cache.save (result));
+ }
+@@ -3717,16 +3742,56 @@ diagnose_trait_expr (tree expr, tree args)
+     case CPTK_IS_UNION:
+       inform (loc, "  %qT is not a union", t1);
+       break;
+-    default:
++    case CPTK_IS_AGGREGATE:
++      inform (loc, "  %qT is not an aggregate", t1);
++      break;
++    case CPTK_IS_TRIVIALLY_COPYABLE:
++      inform (loc, "  %qT is not trivially copyable", t1);
++      break;
++    case CPTK_IS_ASSIGNABLE:
++      inform (loc, "  %qT is not assignable from %qT", t1, t2);
++      break;
++    case CPTK_IS_TRIVIALLY_ASSIGNABLE:
++      inform (loc, "  %qT is not trivially assignable from %qT", t1, t2);
++      break;
++    case CPTK_IS_NOTHROW_ASSIGNABLE:
++      inform (loc, "  %qT is not %<nothrow%> assignable from %qT", t1, t2);
++      break;
++    case CPTK_IS_CONSTRUCTIBLE:
++      if (!t2)
++	inform (loc, "  %qT is not default constructible", t1);
++      else
++	inform (loc, "  %qT is not constructible from %qE", t1, t2);
++      break;
++    case CPTK_IS_TRIVIALLY_CONSTRUCTIBLE:
++      if (!t2)
++	inform (loc, "  %qT is not trivially default constructible", t1);
++      else
++	inform (loc, "  %qT is not trivially constructible from %qE", t1, t2);
++      break;
++    case CPTK_IS_NOTHROW_CONSTRUCTIBLE:
++      if (!t2)
++	inform (loc, "  %qT is not %<nothrow%> default constructible", t1);
++      else
++	inform (loc, "  %qT is not %<nothrow%> constructible from %qE", t1, t2);
++      break;
++    case CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS:
++      inform (loc, "  %qT does not have unique object representations", t1);
++      break;
++    case CPTK_BASES:
++    case CPTK_DIRECT_BASES:
++    case CPTK_UNDERLYING_TYPE:
++      /* We shouldn't see these non-expression traits.  */
+       gcc_unreachable ();
++    /* We deliberately omit the default case so that when adding a new
++       trait we'll get reminded (by way of a warning) to handle it here.  */
+     }
+ }
+ 
+-/* Diagnose a substitution failure in the atomic constraint T when applied
+-   with the instantiated parameter mapping MAP.  */
++/* Diagnose a substitution failure in the atomic constraint T using ARGS.  */
+ 
+ static void
+-diagnose_atomic_constraint (tree t, tree map, tree result, sat_info info)
++diagnose_atomic_constraint (tree t, tree args, tree result, sat_info info)
+ {
+   /* If the constraint is already ill-formed, we've previously diagnosed
+      the reason. We should still say why the constraints aren't satisfied.  */
+@@ -3747,7 +3812,6 @@ diagnose_atomic_constraint (tree t, tree map, tree result, sat_info info)
+   /* Generate better diagnostics for certain kinds of expressions.  */
+   tree expr = ATOMIC_CONSTR_EXPR (t);
+   STRIP_ANY_LOCATION_WRAPPER (expr);
+-  tree args = get_mapped_args (map);
+   switch (TREE_CODE (expr))
+     {
+     case TRAIT_EXPR:
 --- a/src/gcc/cp/coroutines.cc
 +++ b/src/gcc/cp/coroutines.cc
 @@ -1016,9 +1016,13 @@ build_co_await (location_t loc, tree a, suspend_point_kind suspend_kind)
@@ -11626,7 +13931,16 @@ LANG=C git diff --no-renames --src-prefi
    tree await_expr = build5_loc (loc, CO_AWAIT_EXPR,
  				TREE_TYPE (TREE_TYPE (awrs_func)),
  				a, e_proxy, o, awaiter_calls,
-@@ -4067,6 +4074,15 @@ coro_rewrite_function_body (location_t fn_start, tree fnbody, tree orig,
+@@ -2867,7 +2874,7 @@ flatten_await_stmt (var_nest_node *n, hash_set<tree> *promoted,
+ 	  tree init = t;
+ 	  temps_used->add (init);
+ 	  tree var_type = TREE_TYPE (init);
+-	  char *buf = xasprintf ("D.%d", DECL_UID (TREE_OPERAND (init, 0)));
++	  char *buf = xasprintf ("T%03u", (unsigned) temps_used->elements ());
+ 	  tree var = build_lang_decl (VAR_DECL, get_identifier (buf), var_type);
+ 	  DECL_ARTIFICIAL (var) = true;
+ 	  free (buf);
+@@ -4067,6 +4074,19 @@ coro_rewrite_function_body (location_t fn_start, tree fnbody, tree orig,
        BLOCK_SUPERCONTEXT (replace_blk) = top_block;
        BLOCK_SUBBLOCKS (top_block) = replace_blk;
      }
@@ -11637,6 +13951,10 @@ LANG=C git diff --no-renames --src-prefi
 +      tree bind_wrap = build3_loc (fn_start, BIND_EXPR, void_type_node,
 +				   NULL, NULL, NULL);
 +      BIND_EXPR_BODY (bind_wrap) = fnbody;
++      /* Ensure we have a block to connect up the scopes.  */
++      tree new_blk = make_node (BLOCK);
++      BIND_EXPR_BLOCK (bind_wrap) = new_blk;
++      BLOCK_SUBBLOCKS (top_block) = new_blk;
 +      fnbody = bind_wrap;
 +    }
  
@@ -11743,7 +14061,27 @@ LANG=C git diff --no-renames --src-prefi
  
 --- a/src/gcc/cp/cp-tree.h
 +++ b/src/gcc/cp/cp-tree.h
-@@ -6789,6 +6789,7 @@ extern void copy_linkage			(tree, tree);
+@@ -466,6 +466,7 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
+       PACK_EXPANSION_SIZEOF_P (in *_PACK_EXPANSION)
+       OVL_USING_P (in OVERLOAD)
+       IMPLICIT_CONV_EXPR_NONTYPE_ARG (in IMPLICIT_CONV_EXPR)
++      ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P (in ATOMIC_CONSTR)
+    2: IDENTIFIER_KIND_BIT_2 (in IDENTIFIER_NODE)
+       ICS_THIS_FLAG (in _CONV)
+       DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (in VAR_DECL)
+@@ -1635,6 +1636,11 @@ check_constraint_info (tree t)
+ #define ATOMIC_CONSTR_MAP_INSTANTIATED_P(NODE) \
+   TREE_LANG_FLAG_0 (ATOMIC_CONSTR_CHECK (NODE))
+ 
++/* Whether the expression for this atomic constraint belongs to a
++   concept definition.  */
++#define ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P(NODE) \
++  TREE_LANG_FLAG_1 (ATOMIC_CONSTR_CHECK (NODE))
++
+ /* The expression of an atomic constraint. */
+ #define ATOMIC_CONSTR_EXPR(NODE) \
+   CONSTR_EXPR (ATOMIC_CONSTR_CHECK (NODE))
+@@ -6789,6 +6795,7 @@ extern void copy_linkage			(tree, tree);
  extern tree get_guard				(tree);
  extern tree get_guard_cond			(tree, bool);
  extern tree set_guard				(tree);
@@ -11751,7 +14089,7 @@ LANG=C git diff --no-renames --src-prefi
  extern tree maybe_get_tls_wrapper_call		(tree);
  extern void mark_needed				(tree);
  extern bool decl_needed_p			(tree);
-@@ -7242,6 +7243,7 @@ extern bool push_tinst_level_loc                (tree, location_t);
+@@ -7242,6 +7249,7 @@ extern bool push_tinst_level_loc                (tree, location_t);
  extern bool push_tinst_level_loc                (tree, tree, location_t);
  extern void pop_tinst_level                     (void);
  extern struct tinst_level *outermost_tinst_level(void);
@@ -11759,9 +14097,28 @@ LANG=C git diff --no-renames --src-prefi
  extern void init_template_processing		(void);
  extern void print_template_statistics		(void);
  bool template_template_parameter_p		(const_tree);
+@@ -8137,7 +8145,6 @@ extern tree evaluate_requires_expr		(tree);
+ extern tree tsubst_constraint                   (tree, tree, tsubst_flags_t, tree);
+ extern tree tsubst_constraint_info              (tree, tree, tsubst_flags_t, tree);
+ extern tree tsubst_parameter_mapping		(tree, tree, tsubst_flags_t, tree);
+-extern tree get_mapped_args			(tree);
+ 
+ struct processing_constraint_expression_sentinel
+ {
 --- a/src/gcc/cp/decl.c
 +++ b/src/gcc/cp/decl.c
-@@ -1059,11 +1059,14 @@ decls_match (tree newdecl, tree olddecl, bool record_versions /* = true */)
+@@ -944,9 +944,7 @@ static bool
+ function_requirements_equivalent_p (tree newfn, tree oldfn)
+ {
+   /* In the concepts TS, the combined constraints are compared.  */
+-  if (cxx_dialect < cxx20
+-      && (DECL_TEMPLATE_SPECIALIZATION (newfn)
+-	  <= DECL_TEMPLATE_SPECIALIZATION (oldfn)))
++  if (cxx_dialect < cxx20)
+     {
+       tree ci1 = get_constraints (oldfn);
+       tree ci2 = get_constraints (newfn);
+@@ -1059,11 +1057,14 @@ decls_match (tree newdecl, tree olddecl, bool record_versions /* = true */)
        if (types_match
  	  && !DECL_EXTERN_C_P (newdecl)
  	  && !DECL_EXTERN_C_P (olddecl)
@@ -11781,7 +14138,7 @@ LANG=C git diff --no-renames --src-prefi
      }
    else if (TREE_CODE (newdecl) == TEMPLATE_DECL)
      {
-@@ -2221,8 +2224,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden)
+@@ -2221,8 +2222,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden)
  	      check_no_redeclaration_friend_default_args
  		(old_result, new_result);
  	    }
@@ -11792,7 +14149,7 @@ LANG=C git diff --no-renames --src-prefi
  
  	  check_default_args (newdecl);
  
-@@ -2523,7 +2526,12 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden)
+@@ -2523,7 +2524,12 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden)
        else
  	{
  	  retrofit_lang_decl (newdecl);
@@ -11806,7 +14163,7 @@ LANG=C git diff --no-renames --src-prefi
  	}
      }
  
-@@ -2581,6 +2589,11 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden)
+@@ -2581,6 +2587,11 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden)
  		TINFO_USED_TEMPLATE_ID (DECL_TEMPLATE_INFO (olddecl))
  		  = TINFO_USED_TEMPLATE_ID (new_template_info);
  	    }
@@ -11818,7 +14175,7 @@ LANG=C git diff --no-renames --src-prefi
  	  DECL_TEMPLATE_INFO (newdecl) = DECL_TEMPLATE_INFO (olddecl);
  	}
  
-@@ -6283,6 +6296,8 @@ reshape_init_array_1 (tree elt_type, tree max_index, reshape_iter *d,
+@@ -6283,6 +6294,8 @@ reshape_init_array_1 (tree elt_type, tree max_index, reshape_iter *d,
        tree elt_init;
        constructor_elt *old_cur = d->cur;
  
@@ -11827,7 +14184,7 @@ LANG=C git diff --no-renames --src-prefi
        check_array_designated_initializer (d->cur, index);
        elt_init = reshape_init_r (elt_type, d,
  				 /*first_initializer_p=*/NULL_TREE,
-@@ -6435,6 +6450,7 @@ reshape_init_class (tree type, reshape_iter *d, bool first_initializer_p,
+@@ -6435,6 +6448,7 @@ reshape_init_class (tree type, reshape_iter *d, bool first_initializer_p,
  	    }
  	  else if (TREE_CODE (d->cur->index) == IDENTIFIER_NODE)
  	    {
@@ -11835,7 +14192,7 @@ LANG=C git diff --no-renames --src-prefi
  	      field = get_class_binding (type, d->cur->index);
  	      direct_desig = true;
  	    }
-@@ -7167,12 +7183,19 @@ check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups)
+@@ -7167,12 +7181,19 @@ check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups)
  	      /* Declared constexpr or constinit, but no suitable initializer;
  		 massage init appropriately so we can pass it into
  		 store_init_value for the error.  */
@@ -11860,7 +14217,7 @@ LANG=C git diff --no-renames --src-prefi
  		    TARGET_EXPR_DIRECT_INIT_P (init) = true;
  		}
  	      init_code = NULL_TREE;
-@@ -7227,6 +7250,10 @@ check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups)
+@@ -7227,6 +7248,10 @@ check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups)
    if (init && init != error_mark_node)
      init_code = build2 (INIT_EXPR, type, decl, init);
  
@@ -11871,7 +14228,7 @@ LANG=C git diff --no-renames --src-prefi
    if (init_code)
      {
        /* We might have set these in cp_finish_decl.  */
-@@ -8221,8 +8248,10 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
+@@ -8221,8 +8246,10 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
  
        if (var_definition_p
  	  /* With -fmerge-all-constants, gimplify_init_constructor
@@ -11884,7 +14241,7 @@ LANG=C git diff --no-renames --src-prefi
  	{
  	  /* If a TREE_READONLY variable needs initialization
  	     at runtime, it is no longer readonly and we need to
-@@ -8240,6 +8269,18 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
+@@ -8240,6 +8267,18 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
  	  if (!decl_maybe_constant_destruction (decl, type))
  	    TREE_READONLY (decl) = 0;
  	}
@@ -11903,7 +14260,7 @@ LANG=C git diff --no-renames --src-prefi
  
        make_rtl_for_nonlocal_decl (decl, init, asmspec);
  
-@@ -8300,7 +8341,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
+@@ -8300,7 +8339,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
      {
        unsigned i; tree t;
        FOR_EACH_VEC_ELT (*cleanups, i, t)
@@ -11912,7 +14269,7 @@ LANG=C git diff --no-renames --src-prefi
        release_tree_vector (cleanups);
      }
  
-@@ -12656,7 +12697,7 @@ grokdeclarator (const cp_declarator *declarator,
+@@ -12656,7 +12695,7 @@ grokdeclarator (const cp_declarator *declarator,
  			  "an array", name);
  		return error_mark_node;
  	      }
@@ -11921,7 +14278,7 @@ LANG=C git diff --no-renames --src-prefi
  	      {
  		error_at (declspecs->locations[ds_constinit],
  			  "%<constinit%> on function return type is not "
-@@ -13862,7 +13903,8 @@ grokdeclarator (const cp_declarator *declarator,
+@@ -13862,7 +13901,8 @@ grokdeclarator (const cp_declarator *declarator,
  		      return error_mark_node;
  		  }
  
@@ -11931,7 +14288,7 @@ LANG=C git diff --no-renames --src-prefi
  				  *attrlist, flags,
  				  funcdef_flag);
  		return decl;
-@@ -14663,8 +14705,6 @@ copy_fn_p (const_tree d)
+@@ -14663,8 +14703,6 @@ copy_fn_p (const_tree d)
  bool
  move_fn_p (const_tree d)
  {
@@ -12316,7 +14673,33 @@ LANG=C git diff --no-renames --src-prefi
  	     (Declarations in precompiled headers that are not definitions
 --- a/src/gcc/cp/pt.c
 +++ b/src/gcc/cp/pt.c
-@@ -5200,8 +5200,9 @@ process_partial_specialization (tree decl)
+@@ -2524,17 +2524,14 @@ determine_specialization (tree template_id,
+     }
+ 
+   /* It was a specialization of a template.  */
+-  targs = DECL_TI_ARGS (DECL_TEMPLATE_RESULT (TREE_VALUE (templates)));
+-  if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (targs))
+-    {
+-      *targs_out = copy_node (targs);
+-      SET_TMPL_ARGS_LEVEL (*targs_out,
+-			   TMPL_ARGS_DEPTH (*targs_out),
+-			   TREE_PURPOSE (templates));
+-    }
+-  else
+-    *targs_out = TREE_PURPOSE (templates);
+-  return TREE_VALUE (templates);
++  tree tmpl = TREE_VALUE (templates);
++  *targs_out = add_outermost_template_args (tmpl, TREE_PURPOSE (templates));
++
++  /* Propagate the template's constraints to the declaration.  */
++  if (tsk != tsk_template)
++    set_constraints (decl, get_constraints (tmpl));
++
++  return tmpl;
+ }
+ 
+ /* Returns a chain of parameter types, exactly like the SPEC_TYPES,
+@@ -5200,8 +5197,9 @@ process_partial_specialization (tree decl)
  	   && !get_partial_spec_bindings (maintmpl, maintmpl, specargs))
      {
        auto_diagnostic_group d;
@@ -12328,7 +14711,7 @@ LANG=C git diff --no-renames --src-prefi
  	inform (DECL_SOURCE_LOCATION (maintmpl), "primary template %qD",
  		maintmpl);
      }
-@@ -10889,7 +10890,7 @@ uses_template_parms (tree t)
+@@ -10889,7 +10887,7 @@ uses_template_parms (tree t)
  		   || uses_template_parms (TREE_CHAIN (t)));
    else if (TREE_CODE (t) == TYPE_DECL)
      dependent_p = dependent_type_p (TREE_TYPE (t));
@@ -12337,7 +14720,7 @@ LANG=C git diff --no-renames --src-prefi
      dependent_p = false;
    else
      dependent_p = instantiation_dependent_expression_p (t);
-@@ -11136,6 +11137,33 @@ outermost_tinst_level (void)
+@@ -11136,6 +11134,33 @@ outermost_tinst_level (void)
    return level;
  }
  
@@ -12371,7 +14754,7 @@ LANG=C git diff --no-renames --src-prefi
  /* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL.  ARGS is the
     vector of template arguments, as for tsubst.
  
-@@ -11236,9 +11264,10 @@ tsubst_friend_function (tree decl, tree args)
+@@ -11236,9 +11261,10 @@ tsubst_friend_function (tree decl, tree args)
        tree new_friend_template_info = DECL_TEMPLATE_INFO (new_friend);
        tree new_friend_result_template_info = NULL_TREE;
        bool new_friend_is_defn =
@@ -12385,7 +14768,7 @@ LANG=C git diff --no-renames --src-prefi
        tree not_tmpl = new_friend;
  
        if (TREE_CODE (new_friend) == TEMPLATE_DECL)
-@@ -12641,7 +12670,13 @@ gen_elem_of_pack_expansion_instantiation (tree pattern,
+@@ -12641,7 +12667,13 @@ gen_elem_of_pack_expansion_instantiation (tree pattern,
      t = tsubst_expr (pattern, args, complain, in_decl,
  		     /*integral_constant_expression_p=*/false);
    else
@@ -12400,7 +14783,59 @@ LANG=C git diff --no-renames --src-prefi
  
    /*  If the Ith argument pack element is a pack expansion, then
        the Ith element resulting from the substituting is going to
-@@ -14037,6 +14072,10 @@ tsubst_function_decl (tree t, tree args, tsubst_flags_t complain,
+@@ -12893,17 +12925,29 @@ public:
+   /* List of local_specializations used within the pattern.  */
+   tree extra;
+   tsubst_flags_t complain;
++  /* True iff we don't want to walk into unevaluated contexts.  */
++  bool skip_unevaluated_operands = false;
++  /* The unevaluated contexts that we avoided walking.  */
++  auto_vec<tree> skipped_trees;
+ 
+   el_data (tsubst_flags_t c)
+     : extra (NULL_TREE), complain (c) {}
+ };
+ static tree
+-extract_locals_r (tree *tp, int */*walk_subtrees*/, void *data_)
++extract_locals_r (tree *tp, int *walk_subtrees, void *data_)
+ {
+   el_data &data = *reinterpret_cast<el_data*>(data_);
+   tree *extra = &data.extra;
+   tsubst_flags_t complain = data.complain;
+ 
++  if (data.skip_unevaluated_operands
++      && unevaluated_p (TREE_CODE (*tp)))
++    {
++      data.skipped_trees.safe_push (*tp);
++      *walk_subtrees = 0;
++      return NULL_TREE;
++    }
++
+   if (TYPE_P (*tp) && typedef_variant_p (*tp))
+     /* Remember local typedefs (85214).  */
+     tp = &TYPE_NAME (*tp);
+@@ -12995,7 +13039,20 @@ static tree
+ extract_local_specs (tree pattern, tsubst_flags_t complain)
+ {
+   el_data data (complain);
++  /* Walk the pattern twice, ignoring unevaluated operands the first time
++     around, so that if a local specialization appears in both an evaluated
++     and unevaluated context we prefer to process it in the evaluated context
++     (since e.g. process_outer_var_ref is a no-op inside an unevaluated
++     context).  */
++  data.skip_unevaluated_operands = true;
+   cp_walk_tree (&pattern, extract_locals_r, &data, &data.visited);
++  /* Now walk the unevaluated contexts we skipped the first time around.  */
++  data.skip_unevaluated_operands = false;
++  for (tree t : data.skipped_trees)
++    {
++      data.visited.remove (t);
++      cp_walk_tree (&t, extract_locals_r, &data, &data.visited);
++    }
+   return data.extra;
+ }
+ 
+@@ -14037,6 +14094,10 @@ tsubst_function_decl (tree t, tree args, tsubst_flags_t complain,
  	  && !LAMBDA_FUNCTION_P (t))
  	return t;
  
@@ -12411,7 +14846,7 @@ LANG=C git diff --no-renames --src-prefi
        /* Calculate the most general template of which R is a
  	 specialization.  */
        gen_tmpl = most_general_template (DECL_TI_TEMPLATE (t));
-@@ -14072,7 +14111,7 @@ tsubst_function_decl (tree t, tree args, tsubst_flags_t complain,
+@@ -14072,7 +14133,7 @@ tsubst_function_decl (tree t, tree args, tsubst_flags_t complain,
        /* This special case arises when we have something like this:
  
  	 template <class T> struct S {
@@ -12420,7 +14855,7 @@ LANG=C git diff --no-renames --src-prefi
  	 };
  
  	 Here, the DECL_TI_TEMPLATE for the friend declaration
-@@ -14080,6 +14119,7 @@ tsubst_function_decl (tree t, tree args, tsubst_flags_t complain,
+@@ -14080,6 +14141,7 @@ tsubst_function_decl (tree t, tree args, tsubst_flags_t complain,
  	 tsubst_friend_function, and we want only to create a
  	 new decl (R) with appropriate types so that we can call
  	 determine_specialization.  */
@@ -12428,7 +14863,7 @@ LANG=C git diff --no-renames --src-prefi
        gen_tmpl = NULL_TREE;
        argvec = NULL_TREE;
      }
-@@ -14269,7 +14309,7 @@ tsubst_function_decl (tree t, tree args, tsubst_flags_t complain,
+@@ -14269,7 +14331,7 @@ tsubst_function_decl (tree t, tree args, tsubst_flags_t complain,
        /* If this is an instantiation of a member template, clone it.
  	 If it isn't, that'll be handled by
  	 clone_constructors_and_destructors.  */
@@ -12437,7 +14872,7 @@ LANG=C git diff --no-renames --src-prefi
  	clone_cdtor (r, /*update_methods=*/false);
      }
    else if ((complain & tf_error) != 0
-@@ -15110,6 +15150,12 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
+@@ -15110,6 +15172,12 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
  	  {
  	    DECL_ORIGINAL_TYPE (r) = NULL_TREE;
  	    set_underlying_type (r);
@@ -12450,7 +14885,7 @@ LANG=C git diff --no-renames --src-prefi
  	  }
  
  	layout_decl (r, 0);
-@@ -16404,7 +16450,8 @@ tsubst_baselink (tree baselink, tree object_type,
+@@ -16404,7 +16472,8 @@ tsubst_baselink (tree baselink, tree object_type,
  
    tree binfo_type = BINFO_TYPE (BASELINK_BINFO (baselink));
    binfo_type = tsubst (binfo_type, args, complain, in_decl);
@@ -12460,7 +14895,7 @@ LANG=C git diff --no-renames --src-prefi
  
    if (dependent_p)
      {
-@@ -18507,6 +18554,11 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
+@@ -18507,6 +18576,11 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
  		    tree asmspec_tree = NULL_TREE;
  		    maybe_push_decl (decl);
  
@@ -12472,7 +14907,7 @@ LANG=C git diff --no-renames --src-prefi
  		    if (VAR_P (decl)
  			&& DECL_DECOMPOSITION_P (decl)
  			&& TREE_TYPE (pattern_decl) != error_mark_node)
-@@ -23410,6 +23462,8 @@ unify_pack_expansion (tree tparms, tree targs, tree packed_parms,
+@@ -23410,6 +23484,8 @@ unify_pack_expansion (tree tparms, tree targs, tree packed_parms,
  	     arguments if it is not otherwise deduced.  */
  	  if (cxx_dialect >= cxx20
  	      && TREE_VEC_LENGTH (new_args) < TREE_VEC_LENGTH (old_args)
@@ -12481,7 +14916,7 @@ LANG=C git diff --no-renames --src-prefi
  	      && builtin_guide_p (TPARMS_PRIMARY_TEMPLATE (tparms)))
  	    TREE_VEC_LENGTH (old_args) = TREE_VEC_LENGTH (new_args);
  	  if (!comp_template_args (old_args, new_args,
-@@ -23928,7 +23982,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
+@@ -23928,7 +24004,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
  	      /* Now check whether the type of this parameter is still
  		 dependent, and give up if so.  */
  	      ++processing_template_decl;
@@ -12490,7 +14925,7 @@ LANG=C git diff --no-renames --src-prefi
  	      --processing_template_decl;
  	      if (uses_template_parms (tparm))
  		return unify_success (explain_p);
-@@ -28726,7 +28780,7 @@ rewrite_template_parm (tree olddecl, unsigned index, unsigned level,
+@@ -28726,7 +28802,7 @@ rewrite_template_parm (tree olddecl, unsigned index, unsigned level,
  	  const int depth = TMPL_ARGS_DEPTH (tsubst_args);
  	  tree ttargs = make_tree_vec (depth + 1);
  	  for (int i = 0; i < depth; ++i)
@@ -12499,7 +14934,7 @@ LANG=C git diff --no-renames --src-prefi
  	  TREE_VEC_ELT (ttargs, depth)
  	    = template_parms_level_to_args (ttparms);
  	  // Substitute ttargs into ttparms to fix references to
-@@ -28739,8 +28793,17 @@ rewrite_template_parm (tree olddecl, unsigned index, unsigned level,
+@@ -28739,8 +28815,17 @@ rewrite_template_parm (tree olddecl, unsigned index, unsigned level,
  	  ttparms = tsubst_template_parms_level (ttparms, ttargs,
  						 complain);
  	  // Finally, tack the adjusted parms onto tparms.
@@ -12519,7 +14954,7 @@ LANG=C git diff --no-renames --src-prefi
  	  DECL_TEMPLATE_PARMS (newdecl) = ttparms;
  	}
      }
-@@ -29238,6 +29301,11 @@ alias_ctad_tweaks (tree tmpl, tree uguides)
+@@ -29238,6 +29323,11 @@ alias_ctad_tweaks (tree tmpl, tree uguides)
  	      ++ndlen;
  	  tree gtparms = make_tree_vec (natparms + ndlen);
  
@@ -12676,6 +15111,17 @@ LANG=C git diff --no-renames --src-prefi
  
        if (TREE_SIDE_EFFECTS (pfn))
  	pfn = save_expr (pfn);
+@@ -9251,7 +9266,9 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p,
+   /* Handle null pointer to member function conversions.  */
+   if (null_ptr_cst_p (pfn))
+     {
+-      pfn = cp_build_c_cast (input_location, type, pfn, complain);
++      pfn = cp_build_c_cast (input_location,
++			     TYPE_PTRMEMFUNC_FN_TYPE_RAW (to_type),
++			     pfn, complain);
+       return build_ptrmemfunc1 (to_type,
+ 				integer_zero_node,
+ 				pfn);
 --- a/src/gcc/cse.c
 +++ b/src/gcc/cse.c
 @@ -1190,14 +1190,14 @@ compute_const_anchors (rtx cst,
@@ -13757,7 +16203,17 @@ LANG=C git diff --no-renames --src-prefi
        if ((tem = fold_truth_andor (loc, code, type, arg0, arg1, op0, op1))
 --- a/src/gcc/fortran/ChangeLog
 +++ b/src/gcc/fortran/ChangeLog
-@@ -1,3 +1,516 @@
+@@ -1,3 +1,526 @@
++2023-05-20  Harald Anlauf  <anlauf@gmx.de>
++
++	Backported from master:
++	2023-05-15  Harald Anlauf  <anlauf@gmx.de>
++
++	PR fortran/109846
++	* expr.c (gfc_check_vardef_context): Check appropriate pointer
++	attribute for CLASS vs. non-CLASS function result in variable
++	definition context.
++
 +2023-05-02  Jakub Jelinek  <jakub@redhat.com>
 +
 +	Backported from master:
@@ -14437,6 +16893,15 @@ LANG=C git diff --no-renames --src-prefi
  	{
  	  if (!simplify_parameter_variable (p, type))
  	    return false;
+@@ -6224,7 +6235,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
+       && !(sym->attr.flavor == FL_PROCEDURE && sym == sym->result)
+       && !(sym->attr.flavor == FL_PROCEDURE && sym->attr.proc_pointer)
+       && !(sym->attr.flavor == FL_PROCEDURE
+-	   && sym->attr.function && sym->attr.pointer))
++	   && sym->attr.function && attr.pointer))
+     {
+       if (context)
+ 	gfc_error ("%qs in variable definition context (%s) at %L is not"
 --- a/src/gcc/fortran/f95-lang.c
 +++ b/src/gcc/fortran/f95-lang.c
 @@ -696,31 +696,34 @@ gfc_init_builtin_functions (void)
@@ -17215,7 +19680,108 @@ new file mode 100644
    /* Getter for summary callgraph edge pointer.
 --- a/src/gcc/testsuite/ChangeLog
 +++ b/src/gcc/testsuite/ChangeLog
-@@ -1,3 +1,2191 @@
+@@ -1,3 +1,2292 @@
++2023-05-22   Michael Meissner  <meissner@linux.ibm.com>
++
++	PR target/70243
++	* gcc.target/powerpc/pr70243.c: New test.  Back port from master
++	04/10/2023.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2023-03-03  Patrick Palka  <ppalka@redhat.com>
++
++	PR c++/108998
++	* g++.dg/cpp2a/lambda-generic11.C: New test.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2022-12-15  Patrick Palka  <ppalka@redhat.com>
++
++	PR c++/100295
++	PR c++/107579
++	* g++.dg/cpp1z/constexpr-if-lambda5.C: New test.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2022-11-29  Patrick Palka  <ppalka@redhat.com>
++
++	PR c++/107864
++	* g++.dg/concepts/explicit-spec1a.C: New test.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2022-11-03  Patrick Palka  <ppalka@redhat.com>
++
++	PR c++/107179
++	* g++.dg/cpp2a/concepts-requires31.C: New test.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2022-03-30  Patrick Palka  <ppalka@redhat.com>
++
++	PR c++/100474
++	* g++.dg/cpp2a/concepts-traits3.C: New test.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2022-03-12  Patrick Palka  <ppalka@redhat.com>
++
++	PR c++/104527
++	* g++.dg/cpp2a/concepts-return-req4.C: New test.
++
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2022-01-28  Patrick Palka  <ppalka@redhat.com>
++		    Jason Merrill  <jason@redhat.com>
++
++	PR c++/92752
++	* g++.dg/warn/Wignored-qualifiers2.C: New test.
++
++2023-05-20  Harald Anlauf  <anlauf@gmx.de>
++
++	Backported from master:
++	2023-05-15  Harald Anlauf  <anlauf@gmx.de>
++
++	PR fortran/109846
++	* gfortran.dg/ptr-func-5.f90: New test.
++
++2023-05-16  Iain Sandoe  <iain@sandoe.co.uk>
++
++	Backported from master:
++	2021-12-24  Iain Sandoe  <iain@sandoe.co.uk>
++
++	* gcc.dg/darwin-aligned-globals.c: New test.
++	* gcc.dg/darwin-comm-1.c: New test.
++	* gcc.dg/attr-aligned.c: Amend for new alignment values on
++	Darwin.
++	* gcc.target/i386/pr89261.c: Likewise.
++
++2023-05-16  François-Xavier Coudert  <fxcoudert@gcc.gnu.org>
++
++	Backported from master:
++	2021-12-18  François-Xavier Coudert  <fxcoudert@gcc.gnu.org>
++
++	* gcc.dg/darwin-minversion-link.c: Test darwin21.
++	* obj-c++.dg/cxx-ivars-3.mm: Homogeneize darwin versions.
++	* obj-c++.dg/objc-gc-3.mm: Homogeneize darwin versions.
++	* objc.dg/objc-gc-4.m: Homogeneize darwin versions.
++
++2023-05-10  Richard Biener  <rguenther@suse.de>
++
++	Backported from master:
++	2023-03-02  Richard Biener  <rguenther@suse.de>
++
++	PR testsuite/108985
++	* gcc.dg/vect/pr108950.c: Require vect_simd_clones.
++
 +2023-05-09  Jakub Jelinek  <jakub@redhat.com>
 +
 +	Backported from master:
@@ -19724,6 +22290,21 @@ new file mode 100644
 +/* { dg-output "division by zero" } */
 new file mode 100644
 --- /dev/null
++++ b/src/gcc/testsuite/g++.dg/concepts/explicit-spec1a.C
+@@ -0,0 +1,11 @@
++// A version of explicit-spec1.C where the template g has trailing instead of
++// template requirements.
++// PR c++/107864
++// { dg-do compile { target concepts } }
++
++template<typename T> concept C = __is_class(T);
++struct Y { int n; } y;
++template<class T> void g(T) requires C<T> { }
++int called;
++template<> void g(Y) { called = 3; }
++int main() { g(y); }
+new file mode 100644
+--- /dev/null
 +++ b/src/gcc/testsuite/g++.dg/coroutines/co-await-initlist1.C
 @@ -0,0 +1,21 @@
 +// PR c++/103871
@@ -20418,6 +22999,25 @@ new file mode 100644
 +}
 new file mode 100644
 --- /dev/null
++++ b/src/gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda5.C
+@@ -0,0 +1,15 @@
++// PR c++/100295
++// { dg-do compile { target c++17 } }
++
++template<typename... Ts>
++void f(Ts... ts) {
++  auto lambda = [=](auto x) {
++    if constexpr (sizeof((ts+x) + ...) != 0)
++      (..., ts);
++  };
++  lambda(0);
++}
++
++int main() {
++  f(0, 'a');
++}
+new file mode 100644
+--- /dev/null
 +++ b/src/gcc/testsuite/g++.dg/cpp1z/decomp57.C
 @@ -0,0 +1,27 @@
 +// PR c++/108474
@@ -20586,6 +23186,123 @@ new file mode 100644
 +}
 new file mode 100644
 --- /dev/null
++++ b/src/gcc/testsuite/g++.dg/cpp2a/concepts-requires31.C
+@@ -0,0 +1,15 @@
++// PR c++/107179
++// { dg-do compile { target c++20 } }
++
++template<bool B> struct bool_constant { static constexpr bool value = B; };
++
++template<typename T>
++  struct is_implicitly_default_constructible
++  : bool_constant<requires { T(); }>
++  { };
++
++struct X { private: X(); };
++struct Y { };
++
++static_assert( !is_implicitly_default_constructible<X>::value );
++static_assert(  is_implicitly_default_constructible<Y>::value );
+new file mode 100644
+--- /dev/null
++++ b/src/gcc/testsuite/g++.dg/cpp2a/concepts-return-req4.C
+@@ -0,0 +1,24 @@
++// PR c++/104527
++// { dg-do compile { target c++20 } }
++
++template<class T, class U>
++concept is_same = __is_same(T, U);
++
++template<class T>
++struct A {
++  template<class...>
++    requires requires { { 0 } -> is_same<T>; }
++  struct B {};
++
++  template<class...>
++    requires requires { { 1 } -> is_same<T>; }
++  static void f();
++};
++
++A<int>::B<> a1;
++A<bool>::B<> a2; // { dg-error "constraint" }
++
++int main() {
++  A<int>::f();
++  A<bool>::f(); // { dg-error "no match" }
++}
+new file mode 100644
+--- /dev/null
++++ b/src/gcc/testsuite/g++.dg/cpp2a/concepts-traits3.C
+@@ -0,0 +1,66 @@
++// PR c++/100474
++// { dg-do compile { target c++20 } }
++
++struct S { S() = delete; S(const S&); };
++
++template<class T>
++concept Aggregate = __is_aggregate(T);
++// { dg-message "'S' is not an aggregate" "" { target *-*-* } .-1  }
++
++template<class T>
++concept TriviallyCopyable = __is_trivially_copyable(T);
++// { dg-message "'S' is not trivially copyable" "" { target *-*-* } .-1  }
++
++template<class T, class U>
++concept Assignable = __is_assignable(T, U);
++// { dg-message "'S' is not assignable from 'int'" "" { target *-*-* } .-1  }
++
++template<class T, class U>
++concept TriviallyAssignable = __is_trivially_assignable(T, U);
++// { dg-message "'S' is not trivially assignable from 'int'" "" { target *-*-* } .-1  }
++
++template<class T, class U>
++concept NothrowAssignable = __is_nothrow_assignable(T, U);
++// { dg-message "'S' is not 'nothrow' assignable from 'int'" "" { target *-*-* } .-1  }
++
++template<class T, class... Args>
++concept Constructible = __is_constructible(T, Args...);
++// { dg-message "'S' is not default constructible" "" { target *-*-* } .-1  }
++// { dg-message "'S' is not constructible from 'int'" "" { target *-*-* } .-2  }
++// { dg-message "'S' is not constructible from 'int, char'" "" { target *-*-* } .-3  }
++
++template<class T, class... Args>
++concept TriviallyConstructible = __is_trivially_constructible(T, Args...);
++// { dg-message "'S' is not trivially default constructible" "" { target *-*-* } .-1  }
++// { dg-message "'S' is not trivially constructible from 'int'" "" { target *-*-* } .-2  }
++// { dg-message "'S' is not trivially constructible from 'int, char'" "" { target *-*-* } .-3  }
++
++template<class T, class... Args>
++concept NothrowConstructible = __is_nothrow_constructible(T, Args...);
++// { dg-message "'S' is not 'nothrow' default constructible" "" { target *-*-* } .-1  }
++// { dg-message "'S' is not 'nothrow' constructible from 'int'" "" { target *-*-* } .-2  }
++// { dg-message "'S' is not 'nothrow' constructible from 'int, char'" "" { target *-*-* } .-3  }
++
++template<class T>
++concept UniqueObjReps = __has_unique_object_representations(T);
++// { dg-message "'S' does not have unique object representations" "" { target *-*-* } .-1  }
++
++static_assert(Aggregate<S>); // { dg-error "assert" }
++static_assert(TriviallyCopyable<S>); // { dg-error "assert" }
++static_assert(Assignable<S, int>); // { dg-error "assert" }
++static_assert(TriviallyAssignable<S, int>); // { dg-error "assert" }
++static_assert(NothrowAssignable<S, int>); // { dg-error "assert" }
++
++static_assert(Constructible<S>); // { dg-error "assert" }
++static_assert(Constructible<S, int>); // { dg-error "assert" }
++static_assert(Constructible<S, int, char>); // { dg-error "assert" }
++
++static_assert(TriviallyConstructible<S>); // { dg-error "assert" }
++static_assert(TriviallyConstructible<S, int>); // { dg-error "assert" }
++static_assert(TriviallyConstructible<S, int, char>); // { dg-error "assert" }
++
++static_assert(NothrowConstructible<S>); // { dg-error "assert" }
++static_assert(NothrowConstructible<S, int>); // { dg-error "assert" }
++static_assert(NothrowConstructible<S, int, char>); // { dg-error "assert" }
++
++static_assert(UniqueObjReps<S>); // { dg-error "assert" }
+new file mode 100644
+--- /dev/null
 +++ b/src/gcc/testsuite/g++.dg/cpp2a/constinit18.C
 @@ -0,0 +1,12 @@
 +// PR c++/104066
@@ -20646,6 +23363,23 @@ new file mode 100644
 +}
 new file mode 100644
 --- /dev/null
++++ b/src/gcc/testsuite/g++.dg/cpp2a/lambda-generic11.C
+@@ -0,0 +1,13 @@
++// PR c++/108999
++// { dg-do compile { target c++20 } }
++
++template<typename T>
++void ice(T a) {
++  auto aa = a;
++  auto lambda = []<int I>() {
++    if constexpr (sizeof(aa) + I != 42) { }
++  };
++  lambda.template operator()<17>();
++}
++
++template void ice(int);
+new file mode 100644
+--- /dev/null
 +++ b/src/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init7.C
 @@ -0,0 +1,18 @@
 +// PR c++/102629
@@ -21936,6 +24670,27 @@ new file mode 100644
 +}
 new file mode 100644
 --- /dev/null
++++ b/src/gcc/testsuite/g++.dg/warn/Wignored-qualifiers2.C
+@@ -0,0 +1,17 @@
++// PR c++/92752
++// { dg-do compile }
++// { dg-additional-options "-Wignored-qualifiers" }
++
++struct X;
++
++template<class T>
++struct Wrap {
++  T data;
++  Wrap() : data() {}
++};
++
++typedef int (X::*type)();
++Wrap<const type> x;
++#if __cpp_initializer_lists
++const type t{};
++#endif
+new file mode 100644
+--- /dev/null
 +++ b/src/gcc/testsuite/g++.dg/warn/Wmismatched-tags-10.C
 @@ -0,0 +1,10 @@
 +// PR c++/105725
@@ -23158,6 +25913,72 @@ new file mode 100644
 +  float b[200000000];
 +  bar (a, b);
 +}
+--- a/src/gcc/testsuite/gcc.dg/attr-aligned.c
++++ b/src/gcc/testsuite/gcc.dg/attr-aligned.c
+@@ -12,8 +12,12 @@
+ #  define ALIGN_MAX_STATIC      0x1000
+    /* Excessive alignment for functions and objects with static storage
+       duration that's expected to trigger an error.  */
+-#elif __MACH__
+-#  define ALIGN_MAX_STATIC      0x8000
++#elif __APPLE__
++# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070
++#   define ALIGN_MAX_STATIC      0x8000
++# else
++#   define ALIGN_MAX_STATIC      ALIGN_MAX_HARD
++# endif
+ #elif pdp11
+ #  define ALIGN_MAX_STATIC      2
+ /* Work around a pdp11 ICE (see PR target/87821).  */
+new file mode 100644
+--- /dev/null
++++ b/src/gcc/testsuite/gcc.dg/darwin-aligned-globals.c
+@@ -0,0 +1,24 @@
++/* { dg-do compile { target *-*-darwin* } } */
++/* { dg-additional-options "-fcommon" } */
++
++/* Test alignment rules which differ for earlier hosts (so we must
++   work on the principle that this test will be exercised by self-
++   hosted compilers. */
++
++#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1070
++#define align_OK (1ul << 28)
++#define align_BAD (1ul << 29)
++#else
++#define align_OK (1ul << 15)
++#define align_BAD (1ul << 16)
++#endif
++
++/* All non common vars are allowed larger alignment on modern systems.  */
++static int xn __attribute__ ((aligned (align_OK)));
++static int xi __attribute__ ((aligned (align_OK))) = 5  ;
++int gxi __attribute__ ((aligned (align_OK))) = 6 ;
++
++/* test that we detect bad cases.  */
++static int yn __attribute__ ((aligned (align_BAD))); /* { dg-error {requested alignment .[0-9]+. exceeds object file maximum} } */
++static int yi __attribute__ ((aligned (align_BAD))) = 5;  /* { dg-error {requested alignment .[0-9]+. exceeds object file maximum} } */
++int yni __attribute__ ((aligned (align_BAD))) = 6;  /* { dg-error {requested alignment .[0-9]+. exceeds object file maximum} } */
+new file mode 100644
+--- /dev/null
++++ b/src/gcc/testsuite/gcc.dg/darwin-comm-1.c
+@@ -0,0 +1,5 @@
++/* { dg-do compile { target *-*-darwin[912]* } } */
++/* { dg-options "-fcommon" } */
++
++/* In all cases, common has a max alignment of 2^15.  */
++int badcommon __attribute__ ((aligned (65536))); /* { dg-error "common variables must have an alignment" } */
+--- a/src/gcc/testsuite/gcc.dg/darwin-minversion-link.c
++++ b/src/gcc/testsuite/gcc.dg/darwin-minversion-link.c
+@@ -15,7 +15,8 @@
+ /* { dg-additional-options "-mmacosx-version-min=010.013.06 -DCHECK=101306" { target *-*-darwin17* } } */
+ /* { dg-additional-options "-mmacosx-version-min=010.014.05 -DCHECK=101405" { target *-*-darwin18* } } */
+ /* { dg-additional-options "-mmacosx-version-min=010.015.06 -DCHECK=101506" { target *-*-darwin19* } } */
+-/* { dg-additional-options "-mmacosx-version-min=011.000.00 -DCHECK=110000" { target *-*-darwin20 } } */
++/* { dg-additional-options "-mmacosx-version-min=011.000.00 -DCHECK=110000" { target *-*-darwin20* } } */
++/* { dg-additional-options "-mmacosx-version-min=012.000.00 -DCHECK=120000" { target *-*-darwin21* } } */
+ 
+ int
+ main ()
 new file mode 100644
 --- /dev/null
 +++ b/src/gcc/testsuite/gcc.dg/dfp/pr108068.c
@@ -26635,6 +29456,17 @@ new file mode 100644
 +{
 +  b += a;
 +}
+--- a/src/gcc/testsuite/gcc.target/i386/pr89261.c
++++ b/src/gcc/testsuite/gcc.target/i386/pr89261.c
+@@ -5,6 +5,7 @@
+ typedef double __v2df __attribute__ ((vector_size (16), aligned (1 << 28)));
+ 
+ __v2df foo = { 1.0, 2.0 };
+-/* { dg-error {alignment of 'foo' is greater than maximum object file alignment 32768} "" { target *-*-darwin* } .-1 } */
++/* { dg-error {alignment of 'foo' is greater than maximum object file alignment 32768} "" { target { *-*-darwin[89]*  *-*-darwin10* } } .-1 } */
+ 
+ /* { dg-final { scan-assembler "\.align\[ \t]+268435456" { target { ! *-*-darwin* } } } } */
++/* { dg-final { scan-assembler "\.align\[ \t]+28" { target { *-*-darwin1[1-9]* *-*-darwin2* } } } } */
 --- a/src/gcc/testsuite/gcc.target/i386/sse-14.c
 +++ b/src/gcc/testsuite/gcc.target/i386/sse-14.c
 @@ -429,7 +429,9 @@ test_3 (_mm_maskz_mul_round_sd, __m128d, __mmask8, __m128d, __m128d, 9)
@@ -27932,6 +30764,51 @@ new file mode 100644
 +
 new file mode 100644
 --- /dev/null
++++ b/src/gcc/testsuite/gcc.target/powerpc/pr70243.c
+@@ -0,0 +1,41 @@
++/* { dg-do compile */
++/* { dg-require-effective-target powerpc_vsx_ok } */
++/* { dg-options "-O2 -mvsx" } */
++
++/* PR 70423, Make sure we don't generate vmaddfp or vnmsubfp.  These
++   instructions have different rounding modes than the VSX instructions
++   xvmaddsp and xvnmsubsp.  These tests are written where the 3 inputs and
++   target are all separate registers.  Because vmaddfp and vnmsubfp are no
++   longer generated the compiler will have to generate an xsmaddsp or xsnmsubsp
++   instruction followed by a move operation.  */
++
++#include <altivec.h>
++
++vector float
++do_add1 (vector float dummy, vector float a, vector float b, vector float c)
++{
++  return (a * b) + c;
++}
++
++vector float
++do_nsub1 (vector float dummy, vector float a, vector float b, vector float c)
++{
++  return -((a * b) - c);
++}
++
++vector float
++do_add2 (vector float dummy, vector float a, vector float b, vector float c)
++{
++  return vec_madd (a, b, c);
++}
++
++vector float
++do_nsub2 (vector float dummy, vector float a, vector float b, vector float c)
++{
++  return vec_nmsub (a, b, c);
++}
++
++/* { dg-final { scan-assembler     {\mxvmadd[am]sp\M}  } } */
++/* { dg-final { scan-assembler     {\mxvnmsub[am]sp\M} } } */
++/* { dg-final { scan-assembler-not {\mvmaddfp\M}       } } */
++/* { dg-final { scan-assembler-not {\mvnmsubfp\M}      } } */
+new file mode 100644
+--- /dev/null
 +++ b/src/gcc/testsuite/gcc.target/powerpc/pr96072.c
 @@ -0,0 +1,14 @@
 +/* { dg-options "-O2" } */
@@ -29839,6 +32716,49 @@ new file mode 100644
 +end
 new file mode 100644
 --- /dev/null
++++ b/src/gcc/testsuite/gfortran.dg/ptr-func-5.f90
+@@ -0,0 +1,39 @@
++! { dg-do compile }
++! PR fortran/109846
++! CLASS pointer function result in variable definition context
++
++module foo
++  implicit none
++  type :: parameter_list
++  contains
++    procedure :: sublist, sublist_nores
++  end type
++contains
++  function sublist (this) result (slist)
++    class(parameter_list), intent(inout) :: this
++    class(parameter_list), pointer       :: slist
++    allocate (slist)
++  end function
++  function sublist_nores (this)
++    class(parameter_list), intent(inout) :: this
++    class(parameter_list), pointer       :: sublist_nores
++    allocate (sublist_nores)
++  end function
++end module
++
++program example
++  use foo
++  implicit none
++  type(parameter_list) :: plist
++  call sub1 (plist%sublist())
++  call sub1 (plist%sublist_nores())
++  call sub2 (plist%sublist())
++  call sub2 (plist%sublist_nores())
++contains
++  subroutine sub1 (plist)
++    type(parameter_list), intent(inout) :: plist
++  end subroutine
++  subroutine sub2 (plist)
++    type(parameter_list) :: plist
++  end subroutine
++end program
+new file mode 100644
+--- /dev/null
 +++ b/src/gcc/testsuite/gfortran.dg/save_7.f90
 @@ -0,0 +1,17 @@
 +! { dg-do compile }
@@ -30331,6 +33251,39 @@ new file mode 100644
      }]
  }
  
+--- a/src/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm
++++ b/src/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm
+@@ -2,7 +2,7 @@
+ 
+ // { dg-do run { target *-*-darwin* } }
+ // { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } }
+-// { dg-skip-if "Headers incompatible with 10.4 APIs" { *-*-darwin1[1-9]* *-*-darwin2[0-9]* } { "-fnext-runtime" } { "" } }
++// { dg-skip-if "Headers incompatible with 10.4 APIs" { *-*-darwin1[1-9]* *-*-darwin2* } { "-fnext-runtime" } { "" } }
+ // { dg-additional-options "-fobjc-call-cxx-cdtors -mmacosx-version-min=10.4 -framework Foundation" }
+ // This test has no equivalent or meaning for m64/ABI V2
+ // { dg-xfail-run-if "No Test Avail" {  *-*-darwin* && lp64 } { "-fnext-runtime" } { "" } }
+--- a/src/gcc/testsuite/obj-c++.dg/objc-gc-3.mm
++++ b/src/gcc/testsuite/obj-c++.dg/objc-gc-3.mm
+@@ -3,7 +3,7 @@
+ /* Contributed by Ziemowit Laski <zlaski@apple.com>  */
+ 
+ /* { dg-do compile } */
+-/* { dg-skip-if "GC API is an error from Darwin16." { *-*-darwin1[6-9]* *-*-darwin2[0-9]* } { "-fnext-runtime" } { "" } } */
++/* { dg-skip-if "GC API is an error from Darwin16." { *-*-darwin1[6-9]* *-*-darwin2* } { "-fnext-runtime" } { "" } } */
+ /* { dg-options "-fobjc-gc" } */
+ /* { dg-prune-output "cc1objplus: warning: '-fobjc-gc' is ignored for '-fgnu-runtime'" } */
+ 
+--- a/src/gcc/testsuite/objc.dg/objc-gc-4.m
++++ b/src/gcc/testsuite/objc.dg/objc-gc-4.m
+@@ -3,7 +3,7 @@
+ /* Contributed by Ziemowit Laski <zlaski@apple.com>  */
+ 
+ /* { dg-do compile } */
+-/* { dg-skip-if "GC API is an error from Darwin16." { *-*-darwin1[6-9]* *-*-darwin2[0-9]* } { "-fnext-runtime" } { "" } } */
++/* { dg-skip-if "GC API is an error from Darwin16." { *-*-darwin1[6-9]* *-*-darwin2* } { "-fnext-runtime" } { "" } } */
+ /* { dg-options "-fobjc-gc" } */
+ /* { dg-prune-output "cc1obj: warning: '-fobjc-gc' is ignored for '-fgnu-runtime'" } */
+ 
 --- a/src/gcc/tree-if-conv.c
 +++ b/src/gcc/tree-if-conv.c
 @@ -1419,10 +1419,20 @@ if_convertible_loop_p_1 (class loop *loop, vec<data_reference_p> *refs)
@@ -32288,7 +35241,32 @@ new file mode 100644
  	    SYNTAX_ERROR2_AT (op.loc,
 --- a/src/libgcc/ChangeLog
 +++ b/src/libgcc/ChangeLog
-@@ -1,3 +1,9 @@
+@@ -1,3 +1,34 @@
++2023-05-21  Iain Sandoe  <iain@sandoe.co.uk>
++
++	Backported from master:
++	2023-05-19  Iain Sandoe  <iain@sandoe.co.uk>
++
++	* config.host: Arrange to set min Darwin OS versions from
++	the configured host version.
++	* config/darwin10-unwind-find-enc-func.c: Do not use current
++	headers, but declare the nexessary structures locally to the
++	versions in use for Mac OSX 10.6.
++	* config/t-darwin: Amend to handle configured min OS
++	versions.
++	* config/t-darwin-min-1: New.
++	* config/t-darwin-min-5: New.
++	* config/t-darwin-min-8: New.
++
++2023-05-16  Iain Sandoe  <iain@sandoe.co.uk>
++
++	Backported from master:
++	2022-12-24  Iain Sandoe  <iain@sandoe.co.uk>
++
++	* config/t-slibgcc-darwin (install-darwin-libgcc-stubs): Skip the
++	install of libgcc_s.1.dylib when the installation is into the build
++	gcc directory.
++
 +2022-05-16  Sebastian Pop  <spop@amazon.com>
 +
 +	PR target/105162
@@ -32298,6 +35276,33 @@ new file mode 100644
  2022-04-21  Release Manager
  
  	* GCC 11.3.0 released.
+--- a/src/libgcc/config.host
++++ b/src/libgcc/config.host
+@@ -225,6 +225,24 @@ case ${host} in
+       ;;
+   esac
+   tmake_file="$tmake_file t-slibgcc-darwin"
++  # newer toolsets produce warnings when building for unsupported versions.
++  case ${host} in
++    *-*-darwin1[89]* | *-*-darwin2* )
++      tmake_file="t-darwin-min-8 $tmake_file"
++      ;;
++    *-*-darwin9* | *-*-darwin1[0-7]*)
++      tmake_file="t-darwin-min-5 $tmake_file"
++      ;;
++    *-*-darwin[4-8]*)
++      tmake_file="t-darwin-min-1 $tmake_file"
++      ;;
++    *)
++      # Fall back to configuring for the oldest system known to work with
++      # all archs and the current sources.
++      tmake_file="t-darwin-min-5 $tmake_file"
++      echo "Warning: libgcc configured to support macOS 10.5" 1>&2
++      ;;
++  esac
+   extra_parts="crt3.o libd10-uwfef.a crttms.o crttme.o libemutls_w.a"
+   ;;
+ *-*-dragonfly*)
 --- a/src/libgcc/config/aarch64/lse.S
 +++ b/src/libgcc/config/aarch64/lse.S
 @@ -87,24 +87,44 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
@@ -32512,6 +35517,163 @@ new file mode 100644
      ret
  
  .Lset_0xffff:
+--- a/src/libgcc/config/darwin10-unwind-find-enc-func.c
++++ b/src/libgcc/config/darwin10-unwind-find-enc-func.c
+@@ -1,8 +1,34 @@
+-#include "tconfig.h"
+-#include "tsystem.h"
+-#include "unwind-dw2-fde.h"
+ #include "libgcc_tm.h"
+ 
++/* This shim is special, it needs to be built for Mac OSX 10.6
++   regardless of the current system version.
++   We must also build it to use the unwinder layout that was
++   present for 10.6 (and not update that).
++   So we copy the referenced structures from unwind-dw2-fde.h
++   to avoid pulling in newer system headers and/or changed
++   layouts.  */
++struct dwarf_eh_bases
++{
++  void *tbase;
++  void *dbase;
++  void *func;
++};
++
++typedef          int  sword __attribute__ ((mode (SI)));
++typedef unsigned int  uword __attribute__ ((mode (SI)));
++
++/* The first few fields of an FDE.  */
++struct dwarf_fde
++{
++  uword length;
++  sword CIE_delta;
++  unsigned char pc_begin[];
++} __attribute__ ((packed, aligned (__alignof__ (void *))));
++
++typedef struct dwarf_fde fde;
++
++extern const fde * _Unwind_Find_FDE (void *, struct dwarf_eh_bases *);
++
+ void *
+ _darwin10_Unwind_FindEnclosingFunction (void *pc)
+ {
+@@ -10,5 +36,5 @@ _darwin10_Unwind_FindEnclosingFunction (void *pc)
+   const struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases);
+   if (fde)
+     return bases.func;
+-  return NULL;
++  return (void *) 0;
+ }
+--- a/src/libgcc/config/t-darwin
++++ b/src/libgcc/config/t-darwin
+@@ -1,15 +1,15 @@
+ # Set this as a minimum (unless overriden by arch t-files) since it's a
+ # reasonable lowest common denominator that works for all our archs.
+-HOST_LIBGCC2_CFLAGS += -mmacosx-version-min=10.4
++HOST_LIBGCC2_CFLAGS += $(DARWIN_MIN_LIB_VERSION)
+ 
+ crt3.o: $(srcdir)/config/darwin-crt3.c
+-	$(crt_compile) -mmacosx-version-min=10.4 -c $<
++	$(crt_compile) $(DARWIN_MIN_CRT_VERSION) -c $<
+ 
+ crttms.o: $(srcdir)/config/darwin-crt-tm.c
+-	$(crt_compile) -mmacosx-version-min=10.4 -DSTART -c $<
++	$(crt_compile) $(DARWIN_MIN_CRT_VERSION) -DSTART -c $<
+ 
+ crttme.o: $(srcdir)/config/darwin-crt-tm.c
+-	$(crt_compile) -mmacosx-version-min=10.4 -DEND -c $<
++	$(crt_compile) $(DARWIN_MIN_CRT_VERSION) -DEND -c $<
+ 
+ # Make emutls weak so that we can deal with -static-libgcc, override the
+ # hidden visibility when this is present in libgcc_eh.
+@@ -25,6 +25,8 @@ libemutls_w.a: emutls_s.o
+ 	$(RANLIB_FOR_TARGET) $@
+ 
+ # Patch to __Unwind_Find_Enclosing_Function for Darwin10.
++# This needs to be built for darwin10, regardless of the current platform
++# version.
+ d10-uwfef.o: $(srcdir)/config/darwin10-unwind-find-enc-func.c libgcc_tm.h
+ 	$(crt_compile) -mmacosx-version-min=10.6 -c $<
+ 
+new file mode 100644
+--- /dev/null
++++ b/src/libgcc/config/t-darwin-min-1
+@@ -0,0 +1,3 @@
++# Support building with -mmacosx-version-min back to 10.1.
++DARWIN_MIN_LIB_VERSION = -mmacosx-version-min=10.4
++DARWIN_MIN_CRT_VERSION = -mmacosx-version-min=10.1
+new file mode 100644
+--- /dev/null
++++ b/src/libgcc/config/t-darwin-min-5
+@@ -0,0 +1,3 @@
++# Support building with -mmacosx-version-min back to 10.5.
++DARWIN_MIN_LIB_VERSION = -mmacosx-version-min=10.5
++DARWIN_MIN_CRT_VERSION = -mmacosx-version-min=10.5
+new file mode 100644
+--- /dev/null
++++ b/src/libgcc/config/t-darwin-min-8
+@@ -0,0 +1,3 @@
++# Support building with -mmacosx-version-min back to 10.8.
++DARWIN_MIN_LIB_VERSION = -mmacosx-version-min=10.8
++DARWIN_MIN_CRT_VERSION = -mmacosx-version-min=10.8
+--- a/src/libgcc/config/t-slibgcc-darwin
++++ b/src/libgcc/config/t-slibgcc-darwin
+@@ -72,14 +72,15 @@ all: libgcc_ehs$(SHLIB_EXT)
+ LGCC_FILES += libgcc_ehs.$(SHLIB_SOVERSION)$(SHLIB_EXT)
+ 
+ endif
+-
+-# Provide libgcc_s.1 for backwards compatibility.
+-LGCC_FILES += libgcc_s.1.dylib
+-
+ endif
+ 
+ INSTALL_FILES=$(LGCC_FILES)
+ 
++ifeq ($(BUILD_LIBGCCS1),YES)
++# Provide libgcc_s.1 for backwards compatibility.
++INSTALL_FILES += libgcc_s.1.dylib
++endif
++
+ # For the toplevel multilib, build FAT dylibs including all the multilibs.
+ ifeq ($(MULTIBUILDTOP),)
+ 
+@@ -158,9 +159,15 @@ endif
+ 
+ install-darwin-libgcc-stubs :
+ 	$(mkinstalldirs) $(DESTDIR)$(slibdir)
+-	for d in $(INSTALL_FILES) ; do \
+-	  $(INSTALL_DATA) $$d $(DESTDIR)$(slibdir)/$$d || exit 1 ; \
+-	done
++	if test x$(slibdir) = x; then \
++	  for d in $(LGCC_FILES) ; do \
++	    $(INSTALL_DATA) $$d $(DESTDIR)$(slibdir)/$$d || exit 1 ; \
++	  done; \
++	else \
++	  for d in $(INSTALL_FILES) ; do \
++	    $(INSTALL_DATA) $$d $(DESTDIR)$(slibdir)/$$d || exit 1 ; \
++	  done; \
++	fi
+ 
+ else
+ 
+--- a/src/libgo/go/syscall/libcall_linux.go
++++ b/src/libgo/go/syscall/libcall_linux.go
+@@ -188,6 +188,14 @@ func Gettid() (tid int) {
+ //sys	PivotRoot(newroot string, putold string) (err error)
+ //pivot_root(newroot *byte, putold *byte) _C_int
+ 
++// Used by golang.org/x/sys/unix.
++//sys	prlimit(pid int, resource int, newlimit *Rlimit, oldlimit *Rlimit) (err error)
++//prlimit(pid Pid_t, resource _C_int, newlimit *Rlimit, oldlimit *Rlimit) _C_int
++
++func Prlimit(pid int, resource int, newlimit *Rlimit, oldlimit *Rlimit) error {
++	return prlimit(pid, resource, newlimit, oldlimit)
++}
++
+ //sys	Removexattr(path string, attr string) (err error)
+ //removexattr(path *byte, name *byte) _C_int
+ 
 --- a/src/libgo/sysinfo.c
 +++ b/src/libgo/sysinfo.c
 @@ -158,9 +158,6 @@
@@ -33543,7 +36705,15 @@ new file mode 100644
  				   quot, BITS_PER_MP_LIMB - 1 - used,
 --- a/src/libsanitizer/ChangeLog
 +++ b/src/libsanitizer/ChangeLog
-@@ -1,3 +1,12 @@
+@@ -1,3 +1,20 @@
++2023-05-16  Iain Sandoe  <iain@sandoe.co.uk>
++
++	Backported from master:
++	2023-04-18  Iain Sandoe  <iain@sandoe.co.uk>
++
++	* configure.tgt: Unsupport Darwin22+ until a mechanism can be found
++	to locate dyld in the shared cache.
++
 +2023-01-04  Florian Weimer  <fweimer@redhat.com>
 +
 +	Backported from master:
@@ -33578,6 +36748,17 @@ new file mode 100644
        syscall (__NR_gettid);
        syscall (__NR_futex);
        syscall (__NR_exit_group);
+--- a/src/libsanitizer/configure.tgt
++++ b/src/libsanitizer/configure.tgt
+@@ -63,7 +63,7 @@ case "${target}" in
+ 		HWASAN_SUPPORTED=yes
+ 	fi
+ 	;;
+-  x86_64-*-darwin2* | x86_64-*-darwin1[2-9]* | i?86-*-darwin1[2-9]*)
++  x86_64-*-darwin2[01]* | x86_64-*-darwin1[2-9]* | i?86-*-darwin1[2-8]*)
+ 	TSAN_SUPPORTED=no
+ 	EXTRA_CXXFLAGS+="-Wl,-undefined,dynamic_lookup"
+ 	;;
 --- a/src/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
 +++ b/src/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
 @@ -72,7 +72,9 @@
@@ -33607,7 +36788,171 @@ new file mode 100644
    unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
 --- a/src/libstdc++-v3/ChangeLog
 +++ b/src/libstdc++-v3/ChangeLog
-@@ -1,3 +1,1260 @@
+@@ -1,3 +1,1424 @@
++2023-05-22  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2023-03-14  Patrick Palka  <ppalka@redhat.com>
++
++	* include/bits/stl_iterator.h (move_iterator::_S_iter_concept):
++	Define.
++	(__cpp_lib_move_iterator_concept): Define for C++20.
++	(move_iterator::iterator_concept): Strengthen as per P2520R0.
++	* include/std/version (__cpp_lib_move_iterator_concept): Define
++	for C++20.
++	* testsuite/24_iterators/move_iterator/p2520r0.cc: New test.
++
++2023-05-16  Jonathan Wakely  <jwakely@redhat.com>
++
++	Backported from master:
++	2022-11-28  Jonathan Wakely  <jwakely@redhat.com>
++
++	PR libstdc++/107801
++	* src/c++17/memory_resource.cc (chunk::_M_bytes): Change type
++	from uint32_t to bitset::size_type. Adjust static assertion.
++	(__pool_resource::_Pool::replenish): Cast to size_t after
++	multiplication instead of before.
++	(__pool_resource::_M_alloc_pools): Ensure both arguments to
++	std::max have type size_t.
++
++2023-05-16  Jonathan Wakely  <jwakely@redhat.com>
++
++	Backported from master:
++	2022-11-22  Jonathan Wakely  <jwakely@redhat.com>
++
++	PR libstdc++/107801
++	* src/c++17/memory_resource.cc (pool_sizes): Disable large pools
++	for targets with 16-bit int.
++
++2023-05-16  Jonathan Wakely  <jwakely@redhat.com>
++
++	Backported from master:
++	2022-09-23  Jonathan Wakely  <jwakely@redhat.com>
++
++	PR libstdc++/91456
++	* include/std/type_traits (__is_nothrow_invocable): Remove.
++	(__is_invocable_impl::__nothrow_type): New member type which
++	checks if the conversion can throw.
++	(__is_nt_invocable_impl): Replace class template with alias
++	template to __is_nt_invocable_impl::__nothrow_type.
++	* testsuite/20_util/is_nothrow_invocable/91456.cc: New test.
++	* testsuite/20_util/is_nothrow_convertible/value.cc: Remove
++	macro used by value_ext.cc test.
++	* testsuite/20_util/is_nothrow_convertible/value_ext.cc: Remove
++	test for non-standard __is_nothrow_invocable trait.
++
++2023-05-16  Jonathan Wakely  <jwakely@redhat.com>
++
++	Backported from master:
++	2022-09-08  Jonathan Wakely  <jwakely@redhat.com>
++
++	* include/c_global/cstddef (byte): Add always_inline attribute
++	to all operator overloads.
++	(to_integer): Add always_inline attribute.
++
++2023-05-16  Jonathan Wakely  <jwakely@redhat.com>
++
++	Backported from master:
++	2022-07-01  Jonathan Wakely  <jwakely@redhat.com>
++
++	* include/bits/fs_ops.h: Add nodiscard to all pure functions.
++	* include/experimental/bits/fs_ops.h: Likewise.
++	* testsuite/27_io/filesystem/operations/all.cc: Do not discard
++	results of absolute and canonical.
++	* testsuite/27_io/filesystem/operations/absolute.cc: Cast
++	discarded result to void.
++	* testsuite/27_io/filesystem/operations/canonical.cc: Likewise.
++	* testsuite/27_io/filesystem/operations/exists.cc: Likewise.
++	* testsuite/27_io/filesystem/operations/is_empty.cc: Likewise.
++	* testsuite/27_io/filesystem/operations/read_symlink.cc:
++	Likewise.
++	* testsuite/27_io/filesystem/operations/status.cc: Likewise.
++	* testsuite/27_io/filesystem/operations/symlink_status.cc:
++	Likewise.
++	* testsuite/27_io/filesystem/operations/temp_directory_path.cc:
++	Likewise.
++	* testsuite/experimental/filesystem/operations/canonical.cc:
++	Likewise.
++	* testsuite/experimental/filesystem/operations/exists.cc:
++	Likewise.
++	* testsuite/experimental/filesystem/operations/is_empty.cc:
++	Likewise.
++	* testsuite/experimental/filesystem/operations/read_symlink.cc:
++	Likewise.
++	* testsuite/experimental/filesystem/operations/temp_directory_path.cc:
++	Likewise.
++
++2023-05-16  Jonathan Wakely  <jwakely@redhat.com>
++
++	Backported from master:
++	2023-02-02  Jonathan Wakely  <jwakely@redhat.com>
++
++	* include/std/variant (variant::operator=): Implement resolution
++	of LWG 3585.
++	* testsuite/20_util/variant/lwg3585.cc: New test.
++
++2023-05-16  Jonathan Wakely  <jwakely@redhat.com>
++
++	Backported from master:
++	2022-11-11  Jonathan Wakely  <jwakely@redhat.com>
++
++	* testsuite/20_util/tuple/swap.cc (MoveOnly::operator==): Add
++	const qualifier.
++	* testsuite/26_numerics/valarray/87641.cc (X::operator==):
++	Likewise.
++
++2023-05-16  Jonathan Wakely  <jwakely@redhat.com>
++
++	Backported from master:
++	2022-03-14  Jonathan Wakely  <jwakely@redhat.com>
++
++	PR libstdc++/104875
++	* src/c++11/codecvt.cc (read_utf8_code_point): Use char32_t to
++	hold octets that will be left-shifted.
++
++2023-05-16  Jonathan Wakely  <jwakely@redhat.com>
++
++	Backported from master:
++	2022-11-03  Jonathan Wakely  <jwakely@redhat.com>
++
++	* include/bits/ranges_algobase.h (__detail::__copy_or_move):
++	Move output iterator.
++	* testsuite/25_algorithms/copy/constrained.cc: Check copying to
++	move-only output iterator.
++
++2023-05-16  Jonathan Wakely  <jwakely@redhat.com>
++
++	Backported from master:
++	2022-12-16  Jonathan Wakely  <jwakely@redhat.com>
++
++	PR libstdc++/108118
++	* include/bits/shared_ptr_base.h (weak_ptr::operator=):
++	Implement as move-and-swap exactly as specified in the standard.
++	* testsuite/20_util/weak_ptr/cons/self_move.cc: New test.
++
++2023-05-16  Jonathan Wakely  <jwakely@redhat.com>
++
++	Backported from master:
++	2023-01-05  Jonathan Wakely  <jwakely@redhat.com>
++
++	PR libstdc++/108265
++	* include/std/chrono (hh_mm_ss): Do not use chrono::abs if
++	duration rep is unsigned. Remove incorrect noexcept-specifier.
++	* testsuite/std/time/hh_mm_ss/1.cc: Check unsigned rep. Check
++	floating-point representations. Check default construction.
++
++2023-05-12  Patrick Palka  <ppalka@redhat.com>
++
++	Backported from master:
++	2023-04-24  Patrick Palka  <ppalka@redhat.com>
++
++	* include/bits/max_size_type.h (__max_diff_type::operator>>=):
++	Fix propagation of sign bit.
++	* testsuite/std/ranges/iota/max_size_type.cc: Avoid using the
++	non-standard 'signed typedef-name'.  Add some compile-time tests
++	for right-shifting a negative __max_diff_type value by more than
++	one.
++
 +2023-05-03  Jonathan Wakely  <jwakely@redhat.com>
 +
 +	PR libstdc++/105844
@@ -36120,6 +39465,284 @@ new file mode 100644
  	_Node_base* __node = &this->_M_impl._M_head;
  	while (__node->_M_next && __list._M_impl._M_head._M_next)
  	  {
+--- a/src/libstdc++-v3/include/bits/fs_ops.h
++++ b/src/libstdc++-v3/include/bits/fs_ops.h
+@@ -44,10 +44,16 @@ namespace filesystem
+    *  @{
+    */
+ 
++  [[nodiscard]]
+   path absolute(const path& __p);
++
++  [[nodiscard]]
+   path absolute(const path& __p, error_code& __ec);
+ 
++  [[nodiscard]]
+   path canonical(const path& __p);
++
++  [[nodiscard]]
+   path canonical(const path& __p, error_code& __ec);
+ 
+   inline void
+@@ -100,25 +106,34 @@ namespace filesystem
+   void create_symlink(const path& __to, const path& __new_symlink,
+ 		      error_code& __ec) noexcept;
+ 
++  [[nodiscard]]
+   path current_path();
++
++  [[nodiscard]]
+   path current_path(error_code& __ec);
++
+   void current_path(const path& __p);
+   void current_path(const path& __p, error_code& __ec) noexcept;
+ 
++  [[nodiscard]]
+   bool
+   equivalent(const path& __p1, const path& __p2);
+ 
++  [[nodiscard]]
+   bool
+   equivalent(const path& __p1, const path& __p2, error_code& __ec) noexcept;
+ 
++  [[nodiscard]]
+   inline bool
+   exists(file_status __s) noexcept
+   { return status_known(__s) && __s.type() != file_type::not_found; }
+ 
++  [[nodiscard]]
+   inline bool
+   exists(const path& __p)
+   { return exists(status(__p)); }
+ 
++  [[nodiscard]]
+   inline bool
+   exists(const path& __p, error_code& __ec) noexcept
+   {
+@@ -131,63 +146,85 @@ namespace filesystem
+     return false;
+   }
+ 
++  [[nodiscard]]
+   uintmax_t file_size(const path& __p);
++
++  [[nodiscard]]
+   uintmax_t file_size(const path& __p, error_code& __ec) noexcept;
+ 
++  [[nodiscard]]
+   uintmax_t hard_link_count(const path& __p);
++
++  [[nodiscard]]
+   uintmax_t hard_link_count(const path& __p, error_code& __ec) noexcept;
+ 
++  [[nodiscard]]
+   inline bool
+   is_block_file(file_status __s) noexcept
+   { return __s.type() == file_type::block; }
+ 
++  [[nodiscard]]
+   inline bool
+   is_block_file(const path& __p)
+   { return is_block_file(status(__p)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_block_file(const path& __p, error_code& __ec) noexcept
+   { return is_block_file(status(__p, __ec)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_character_file(file_status __s) noexcept
+   { return __s.type() == file_type::character; }
+ 
++  [[nodiscard]]
+   inline bool
+   is_character_file(const path& __p)
+   { return is_character_file(status(__p)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_character_file(const path& __p, error_code& __ec) noexcept
+   { return is_character_file(status(__p, __ec)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_directory(file_status __s) noexcept
+   { return __s.type() == file_type::directory; }
+ 
++  [[nodiscard]]
+   inline bool
+   is_directory(const path& __p)
+   { return is_directory(status(__p)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_directory(const path& __p, error_code& __ec) noexcept
+   { return is_directory(status(__p, __ec)); }
+ 
++  [[nodiscard]]
+   bool is_empty(const path& __p);
++
++  [[nodiscard]]
+   bool is_empty(const path& __p, error_code& __ec);
+ 
++  [[nodiscard]]
+   inline bool
+   is_fifo(file_status __s) noexcept
+   { return __s.type() == file_type::fifo; }
+ 
++  [[nodiscard]]
+   inline bool
+   is_fifo(const path& __p)
+   { return is_fifo(status(__p)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_fifo(const path& __p, error_code& __ec) noexcept
+   { return is_fifo(status(__p, __ec)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_other(file_status __s) noexcept
+   {
+@@ -195,52 +232,67 @@ namespace filesystem
+       && !is_symlink(__s);
+   }
+ 
++  [[nodiscard]]
+   inline bool
+   is_other(const path& __p)
+   { return is_other(status(__p)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_other(const path& __p, error_code& __ec) noexcept
+   { return is_other(status(__p, __ec)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_regular_file(file_status __s) noexcept
+   { return __s.type() == file_type::regular; }
+ 
++  [[nodiscard]]
+   inline bool
+   is_regular_file(const path& __p)
+   { return is_regular_file(status(__p)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_regular_file(const path& __p, error_code& __ec) noexcept
+   { return is_regular_file(status(__p, __ec)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_socket(file_status __s) noexcept
+   { return __s.type() == file_type::socket; }
+ 
++  [[nodiscard]]
+   inline bool
+   is_socket(const path& __p)
+   { return is_socket(status(__p)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_socket(const path& __p, error_code& __ec) noexcept
+   { return is_socket(status(__p, __ec)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_symlink(file_status __s) noexcept
+   { return __s.type() == file_type::symlink; }
+ 
++  [[nodiscard]]
+   inline bool
+   is_symlink(const path& __p)
+   { return is_symlink(symlink_status(__p)); }
+ 
++  [[nodiscard]]
+   inline bool
+   is_symlink(const path& __p, error_code& __ec) noexcept
+   { return is_symlink(symlink_status(__p, __ec)); }
+ 
++  [[nodiscard]]
+   file_time_type  last_write_time(const path& __p);
++
++  [[nodiscard]]
+   file_time_type  last_write_time(const path& __p, error_code& __ec) noexcept;
++
+   void last_write_time(const path& __p, file_time_type __new_time);
+   void last_write_time(const path& __p, file_time_type __new_time,
+ 		       error_code& __ec) noexcept;
+@@ -257,19 +309,30 @@ namespace filesystem
+   permissions(const path& __p, perms __prms, perm_options __opts,
+ 	      error_code& __ec) noexcept;
+ 
++  [[nodiscard]]
+   inline path proximate(const path& __p, error_code& __ec)
+   { return proximate(__p, current_path(), __ec); }
+ 
++  [[nodiscard]]
+   path proximate(const path& __p, const path& __base = current_path());
++
++  [[nodiscard]]
+   path proximate(const path& __p, const path& __base, error_code& __ec);
+ 
++  [[nodiscard]]
+   path read_symlink(const path& __p);
++
++  [[nodiscard]]
+   path read_symlink(const path& __p, error_code& __ec);
+ 
++  [[nodiscard]]
+   inline path relative(const path& __p, error_code& __ec)
+   { return relative(__p, current_path(), __ec); }
+ 
++  [[nodiscard]]
+   path relative(const path& __p, const path& __base = current_path());
++
++  [[nodiscard]]
+   path relative(const path& __p, const path& __base, error_code& __ec);
+ 
+   bool remove(const path& __p);
+@@ -284,22 +347,38 @@ namespace filesystem
+   void resize_file(const path& __p, uintmax_t __size);
+   void resize_file(const path& __p, uintmax_t __size, error_code& __ec) noexcept;
+ 
++  [[nodiscard]]
+   space_info space(const path& __p);
++
++  [[nodiscard]]
+   space_info space(const path& __p, error_code& __ec) noexcept;
+ 
++  [[nodiscard]]
+   file_status status(const path& __p);
++
++  [[nodiscard]]
+   file_status status(const path& __p, error_code& __ec) noexcept;
+ 
++  [[nodiscard]]
+   inline bool status_known(file_status __s) noexcept
+   { return __s.type() != file_type::none; }
+ 
++  [[nodiscard]]
+   file_status symlink_status(const path& __p);
++
++  [[nodiscard]]
+   file_status symlink_status(const path& __p, error_code& __ec) noexcept;
+ 
++  [[nodiscard]]
+   path temp_directory_path();
++
++  [[nodiscard]]
+   path temp_directory_path(error_code& __ec);
+ 
++  [[nodiscard]]
+   path weakly_canonical(const path& __p);
++
++  [[nodiscard]]
+   path weakly_canonical(const path& __p, error_code& __ec);
+ 
+   /// @} group filesystem
 --- a/src/libstdc++-v3/include/bits/fs_path.h
 +++ b/src/libstdc++-v3/include/bits/fs_path.h
 @@ -558,12 +558,7 @@ namespace __detail
@@ -36371,6 +39994,18 @@ new file mode 100644
  
    /// @} group numeric_arrays
  
+--- a/src/libstdc++-v3/include/bits/max_size_type.h
++++ b/src/libstdc++-v3/include/bits/max_size_type.h
+@@ -559,7 +559,8 @@ namespace ranges
+ 	// Arithmetic right shift.
+ 	const auto __msb = _M_rep._M_msb;
+ 	_M_rep >>= __r._M_rep;
+-	_M_rep._M_msb |= __msb;
++	if (__msb)
++	  _M_rep |= ~(__max_size_type(-1) >> __r._M_rep);
+ 	return *this;
+       }
+ 
 --- a/src/libstdc++-v3/include/bits/random.tcc
 +++ b/src/libstdc++-v3/include/bits/random.tcc
 @@ -1955,7 +1955,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -36382,6 +40017,17 @@ new file mode 100644
  	    {
  	      __x._M_saved_available = __saved_avail;
  	      __x.param(param_type(__mean, __stddev));
+--- a/src/libstdc++-v3/include/bits/ranges_algobase.h
++++ b/src/libstdc++-v3/include/bits/ranges_algobase.h
+@@ -238,7 +238,7 @@ namespace ranges
+ 	{
+ 	  auto [__in,__out]
+ 	    = ranges::__copy_or_move<_IsMove>(__first.base(), __last.base(),
+-					      __result);
++					      std::move(__result));
+ 	  return {decltype(__first){__in}, std::move(__out)};
+ 	}
+       else if constexpr (__is_normal_iterator<_Out>)
 --- a/src/libstdc++-v3/include/bits/ranges_base.h
 +++ b/src/libstdc++-v3/include/bits/ranges_base.h
 @@ -379,6 +379,8 @@ namespace ranges
@@ -37525,6 +41171,19 @@ new file mode 100644
        else if (__c != ']' && __c != '}')
  	{
  	  auto __it = _M_token_tbl;
+--- a/src/libstdc++-v3/include/bits/shared_ptr_base.h
++++ b/src/libstdc++-v3/include/bits/shared_ptr_base.h
+@@ -1666,9 +1666,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+       __weak_ptr&
+       operator=(__weak_ptr&& __r) noexcept
+       {
+-	_M_ptr = __r._M_ptr;
+-	_M_refcount = std::move(__r._M_refcount);
+-	__r._M_ptr = nullptr;
++	__weak_ptr(std::move(__r)).swap(*this);
+ 	return *this;
+       }
+ 
 --- a/src/libstdc++-v3/include/bits/slice_array.h
 +++ b/src/libstdc++-v3/include/bits/slice_array.h
 @@ -245,6 +245,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -37675,7 +41334,38 @@ new file mode 100644
  #else
     // Forward iterator requirements
    template<typename _IteratorL, typename _IteratorR, typename _Container>
-@@ -1588,20 +1622,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1356,11 +1390,29 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ 	    && convertible_to<const _Iter2&, _Iterator>;
+ #endif
+ 
++#if __cplusplus > 201703L && __cpp_lib_concepts
++      static auto
++      _S_iter_concept()
++      {
++	if constexpr (random_access_iterator<_Iterator>)
++	  return random_access_iterator_tag{};
++	else if constexpr (bidirectional_iterator<_Iterator>)
++	  return bidirectional_iterator_tag{};
++	else if constexpr (forward_iterator<_Iterator>)
++	  return forward_iterator_tag{};
++	else
++	  return input_iterator_tag{};
++      }
++#endif
++
+     public:
+       using iterator_type = _Iterator;
+ 
+ #if __cplusplus > 201703L && __cpp_lib_concepts
+-      using iterator_concept = input_iterator_tag;
++      // This is P2520R0, a C++23 change, but we treat it as a DR against C++20.
++# define __cpp_lib_move_iterator_concept 202207L
++      using iterator_concept = decltype(_S_iter_concept());
++
+       // iterator_category defined in __move_iter_cat
+       using value_type = iter_value_t<_Iterator>;
+       using difference_type = iter_difference_t<_Iterator>;
+@@ -1588,20 +1640,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  #endif
      { return !(__x < __y); }
  
@@ -37703,7 +41393,7 @@ new file mode 100644
    template<typename _Iterator>
      inline _GLIBCXX17_CONSTEXPR bool
      operator!=(const move_iterator<_Iterator>& __x,
-@@ -1697,7 +1733,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1697,7 +1751,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _S_noexcept1()
        {
  	if constexpr (is_trivially_default_constructible_v<_Tp>)
@@ -37712,7 +41402,7 @@ new file mode 100644
  	else
  	  return is_nothrow_constructible_v<_Tp, _Up>;
        }
-@@ -1767,19 +1803,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1767,19 +1821,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        noexcept(_S_noexcept<const _It2&, const _Sent2&>())
        : _M_valueless(), _M_index(__x._M_index)
        {
@@ -37735,7 +41425,7 @@ new file mode 100644
  	  }
        }
  
-@@ -1787,31 +1824,75 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1787,31 +1842,75 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
      common_iterator(const common_iterator& __x)
      noexcept(_S_noexcept<const _It&, const _Sent&>())
      : _M_valueless(), _M_index(__x._M_index)
@@ -37815,7 +41505,7 @@ new file mode 100644
      }
  
      template<typename _It2, typename _Sent2>
-@@ -1819,72 +1900,45 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1819,72 +1918,45 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  	&& convertible_to<const _Sent2&, _Sent>
  	&& assignable_from<_It&, const _It2&>
  	&& assignable_from<_Sent&, const _Sent2&>
@@ -37904,7 +41594,7 @@ new file mode 100644
      operator->() const requires __detail::__common_iter_has_arrow<_It>
      {
        __glibcxx_assert(_M_index == 0);
-@@ -1899,7 +1953,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1899,7 +1971,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  	return __arrow_proxy{*_M_it};
      }
  
@@ -37913,7 +41603,7 @@ new file mode 100644
      operator++()
      {
        __glibcxx_assert(_M_index == 0);
-@@ -1907,7 +1961,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1907,7 +1979,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        return *this;
      }
  
@@ -37922,7 +41612,7 @@ new file mode 100644
      operator++(int)
      {
        __glibcxx_assert(_M_index == 0);
-@@ -1929,9 +1983,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1929,9 +2001,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  
      template<typename _It2, sentinel_for<_It> _Sent2>
        requires sentinel_for<_Sent, _It2>
@@ -37935,7 +41625,7 @@ new file mode 100644
        {
  	switch(__x._M_index << 2 | __y._M_index)
  	  {
-@@ -1951,9 +2005,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1951,9 +2023,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  
      template<typename _It2, sentinel_for<_It> _Sent2>
        requires sentinel_for<_Sent, _It2> && equality_comparable_with<_It, _It2>
@@ -37948,7 +41638,7 @@ new file mode 100644
        {
  	switch(__x._M_index << 2 | __y._M_index)
  	  {
-@@ -1974,9 +2028,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1974,9 +2046,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  
      template<sized_sentinel_for<_It> _It2, sized_sentinel_for<_It> _Sent2>
        requires sized_sentinel_for<_Sent, _It2>
@@ -37961,7 +41651,7 @@ new file mode 100644
        {
  	switch(__x._M_index << 2 | __y._M_index)
  	  {
-@@ -1995,7 +2049,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1995,7 +2067,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  	  }
        }
  
@@ -37971,7 +41661,7 @@ new file mode 100644
      iter_move(const common_iterator& __i)
      noexcept(noexcept(ranges::iter_move(std::declval<const _It&>())))
      requires input_iterator<_It>
-@@ -2005,7 +2060,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -2005,7 +2078,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
      }
  
      template<indirectly_swappable<_It> _It2, typename _Sent2>
@@ -37980,7 +41670,7 @@ new file mode 100644
        iter_swap(const common_iterator& __x,
  		const common_iterator<_It2, _Sent2>& __y)
        noexcept(noexcept(ranges::iter_swap(std::declval<const _It&>(),
-@@ -2018,9 +2073,40 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -2018,9 +2091,40 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  
    private:
      template<input_or_output_iterator _It2, sentinel_for<_It2> _Sent2>
@@ -38022,7 +41712,7 @@ new file mode 100644
  
      union
      {
-@@ -2028,7 +2114,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -2028,7 +2132,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _Sent _M_sent;
        unsigned char _M_valueless;
      };
@@ -38033,7 +41723,7 @@ new file mode 100644
    };
  
    template<typename _It, typename _Sent>
-@@ -2188,7 +2276,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -2188,7 +2294,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  	return *this;
        }
  
@@ -38042,7 +41732,7 @@ new file mode 100644
        operator++(int)
        {
  	__glibcxx_assert(_M_length > 0);
-@@ -2200,7 +2288,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -2200,7 +2306,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  	    ++_M_length;
  	    __throw_exception_again;
  	  }
@@ -38132,6 +41822,341 @@ new file mode 100644
      }
  
    template<typename _Tp, typename _Alloc, typename... _Args>
+--- a/src/libstdc++-v3/include/c_global/cstddef
++++ b/src/libstdc++-v3/include/c_global/cstddef
+@@ -121,55 +121,66 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+     using __byte_op_t = typename __byte_operand<_IntegerType>::__type;
+ 
+   template<typename _IntegerType>
++    [[__gnu__::__always_inline__]]
+     constexpr __byte_op_t<_IntegerType>
+     operator<<(byte __b, _IntegerType __shift) noexcept
+     { return (byte)(unsigned char)((unsigned)__b << __shift); }
+ 
+   template<typename _IntegerType>
++    [[__gnu__::__always_inline__]]
+     constexpr __byte_op_t<_IntegerType>
+     operator>>(byte __b, _IntegerType __shift) noexcept
+     { return (byte)(unsigned char)((unsigned)__b >> __shift); }
+ 
++  [[__gnu__::__always_inline__]]
+   constexpr byte
+   operator|(byte __l, byte __r) noexcept
+   { return (byte)(unsigned char)((unsigned)__l | (unsigned)__r); }
+ 
++  [[__gnu__::__always_inline__]]
+   constexpr byte
+   operator&(byte __l, byte __r) noexcept
+   { return (byte)(unsigned char)((unsigned)__l & (unsigned)__r); }
+ 
++  [[__gnu__::__always_inline__]]
+   constexpr byte
+   operator^(byte __l, byte __r) noexcept
+   { return (byte)(unsigned char)((unsigned)__l ^ (unsigned)__r); }
+ 
++  [[__gnu__::__always_inline__]]
+   constexpr byte
+   operator~(byte __b) noexcept
+   { return (byte)(unsigned char)~(unsigned)__b; }
+ 
+   template<typename _IntegerType>
++    [[__gnu__::__always_inline__]]
+     constexpr __byte_op_t<_IntegerType>&
+     operator<<=(byte& __b, _IntegerType __shift) noexcept
+     { return __b = __b << __shift; }
+ 
+   template<typename _IntegerType>
++    [[__gnu__::__always_inline__]]
+     constexpr __byte_op_t<_IntegerType>&
+     operator>>=(byte& __b, _IntegerType __shift) noexcept
+     { return __b = __b >> __shift; }
+ 
++  [[__gnu__::__always_inline__]]
+   constexpr byte&
+   operator|=(byte& __l, byte __r) noexcept
+   { return __l = __l | __r; }
+ 
++  [[__gnu__::__always_inline__]]
+   constexpr byte&
+   operator&=(byte& __l, byte __r) noexcept
+   { return __l = __l & __r; }
+ 
++  [[__gnu__::__always_inline__]]
+   constexpr byte&
+   operator^=(byte& __l, byte __r) noexcept
+   { return __l = __l ^ __r; }
+ 
+   template<typename _IntegerType>
+-    [[nodiscard]]
++    [[nodiscard,__gnu__::__always_inline__]]
+     constexpr _IntegerType
+     to_integer(__byte_op_t<_IntegerType> __b) noexcept
+     { return _IntegerType(__b); }
+--- a/src/libstdc++-v3/include/experimental/bits/fs_ops.h
++++ b/src/libstdc++-v3/include/experimental/bits/fs_ops.h
+@@ -51,10 +51,16 @@ inline namespace v1
+    * @{
+    */
+ 
++  [[__nodiscard__]]
+   path absolute(const path& __p, const path& __base = current_path());
+ 
++  [[__nodiscard__]]
+   path canonical(const path& __p, const path& __base = current_path());
++
++  [[__nodiscard__]]
+   path canonical(const path& __p, error_code& __ec);
++
++  [[__nodiscard__]]
+   path canonical(const path& __p, const path& __base, error_code& __ec);
+ 
+   inline void
+@@ -66,6 +72,7 @@ inline namespace v1
+   { copy(__from, __to, copy_options::none, __ec); }
+ 
+   void copy(const path& __from, const path& __to, copy_options __options);
++
+   void copy(const path& __from, const path& __to, copy_options __options,
+ 	    error_code& __ec) noexcept;
+ 
+@@ -107,25 +114,34 @@ inline namespace v1
+   void create_symlink(const path& __to, const path& __new_symlink,
+ 		      error_code& __ec) noexcept;
+ 
++  [[__nodiscard__]]
+   path current_path();
++
++  [[__nodiscard__]]
+   path current_path(error_code& __ec);
++
+   void current_path(const path& __p);
+   void current_path(const path& __p, error_code& __ec) noexcept;
+ 
++  [[__nodiscard__]]
+   bool
+   equivalent(const path& __p1, const path& __p2);
+ 
++  [[__nodiscard__]]
+   bool
+   equivalent(const path& __p1, const path& __p2, error_code& __ec) noexcept;
+ 
++  [[__nodiscard__]]
+   inline bool
+   exists(file_status __s) noexcept
+   { return status_known(__s) && __s.type() != file_type::not_found; }
+ 
++  [[__nodiscard__]]
+   inline bool
+   exists(const path& __p)
+   { return exists(status(__p)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   exists(const path& __p, error_code& __ec) noexcept
+   {
+@@ -138,63 +154,84 @@ inline namespace v1
+     return false;
+   }
+ 
++  [[__nodiscard__]]
+   uintmax_t file_size(const path& __p);
++
++  [[__nodiscard__]]
+   uintmax_t file_size(const path& __p, error_code& __ec) noexcept;
+ 
++  [[__nodiscard__]]
+   uintmax_t hard_link_count(const path& __p);
++
++  [[__nodiscard__]]
+   uintmax_t hard_link_count(const path& __p, error_code& __ec) noexcept;
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_block_file(file_status __s) noexcept
+   { return __s.type() == file_type::block; }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_block_file(const path& __p)
+   { return is_block_file(status(__p)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_block_file(const path& __p, error_code& __ec) noexcept
+   { return is_block_file(status(__p, __ec)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_character_file(file_status __s) noexcept
+   { return __s.type() == file_type::character; }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_character_file(const path& __p)
+   { return is_character_file(status(__p)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_character_file(const path& __p, error_code& __ec) noexcept
+   { return is_character_file(status(__p, __ec)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_directory(file_status __s) noexcept
+   { return __s.type() == file_type::directory; }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_directory(const path& __p)
+   { return is_directory(status(__p)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_directory(const path& __p, error_code& __ec) noexcept
+   { return is_directory(status(__p, __ec)); }
+ 
++  [[__nodiscard__]]
+   bool is_empty(const path& __p);
++  [[__nodiscard__]]
+   bool is_empty(const path& __p, error_code& __ec) noexcept;
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_fifo(file_status __s) noexcept
+   { return __s.type() == file_type::fifo; }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_fifo(const path& __p)
+   { return is_fifo(status(__p)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_fifo(const path& __p, error_code& __ec) noexcept
+   { return is_fifo(status(__p, __ec)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_other(file_status __s) noexcept
+   {
+@@ -202,52 +239,67 @@ inline namespace v1
+       && !is_symlink(__s);
+   }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_other(const path& __p)
+   { return is_other(status(__p)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_other(const path& __p, error_code& __ec) noexcept
+   { return is_other(status(__p, __ec)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_regular_file(file_status __s) noexcept
+   { return __s.type() == file_type::regular; }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_regular_file(const path& __p)
+   { return is_regular_file(status(__p)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_regular_file(const path& __p, error_code& __ec) noexcept
+   { return is_regular_file(status(__p, __ec)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_socket(file_status __s) noexcept
+   { return __s.type() == file_type::socket; }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_socket(const path& __p)
+   { return is_socket(status(__p)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_socket(const path& __p, error_code& __ec) noexcept
+   { return is_socket(status(__p, __ec)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_symlink(file_status __s) noexcept
+   { return __s.type() == file_type::symlink; }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_symlink(const path& __p)
+   { return is_symlink(symlink_status(__p)); }
+ 
++  [[__nodiscard__]]
+   inline bool
+   is_symlink(const path& __p, error_code& __ec) noexcept
+   { return is_symlink(symlink_status(__p, __ec)); }
+ 
++  [[__nodiscard__]]
+   file_time_type  last_write_time(const path& __p);
++
++  [[__nodiscard__]]
+   file_time_type  last_write_time(const path& __p, error_code& __ec) noexcept;
++
+   void last_write_time(const path& __p, file_time_type __new_time);
+   void last_write_time(const path& __p, file_time_type __new_time,
+ 		       error_code& __ec) noexcept;
+@@ -255,7 +307,10 @@ inline namespace v1
+   void permissions(const path& __p, perms __prms);
+   void permissions(const path& __p, perms __prms, error_code& __ec) noexcept;
+ 
++  [[__nodiscard__]]
+   path read_symlink(const path& __p);
++
++  [[__nodiscard__]]
+   path read_symlink(const path& __p, error_code& __ec);
+ 
+   bool remove(const path& __p);
+@@ -270,22 +325,38 @@ inline namespace v1
+   void resize_file(const path& __p, uintmax_t __size);
+   void resize_file(const path& __p, uintmax_t __size, error_code& __ec) noexcept;
+ 
++  [[__nodiscard__]]
+   space_info space(const path& __p);
++
++  [[__nodiscard__]]
+   space_info space(const path& __p, error_code& __ec) noexcept;
+ 
++  [[__nodiscard__]]
+   file_status status(const path& __p);
++
++  [[__nodiscard__]]
+   file_status status(const path& __p, error_code& __ec) noexcept;
+ 
++  [[__nodiscard__]]
+   inline bool status_known(file_status __s) noexcept
+   { return __s.type() != file_type::none; }
+ 
++  [[__nodiscard__]]
+   file_status symlink_status(const path& __p);
++
++  [[__nodiscard__]]
+   file_status symlink_status(const path& __p, error_code& __ec) noexcept;
+ 
++  [[__nodiscard__]]
+   path system_complete(const path& __p);
++
++  [[__nodiscard__]]
+   path system_complete(const path& __p, error_code& __ec);
+ 
++  [[__nodiscard__]]
+   path temp_directory_path();
++
++  [[__nodiscard__]]
+   path temp_directory_path(error_code& __ec);
+ 
+   /// @} group filesystem-ts
 --- a/src/libstdc++-v3/include/experimental/bits/fs_path.h
 +++ b/src/libstdc++-v3/include/experimental/bits/fs_path.h
 @@ -140,10 +140,10 @@ namespace __detail
@@ -38827,6 +42852,60 @@ new file mode 100644
  	    __c -= '0';
  	  else
  	    {
+--- a/src/libstdc++-v3/include/std/chrono
++++ b/src/libstdc++-v3/include/std/chrono
+@@ -3083,6 +3083,29 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ 	  return __width;
+ 	}
+ 
++	constexpr
++	hh_mm_ss(_Duration __d, bool __is_neg)
++	: _M_is_neg(__is_neg),
++	  _M_h (duration_cast<chrono::hours>(__d)),
++	  _M_m (duration_cast<chrono::minutes>(__d - hours())),
++	  _M_s (duration_cast<chrono::seconds>(__d - hours() - minutes()))
++	{
++	  auto __ss = __d - hours() - minutes() - seconds();
++	  if constexpr (treat_as_floating_point_v<typename precision::rep>)
++	    _M_ss = __ss;
++	  else
++	    _M_ss = duration_cast<precision>(__ss);
++	}
++
++	static constexpr _Duration
++	_S_abs(_Duration __d)
++	{
++	  if constexpr (numeric_limits<typename _Duration::rep>::is_signed)
++	    return chrono::abs(__d);
++	  else
++	    return __d;
++	}
++
+       public:
+ 	static constexpr unsigned fractional_width = {_S_fractional_width()};
+ 
+@@ -3097,18 +3120,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ 	{ }
+ 
+ 	constexpr explicit
+-	hh_mm_ss(_Duration __d) noexcept
+-	: _M_is_neg (__d < _Duration::zero()),
+-	  _M_h (duration_cast<chrono::hours>(abs(__d))),
+-	  _M_m (duration_cast<chrono::minutes>(abs(__d) - hours())),
+-	  _M_s (duration_cast<chrono::seconds>(abs(__d) - hours() - minutes()))
+-	{
+-	  if constexpr (treat_as_floating_point_v<typename precision::rep>)
+-	    _M_ss = abs(__d) - hours() - minutes() - seconds();
+-	  else
+-	    _M_ss = duration_cast<precision>(abs(__d) - hours()
+-					     - minutes() - seconds());
+-	}
++	hh_mm_ss(_Duration __d)
++	: hh_mm_ss(_S_abs(__d), __d < _Duration::zero())
++	{ }
+ 
+ 	constexpr bool
+ 	is_negative() const noexcept
 --- a/src/libstdc++-v3/include/std/future
 +++ b/src/libstdc++-v3/include/std/future
 @@ -139,34 +139,34 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -39284,6 +43363,100 @@ new file mode 100644
        // Constraint for a non-explicit constructor.
        // True iff each Ti in _Types... can be constructed from Ui in _UTypes...
        // and every Ui is implicitly convertible to Ti.
+--- a/src/libstdc++-v3/include/std/type_traits
++++ b/src/libstdc++-v3/include/std/type_traits
+@@ -1492,12 +1492,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+     };
+ #pragma GCC diagnostic pop
+ 
+-  // is_nothrow_convertible for C++11
+-  template<typename _From, typename _To>
+-    struct __is_nothrow_convertible
+-    : public __is_nt_convertible_helper<_From, _To>::type
+-    { };
+-
+ #if __cplusplus > 201703L
+ #define __cpp_lib_is_nothrow_convertible 201806L
+   /// is_nothrow_convertible
+@@ -2881,7 +2875,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+   // The primary template is used for invalid INVOKE expressions.
+   template<typename _Result, typename _Ret,
+ 	   bool = is_void<_Ret>::value, typename = void>
+-    struct __is_invocable_impl : false_type { };
++    struct __is_invocable_impl
++    : false_type
++    {
++      using __nothrow_type = false_type; // For is_nothrow_invocable_r
++    };
+ 
+   // Used for valid INVOKE and INVOKE<void> expressions.
+   template<typename _Result, typename _Ret>
+@@ -2889,7 +2887,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ 			       /* is_void<_Ret> = */ true,
+ 			       __void_t<typename _Result::type>>
+     : true_type
+-    { };
++    {
++      using __nothrow_type = true_type; // For is_nothrow_invocable_r
++    };
+ 
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
+@@ -2901,23 +2901,30 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+     {
+     private:
+       // The type of the INVOKE expression.
+-      // Unlike declval, this doesn't add_rvalue_reference.
+-      static typename _Result::type _S_get();
++      // Unlike declval, this doesn't add_rvalue_reference, so it respects
++      // guaranteed copy elision.
++      static typename _Result::type _S_get() noexcept;
+ 
+       template<typename _Tp>
+-	static void _S_conv(_Tp);
++	static void _S_conv(_Tp) noexcept;
+ 
+       // This overload is viable if INVOKE(f, args...) can convert to _Tp.
+-      template<typename _Tp, typename = decltype(_S_conv<_Tp>(_S_get()))>
+-	static true_type
++      template<typename _Tp, bool _Check_Noex = false,
++	       typename = decltype(_S_conv<_Tp>(_S_get())),
++	       bool _Noex = noexcept(_S_conv<_Tp>(_S_get()))>
++	static __bool_constant<_Check_Noex ? _Noex : true>
+ 	_S_test(int);
+ 
+-      template<typename _Tp>
++      template<typename _Tp, bool = false>
+ 	static false_type
+ 	_S_test(...);
+ 
+     public:
++      // For is_invocable_r
+       using type = decltype(_S_test<_Ret>(1));
++
++      // For is_nothrow_invocable_r
++      using __nothrow_type = decltype(_S_test<_Ret, true>(1));
+     };
+ #pragma GCC diagnostic pop
+ 
+@@ -3048,15 +3055,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+     };
+ 
+   /// @cond undocumented
+-  template<typename _Result, typename _Ret, typename = void>
+-    struct __is_nt_invocable_impl : false_type { };
+-
+   template<typename _Result, typename _Ret>
+-    struct __is_nt_invocable_impl<_Result, _Ret,
+-				  __void_t<typename _Result::type>>
+-    : __or_<is_void<_Ret>,
+-	    __is_nothrow_convertible<typename _Result::type, _Ret>>
+-    { };
++    using __is_nt_invocable_impl
++      = typename __is_invocable_impl<_Result, _Ret>::__nothrow_type;
+   /// @endcond
+ 
+   /// std::is_nothrow_invocable_r
 --- a/src/libstdc++-v3/include/std/valarray
 +++ b/src/libstdc++-v3/include/std/valarray
 @@ -1076,6 +1076,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -39383,7 +43556,18 @@ new file mode 100644
  
        static_assert(sizeof...(_Types) > 0,
  		    "variant must have at least one alternative");
-@@ -1521,12 +1505,13 @@ namespace __variant
+@@ -1488,7 +1472,9 @@ namespace __variant
+ 			    || !is_nothrow_move_constructible_v<_Tj>)
+ 		this->emplace<__index>(std::forward<_Tp>(__rhs));
+ 	      else
+-		operator=(variant(std::forward<_Tp>(__rhs)));
++		// _GLIBCXX_RESOLVE_LIB_DEFECTS
++		// 3585. converting assignment with immovable alternative
++		this->emplace<__index>(_Tj(std::forward<_Tp>(__rhs)));
+ 	    }
+ 	  return *this;
+ 	}
+@@ -1521,12 +1507,13 @@ namespace __variant
  	  static_assert(_Np < sizeof...(_Types),
  			"The index must be in [0, number of alternatives)");
  	  using type = variant_alternative_t<_Np, variant>;
@@ -39398,7 +43582,7 @@ new file mode 100644
  		  std::forward<_Args>(__args)...);
  	    }
  	  else if constexpr (is_scalar_v<type>)
-@@ -1535,9 +1520,9 @@ namespace __variant
+@@ -1535,9 +1522,9 @@ namespace __variant
  	      const type __tmp(std::forward<_Args>(__args)...);
  	      // But these steps won't throw:
  	      this->_M_reset();
@@ -39410,7 +43594,7 @@ new file mode 100644
  	      && _Traits::_S_move_assign)
  	    {
  	      // This construction might throw:
-@@ -1551,17 +1536,8 @@ namespace __variant
+@@ -1551,17 +1538,8 @@ namespace __variant
  	      // This case only provides the basic exception-safety guarantee,
  	      // i.e. the variant can become valueless.
  	      this->_M_reset();
@@ -39430,7 +43614,7 @@ new file mode 100644
  	    }
  	  return std::get<_Np>(*this);
  	}
-@@ -1575,6 +1551,7 @@ namespace __variant
+@@ -1575,6 +1553,7 @@ namespace __variant
  	  static_assert(_Np < sizeof...(_Types),
  			"The index must be in [0, number of alternatives)");
  	  using type = variant_alternative_t<_Np, variant>;
@@ -39438,7 +43622,7 @@ new file mode 100644
  	  // Provide the strong exception-safety guarantee when possible,
  	  // to avoid becoming valueless.
  	  if constexpr (is_nothrow_constructible_v<type,
-@@ -1582,10 +1559,10 @@ namespace __variant
+@@ -1582,10 +1561,10 @@ namespace __variant
  						   _Args...>)
  	    {
  	      this->_M_reset();
@@ -39451,7 +43635,7 @@ new file mode 100644
  	      && _Traits::_S_move_assign)
  	    {
  	      // This construction might throw:
-@@ -1599,17 +1576,8 @@ namespace __variant
+@@ -1599,17 +1578,8 @@ namespace __variant
  	      // This case only provides the basic exception-safety guarantee,
  	      // i.e. the variant can become valueless.
  	      this->_M_reset();
@@ -39471,7 +43655,7 @@ new file mode 100644
  	    }
  	  return std::get<_Np>(*this);
  	}
-@@ -1685,10 +1653,6 @@ namespace __variant
+@@ -1685,10 +1655,6 @@ namespace __variant
  	friend constexpr decltype(auto)
  	__detail::__variant::__get(_Vp&& __v) noexcept;
  
@@ -39504,7 +43688,15 @@ new file mode 100644
  // FIXME: #define __cpp_lib_execution 201902L
  #define __cpp_lib_integer_comparison_functions 202002L
  #define __cpp_lib_constexpr_algorithms 201806L
-@@ -272,8 +272,10 @@
+@@ -248,6 +248,7 @@
+ #define __cpp_lib_polymorphic_allocator 201902L
+ #if __cpp_lib_concepts
+ # define __cpp_lib_ranges 202106L
++# define __cpp_lib_move_iterator_concept 202207L
+ #endif
+ #if __cpp_lib_atomic_wait || _GLIBCXX_HAVE_POSIX_SEMAPHORE
+ # define __cpp_lib_semaphore 201907L
+@@ -272,8 +273,10 @@
  #if __cplusplus > 202002L
  // c++2b
  #define __cpp_lib_is_scoped_enum 202011L
@@ -39653,6 +43845,62 @@ new file mode 100644
  
  @ENABLE_SYMVERS_TRUE@CLEANFILES = libstdc++-symbols.ver $(version_dep)
  @ENABLE_SYMVERS_DARWIN_TRUE@@ENABLE_SYMVERS_TRUE@version_arg = -Wl,-exported_symbols_list,libstdc++-symbols.explist
+--- a/src/libstdc++-v3/src/c++11/codecvt.cc
++++ b/src/libstdc++-v3/src/c++11/codecvt.cc
+@@ -254,7 +254,7 @@ namespace
+     const size_t avail = from.size();
+     if (avail == 0)
+       return incomplete_mb_character;
+-    unsigned char c1 = from[0];
++    char32_t c1 = (unsigned char) from[0];
+     // https://en.wikipedia.org/wiki/UTF-8#Sample_code
+     if (c1 < 0x80)
+     {
+@@ -267,7 +267,7 @@ namespace
+     {
+       if (avail < 2)
+ 	return incomplete_mb_character;
+-      unsigned char c2 = from[1];
++      char32_t c2 = (unsigned char) from[1];
+       if ((c2 & 0xC0) != 0x80)
+ 	return invalid_mb_sequence;
+       char32_t c = (c1 << 6) + c2 - 0x3080;
+@@ -279,12 +279,12 @@ namespace
+     {
+       if (avail < 3)
+ 	return incomplete_mb_character;
+-      unsigned char c2 = from[1];
++      char32_t c2 = (unsigned char) from[1];
+       if ((c2 & 0xC0) != 0x80)
+ 	return invalid_mb_sequence;
+       if (c1 == 0xE0 && c2 < 0xA0) // overlong
+ 	return invalid_mb_sequence;
+-      unsigned char c3 = from[2];
++      char32_t c3 = (unsigned char) from[2];
+       if ((c3 & 0xC0) != 0x80)
+ 	return invalid_mb_sequence;
+       char32_t c = (c1 << 12) + (c2 << 6) + c3 - 0xE2080;
+@@ -296,17 +296,17 @@ namespace
+     {
+       if (avail < 4)
+ 	return incomplete_mb_character;
+-      unsigned char c2 = from[1];
++      char32_t c2 = (unsigned char) from[1];
+       if ((c2 & 0xC0) != 0x80)
+ 	return invalid_mb_sequence;
+       if (c1 == 0xF0 && c2 < 0x90) // overlong
+ 	return invalid_mb_sequence;
+       if (c1 == 0xF4 && c2 >= 0x90) // > U+10FFFF
+       return invalid_mb_sequence;
+-      unsigned char c3 = from[2];
++      char32_t c3 = (unsigned char) from[2];
+       if ((c3 & 0xC0) != 0x80)
+ 	return invalid_mb_sequence;
+-      unsigned char c4 = from[3];
++      char32_t c4 = (unsigned char) from[3];
+       if ((c4 & 0xC0) != 0x80)
+ 	return invalid_mb_sequence;
+       char32_t c = (c1 << 18) + (c2 << 12) + (c3 << 6) + c4 - 0x3C82080;
 --- a/src/libstdc++-v3/src/c++11/cxx11-ios_failure.cc
 +++ b/src/libstdc++-v3/src/c++11/cxx11-ios_failure.cc
 @@ -44,14 +44,15 @@
@@ -39995,6 +44243,58 @@ new file mode 100644
  
    _Parser parser(_M_pathname);
  
+--- a/src/libstdc++-v3/src/c++17/memory_resource.cc
++++ b/src/libstdc++-v3/src/c++17/memory_resource.cc
+@@ -502,7 +502,7 @@ namespace pmr
+     }
+ 
+     // Allocated size of chunk:
+-    uint32_t _M_bytes = 0;
++    bitset::size_type _M_bytes = 0;
+     // Start of allocated chunk:
+     std::byte* _M_p = nullptr;
+ 
+@@ -576,7 +576,7 @@ namespace pmr
+   // For 16-bit pointers it's five pointers (10 bytes).
+   // TODO pad 64-bit to 4*sizeof(void*) to avoid splitting across cache lines?
+   static_assert(sizeof(chunk)
+-      == sizeof(bitset::size_type) + sizeof(uint32_t) + 2 * sizeof(void*));
++      == 2 * sizeof(bitset::size_type) + 2 * sizeof(void*));
+ 
+   // An oversized allocation that doesn't fit in a pool.
+   struct big_block
+@@ -731,7 +731,7 @@ namespace pmr
+ 	  _M_blocks_per_chunk = std::min({
+ 	      max_blocks,
+ 	      __opts.max_blocks_per_chunk,
+-	      (size_t)_M_blocks_per_chunk * 2
++	      size_t(_M_blocks_per_chunk * 2)
+ 	  });
+ 	}
+     }
+@@ -870,9 +870,11 @@ namespace pmr
+       256, 320, 384, 448,
+       512, 768,
+ #if __SIZE_WIDTH__ > 16
++      // Use bigger pools if size_t has at least 20 bits.
+       1024, 1536,
+       2048, 3072,
+-#if __SIZE_WIDTH__ > 20
++#if __INT_WIDTH__ >= 32
++      // Use even bigger pools if int has at least 32 bits.
+       1<<12, 1<<13, 1<<14,
+       1<<15, 1<<16, 1<<17,
+       1<<20, 1<<21, 1<<22 // 4MB should be enough for anybody
+@@ -1052,7 +1054,8 @@ namespace pmr
+ 	// Decide on initial number of blocks per chunk.
+ 	// At least 16 blocks per chunk seems reasonable,
+ 	// more for smaller blocks:
+-	size_t blocks_per_chunk = std::max(size_t(16), 1024 / block_size);
++	size_t blocks_per_chunk = 1024 / block_size;
++	blocks_per_chunk = std::max(size_t(16), blocks_per_chunk);
+ 	// But don't exceed the requested max_blocks_per_chunk:
+ 	blocks_per_chunk
+ 	  = std::min(blocks_per_chunk, _M_opts.max_blocks_per_chunk);
 --- a/src/libstdc++-v3/src/c++20/sstream-inst.cc
 +++ b/src/libstdc++-v3/src/c++20/sstream-inst.cc
 @@ -26,7 +26,9 @@
@@ -40434,6 +44734,89 @@ new file mode 100644
 +  std::from_chars(s.data(), s.data() + s.size(), d);
 +#endif
 +}
+--- a/src/libstdc++-v3/testsuite/20_util/is_nothrow_convertible/value.cc
++++ b/src/libstdc++-v3/testsuite/20_util/is_nothrow_convertible/value.cc
+@@ -21,9 +21,7 @@
+ #include <type_traits>
+ #include <testsuite_tr1.h>
+ 
+-#ifndef IS_NT_CONVERTIBLE_DEFINED
+ using std::is_nothrow_convertible;
+-#endif
+ 
+ void test01()
+ {
+deleted file mode 100644
+--- a/src/libstdc++-v3/testsuite/20_util/is_nothrow_convertible/value_ext.cc
++++ /dev/null
+@@ -1,28 +0,0 @@
+-// Copyright (C) 2019-2021 Free Software Foundation, Inc.
+-//
+-// This file is part of the GNU ISO C++ Library.  This library is free
+-// software; you can redistribute it and/or modify it under the
+-// terms of the GNU General Public License as published by the
+-// Free Software Foundation; either version 3, or (at your option)
+-// any later version.
+-
+-// This library is distributed in the hope that it will be useful,
+-// but WITHOUT ANY WARRANTY; without even the implied warranty of
+-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-// GNU General Public License for more details.
+-
+-// You should have received a copy of the GNU General Public License along
+-// with this library; see the file COPYING3.  If not see
+-// <http://www.gnu.org/licenses/>.
+-
+-// { dg-do compile { target c++11 } }
+-
+-#include <type_traits>
+-
+-// Test the non-standard __is_nothrow_convertible trait
+-
+-template<typename From, typename To>
+-  using is_nothrow_convertible = std::__is_nothrow_convertible<From, To>;
+-
+-#define IS_NT_CONVERTIBLE_DEFINED
+-#include "value.cc"
+new file mode 100644
+--- /dev/null
++++ b/src/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/91456.cc
+@@ -0,0 +1,35 @@
++// Copyright (C) 2019-2021 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3.  If not see
++// <http://www.gnu.org/licenses/>.
++
++// { dg-do compile { target c++17 } }
++
++// PR 91456
++// std::function and std::is_invocable_r do not understand guaranteed elision
++
++#include <type_traits>
++
++#include <functional>
++
++struct Immovable {
++  Immovable() = default;
++  Immovable(const Immovable&) = delete;
++  Immovable& operator=(const Immovable&) = delete;
++};
++
++static_assert(std::is_nothrow_invocable_r_v<Immovable, Immovable(*)() noexcept>);
++static_assert(std::is_nothrow_invocable_r_v<const Immovable, Immovable(*)() noexcept>);
++static_assert(std::is_nothrow_invocable_r_v<Immovable, const Immovable(*)() noexcept>);
 --- a/src/libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/allocate.cc
 +++ b/src/libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/allocate.cc
 @@ -238,8 +238,11 @@ test07()
@@ -40547,6 +44930,17 @@ new file mode 100644
 +  a.construct(p, std::move(rvals));
 +  a.deallocate(p, 1);
 +}
+--- a/src/libstdc++-v3/testsuite/20_util/tuple/swap.cc
++++ b/src/libstdc++-v3/testsuite/20_util/tuple/swap.cc
+@@ -38,7 +38,7 @@ struct MoveOnly
+   MoveOnly(MoveOnly const&) = delete;
+   MoveOnly& operator=(MoveOnly const&) = delete;
+ 
+-  bool operator==(MoveOnly const& m)
++  bool operator==(MoveOnly const& m) const
+   { return i == m.i; }
+ 
+   void swap(MoveOnly& m)
 --- a/src/libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate.cc
 +++ b/src/libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate.cc
 @@ -281,10 +281,13 @@ test07()
@@ -40589,6 +44983,49 @@ new file mode 100644
 +  std::allocator<move_only> a;
 +  (void) std::uses_allocator_construction_args<P>(a, std::move(rvals));
 +}
+new file mode 100644
+--- /dev/null
++++ b/src/libstdc++-v3/testsuite/20_util/variant/lwg3585.cc
+@@ -0,0 +1,16 @@
++// { dg-do compile { target c++17 } }
++
++// LWG 3585. Variant converting assignment with immovable alternative
++
++#include <variant>
++#include <string>
++
++struct A {
++  A() = default;
++  A(A&&) = delete;
++};
++
++int main() {
++  std::variant<A, std::string> v;
++  v = "hello";
++}
+new file mode 100644
+--- /dev/null
++++ b/src/libstdc++-v3/testsuite/20_util/weak_ptr/cons/self_move.cc
+@@ -0,0 +1,19 @@
++// { dg-do run { target c++11 } }
++
++#include <memory>
++#include <testsuite_hooks.h>
++
++void
++test_self_move()
++{
++  std::shared_ptr<int> sp(new int(66));
++  std::weak_ptr<int> wp(sp);
++  wp = std::move(wp); // PR libstdc++/108118
++  std::shared_ptr<int> sp2(wp);
++  VERIFY(sp2 == sp);
++}
++
++int main()
++{
++  test_self_move();
++}
 --- a/src/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/moveable.cc
 +++ b/src/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/moveable.cc
 @@ -35,7 +35,9 @@ void test01()
@@ -41166,6 +45603,47 @@ new file mode 100644
 +}
 new file mode 100644
 --- /dev/null
++++ b/src/libstdc++-v3/testsuite/24_iterators/move_iterator/p2520r0.cc
+@@ -0,0 +1,37 @@
++// { dg-options "-std=gnu++20" }
++// { dg-do compile { target c++20 } }
++
++// Verify P2520R0 changes to move_iterator's iterator_concept, which we treat
++// as a DR against C++20.
++
++#include <iterator>
++#if __cpp_lib_move_iterator_concept != 202207L
++# error "Feature-test macro __cpp_lib_move_iterator_concept has wrong value in <iterator>"
++#endif
++
++#undef __cpp_lib_move_iterator_concept
++#include <version>
++#if __cpp_lib_move_iterator_concept != 202207L
++# error "Feature-test macro __cpp_lib_move_iterator_concept has wrong value in <version>"
++#endif
++
++#include <testsuite_iterators.h>
++
++using __gnu_test::test_input_range;
++using __gnu_test::test_forward_range;
++using __gnu_test::test_bidirectional_range;
++using __gnu_test::test_random_access_range;
++
++using ty1 = std::move_iterator<decltype(std::declval<test_input_range<int>&>().begin())>;
++static_assert(std::same_as<ty1::iterator_concept, std::input_iterator_tag>);
++
++using ty2 = std::move_iterator<decltype(std::declval<test_forward_range<int>&>().begin())>;
++static_assert(std::same_as<ty2::iterator_concept, std::forward_iterator_tag>);
++
++using ty3 = std::move_iterator<decltype(std::declval<test_bidirectional_range<int>&>().begin())>;
++static_assert(std::same_as<ty3::iterator_concept, std::bidirectional_iterator_tag>);
++
++using ty4 = std::move_iterator<decltype(std::declval<test_random_access_range<int>&>().begin())>;
++static_assert(std::same_as<ty4::iterator_concept, std::random_access_iterator_tag>);
++
++static_assert(std::random_access_iterator<std::move_iterator<int*>>);
+new file mode 100644
+--- /dev/null
 +++ b/src/libstdc++-v3/testsuite/24_iterators/range_operations/advance_overflow.cc
 @@ -0,0 +1,37 @@
 +// { dg-options "-std=gnu++20" }
@@ -41205,6 +45683,44 @@ new file mode 100644
 +    return std::ranges::advance(i, L::min(), I{-4}) == L::min() + 2;
 +}
 +static_assert(test());
+--- a/src/libstdc++-v3/testsuite/25_algorithms/copy/constrained.cc
++++ b/src/libstdc++-v3/testsuite/25_algorithms/copy/constrained.cc
+@@ -226,6 +226,29 @@ test06()
+   VERIFY( ranges::equal(v, (int[]){1,2,3,0}) );
+ }
+ 
++void
++test07()
++{
++  struct move_only_output_iterator
++  {
++    using value_type = int;
++    using difference_type = short;
++    using iterator_category = std::output_iterator_tag;
++
++    move_only_output_iterator() = default;
++    move_only_output_iterator(move_only_output_iterator&&) = default;
++    move_only_output_iterator& operator=(move_only_output_iterator&&) = default;
++
++    move_only_output_iterator& operator*() { return *this; }
++    move_only_output_iterator& operator++() { return *this; }
++    move_only_output_iterator operator++(int) { return std::move(*this); }
++
++    void operator=(int) { }
++  };
++
++  ranges::copy(std::vector<int>{1,2,3}, move_only_output_iterator{});
++}
++
+ int
+ main()
+ {
+@@ -235,4 +258,5 @@ main()
+   test04();
+   static_assert(test05());
+   test06();
++  test07();
+ }
 new file mode 100644
 --- /dev/null
 +++ b/src/libstdc++-v3/testsuite/26_numerics/gcd/105844.cc
@@ -41351,6 +45867,17 @@ new file mode 100644
 -  return 0;
 +  test_pr105502();
  }
+--- a/src/libstdc++-v3/testsuite/26_numerics/valarray/87641.cc
++++ b/src/libstdc++-v3/testsuite/26_numerics/valarray/87641.cc
+@@ -39,7 +39,7 @@ struct X
+   X() : val(1) { }
+ 
+   X& operator+=(const X& x) { val += x.val; return *this; }
+-  bool operator==(const X& x) { return val == x.val; }
++  bool operator==(const X& x) const { return val == x.val; }
+ 
+   int val;
+ };
 new file mode 100644
 --- /dev/null
 +++ b/src/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/pr106248.cc
@@ -41522,6 +46049,55 @@ new file mode 100644
  }
  
  int
+--- a/src/libstdc++-v3/testsuite/27_io/filesystem/operations/absolute.cc
++++ b/src/libstdc++-v3/testsuite/27_io/filesystem/operations/absolute.cc
+@@ -84,7 +84,7 @@ test03()
+   VERIFY( eabs.empty() );
+ 
+   try {
+-    absolute(path{});
++    (void) absolute(path{});
+     VERIFY( false );
+   } catch (const std::filesystem::filesystem_error& e) {
+     VERIFY( e.code() == std::errc::invalid_argument );
+--- a/src/libstdc++-v3/testsuite/27_io/filesystem/operations/all.cc
++++ b/src/libstdc++-v3/testsuite/27_io/filesystem/operations/all.cc
+@@ -42,11 +42,11 @@ main()
+   bool b [[maybe_unused]];
+   std::uintmax_t size;
+ 
+-  std::filesystem::absolute(p);
+-  std::filesystem::absolute(p, ec);
++  p2 = std::filesystem::absolute(p);
++  p2 = std::filesystem::absolute(p, ec);
+ 
+-  std::filesystem::canonical(p);
+-  std::filesystem::canonical(p, ec);
++  p2 = std::filesystem::canonical(p);
++  p2 = std::filesystem::canonical(p, ec);
+ 
+   std::filesystem::copy(p, p);
+   std::filesystem::copy(p, p, ec);
+--- a/src/libstdc++-v3/testsuite/27_io/filesystem/operations/canonical.cc
++++ b/src/libstdc++-v3/testsuite/27_io/filesystem/operations/canonical.cc
+@@ -31,7 +31,7 @@ test01()
+   const std::error_code bad_ec = make_error_code(std::errc::invalid_argument);
+   std::error_code ec;
+   auto p = __gnu_test::nonexistent_path();
+-  canonical( p, ec );
++  (void) canonical( p, ec );
+   VERIFY( ec );
+ 
+   create_directory(p);
+@@ -90,7 +90,7 @@ test02()
+ #if __cpp_exceptions
+   fs::path e1, e2;
+   try {
+-    canonical(p);
++    (void) canonical(p);
+   } catch (const fs::filesystem_error& e) {
+     e1 = e.path1();
+     e2 = e.path2();
 --- a/src/libstdc++-v3/testsuite/27_io/filesystem/operations/copy.cc
 +++ b/src/libstdc++-v3/testsuite/27_io/filesystem/operations/copy.cc
 @@ -193,6 +193,34 @@ test05()
@@ -41565,6 +46141,70 @@ new file mode 100644
    test05();
 +  test_pr99290();
  }
+--- a/src/libstdc++-v3/testsuite/27_io/filesystem/operations/exists.cc
++++ b/src/libstdc++-v3/testsuite/27_io/filesystem/operations/exists.cc
+@@ -95,7 +95,7 @@ test04()
+   ec.clear();
+   try
+   {
+-    exists(unr);
++    (void) exists(unr);
+   }
+   catch(const std::filesystem::filesystem_error& ex)
+   {
+--- a/src/libstdc++-v3/testsuite/27_io/filesystem/operations/is_empty.cc
++++ b/src/libstdc++-v3/testsuite/27_io/filesystem/operations/is_empty.cc
+@@ -40,7 +40,7 @@ test01()
+   VERIFY( !result );
+ 
+   try {
+-    fs::is_empty(p);
++    (void) fs::is_empty(p);
+   } catch (const fs::filesystem_error& e) {
+     ec2 = e.code();
+   }
+@@ -51,7 +51,7 @@ test01()
+   VERIFY( !result );
+ 
+   try {
+-    fs::is_empty(p/"f");
++    (void) fs::is_empty(p/"f");
+   } catch (const fs::filesystem_error& e) {
+     ec2 = e.code();
+   }
+--- a/src/libstdc++-v3/testsuite/27_io/filesystem/operations/read_symlink.cc
++++ b/src/libstdc++-v3/testsuite/27_io/filesystem/operations/read_symlink.cc
+@@ -31,7 +31,7 @@ test01()
+   auto p = __gnu_test::nonexistent_path();
+   std::error_code ec;
+ 
+-  read_symlink(p, ec);
++  (void) read_symlink(p, ec);
+   VERIFY( ec );
+ 
+   fs::path tgt = ".";
+--- a/src/libstdc++-v3/testsuite/27_io/filesystem/operations/status.cc
++++ b/src/libstdc++-v3/testsuite/27_io/filesystem/operations/status.cc
+@@ -74,7 +74,7 @@ test03()
+   std::error_code ec2;
+   fs::path p, p2;
+   try {
+-    fs::symlink_status(f.path);
++    (void) fs::symlink_status(f.path);
+   } catch (const fs::filesystem_error& e) {
+     caught = true;
+     p = e.path1();
+--- a/src/libstdc++-v3/testsuite/27_io/filesystem/operations/symlink_status.cc
++++ b/src/libstdc++-v3/testsuite/27_io/filesystem/operations/symlink_status.cc
+@@ -94,7 +94,7 @@ test03()
+   std::error_code ec2;
+   fs::path p, p2;
+   try {
+-    fs::symlink_status(f.path);
++    (void) fs::symlink_status(f.path);
+   } catch (const fs::filesystem_error& e) {
+     caught = true;
+     p = e.path1();
 --- a/src/libstdc++-v3/testsuite/27_io/filesystem/operations/temp_directory_path.cc
 +++ b/src/libstdc++-v3/testsuite/27_io/filesystem/operations/temp_directory_path.cc
 @@ -20,6 +20,7 @@
@@ -41597,6 +46237,24 @@ new file mode 100644
  
    std::error_code ec;
    fs::path p = fs::temp_directory_path(ec);
+@@ -110,7 +117,7 @@ test03()
+ 
+   std::error_code ec2;
+   try {
+-    fs::temp_directory_path();
++    (void) fs::temp_directory_path();
+   } catch (const fs::filesystem_error& e) {
+     ec2 = e.code();
+   }
+@@ -134,7 +141,7 @@ test04()
+ 
+   std::error_code ec2;
+   try {
+-    fs::temp_directory_path();
++    (void) fs::temp_directory_path();
+   } catch (const fs::filesystem_error& e) {
+     ec2 = e.code();
+   }
 new file mode 100644
 --- /dev/null
 +++ b/src/libstdc++-v3/testsuite/27_io/filesystem/path/108636.cc
@@ -42764,6 +47422,31 @@ new file mode 100644
  }
  
  int
+--- a/src/libstdc++-v3/testsuite/experimental/filesystem/operations/canonical.cc
++++ b/src/libstdc++-v3/testsuite/experimental/filesystem/operations/canonical.cc
+@@ -30,11 +30,11 @@ test01()
+ {
+   std::error_code ec;
+   auto p = __gnu_test::nonexistent_path();
+-  canonical( p, ec );
++  (void) canonical( p, ec );
+   VERIFY( ec );
+ 
+   p = fs::current_path();
+-  canonical( p, ec );
++  (void) canonical( p, ec );
+   VERIFY( !ec );
+ 
+   const auto root = fs::absolute("/");
+@@ -67,7 +67,7 @@ test02()
+   fs::path p = "rel", base = __gnu_test::nonexistent_path();
+   fs::path e1, e2;
+   try {
+-    canonical(p, base);
++    (void) canonical(p, base);
+   } catch (const fs::filesystem_error& e) {
+     e1 = e.path1();
+     e2 = e.path2();
 --- a/src/libstdc++-v3/testsuite/experimental/filesystem/operations/copy.cc
 +++ b/src/libstdc++-v3/testsuite/experimental/filesystem/operations/copy.cc
 @@ -190,6 +190,34 @@ test05()
@@ -42807,6 +47490,48 @@ new file mode 100644
    test05();
 +  test_pr99290();
  }
+--- a/src/libstdc++-v3/testsuite/experimental/filesystem/operations/exists.cc
++++ b/src/libstdc++-v3/testsuite/experimental/filesystem/operations/exists.cc
+@@ -89,7 +89,7 @@ test04()
+   ec.clear();
+   try
+   {
+-    exists(unr);
++    (void) exists(unr);
+   }
+   catch(const std::experimental::filesystem::filesystem_error& ex)
+   {
+--- a/src/libstdc++-v3/testsuite/experimental/filesystem/operations/is_empty.cc
++++ b/src/libstdc++-v3/testsuite/experimental/filesystem/operations/is_empty.cc
+@@ -41,7 +41,7 @@ test01()
+   VERIFY( !result );
+ 
+   try {
+-    fs::is_empty(p);
++    (void) fs::is_empty(p);
+   } catch (const fs::filesystem_error& e) {
+     ec2 = e.code();
+   }
+@@ -52,7 +52,7 @@ test01()
+   VERIFY( !result );
+ 
+   try {
+-    fs::is_empty(p/"f");
++    (void) fs::is_empty(p/"f");
+   } catch (const fs::filesystem_error& e) {
+     ec2 = e.code();
+   }
+--- a/src/libstdc++-v3/testsuite/experimental/filesystem/operations/read_symlink.cc
++++ b/src/libstdc++-v3/testsuite/experimental/filesystem/operations/read_symlink.cc
+@@ -32,7 +32,7 @@ test01()
+   auto p = __gnu_test::nonexistent_path();
+   std::error_code ec;
+ 
+-  read_symlink(p, ec);
++  (void) read_symlink(p, ec);
+   VERIFY( ec );
+ 
+   fs::path tgt = ".";
 --- a/src/libstdc++-v3/testsuite/experimental/filesystem/operations/temp_directory_path.cc
 +++ b/src/libstdc++-v3/testsuite/experimental/filesystem/operations/temp_directory_path.cc
 @@ -21,6 +21,7 @@
@@ -42850,6 +47575,15 @@ new file mode 100644
    auto p = __gnu_test::nonexistent_path();
    create_directories(p/"tmp");
    permissions(p, fs::perms::none);
+@@ -109,7 +118,7 @@ test03()
+ 
+   std::error_code ec2;
+   try {
+-    fs::temp_directory_path();
++    (void) fs::temp_directory_path();
+   } catch (const fs::filesystem_error& e) {
+     ec2 = e.code();
+   }
 @@ -122,8 +131,10 @@ test03()
  void
  test04()
@@ -42862,6 +47596,15 @@ new file mode 100644
    std::error_code ec;
    auto r = fs::temp_directory_path(ec);
    VERIFY( ec == std::make_error_code(std::errc::not_a_directory) );
+@@ -131,7 +142,7 @@ test04()
+ 
+   std::error_code ec2;
+   try {
+-    fs::temp_directory_path();
++    (void) fs::temp_directory_path();
+   } catch (const fs::filesystem_error& e) {
+     ec2 = e.code();
+   }
 --- a/src/libstdc++-v3/testsuite/experimental/simd/tests/bits/verify.h
 +++ b/src/libstdc++-v3/testsuite/experimental/simd/tests/bits/verify.h
 @@ -137,7 +137,7 @@ public:
@@ -43051,6 +47794,50 @@ new file mode 100644
    test11();
 +  test13();
  }
+--- a/src/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc
++++ b/src/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc
+@@ -25,8 +25,14 @@
+ using max_size_t = std::ranges::__detail::__max_size_type;
+ using max_diff_t = std::ranges::__detail::__max_diff_type;
+ using rep_t = max_size_t::__rep;
++#if __SIZEOF_INT128__
++using signed_rep_t = __int128;
++#else
++using signed_rep_t = long long;
++#endif
+ 
+ static_assert(sizeof(max_size_t) == sizeof(max_diff_t));
++static_assert(sizeof(rep_t) == sizeof(signed_rep_t));
+ 
+ static_assert(std::regular<max_size_t>);
+ static_assert(std::totally_ordered<max_size_t>);
+@@ -53,6 +59,8 @@ test01()
+   static_assert(max_diff_t(3) % -2 == 1);
+   static_assert(max_diff_t(-3) << 1 == -6);
+   static_assert(max_diff_t(-3) >> 1 == -2);
++  static_assert(max_diff_t(-3) >> 2 == -1);
++  static_assert(max_diff_t(-3) >> 10 == -1);
+   static_assert(max_diff_t(3) >> 1 == 1);
+   static_assert(max_diff_t(3) >> 2 == 0);
+ 
+@@ -187,7 +195,7 @@ template<bool signed_p, bool shorten_p>
+ void
+ test02()
+ {
+-  using hw_type = std::conditional_t<signed_p, signed rep_t, rep_t>;
++  using hw_type = std::conditional_t<signed_p, signed_rep_t, rep_t>;
+   using max_type = std::conditional_t<signed_p, max_diff_t, max_size_t>;
+   using shorten_type = std::conditional_t<shorten_p, hw_type, max_type>;
+   const int hw_type_bit_size = sizeof(hw_type) * __CHAR_BIT__;
+@@ -245,7 +253,7 @@ template<bool signed_p, bool toggle_base_p>
+ void
+ test03()
+ {
+-  using hw_type = std::conditional_t<signed_p, signed rep_t, rep_t>;
++  using hw_type = std::conditional_t<signed_p, signed_rep_t, rep_t>;
+   using max_type = std::conditional_t<signed_p, max_diff_t, max_size_t>;
+   using base_type = std::conditional_t<toggle_base_p, hw_type, max_type>;
+   constexpr int hw_type_bit_size = sizeof(hw_type) * __CHAR_BIT__;
 --- a/src/libstdc++-v3/testsuite/std/ranges/p2325.cc
 +++ b/src/libstdc++-v3/testsuite/std/ranges/p2325.cc
 @@ -5,8 +5,8 @@
@@ -43093,3 +47880,64 @@ new file mode 100644
  // { dg-bogus "static assertion failed" "" { xfail *-*-* } 124 }
  // { dg-bogus "static assertion failed" "" { xfail *-*-* } 126 }
  // { dg-bogus "static assertion failed" "" { xfail *-*-* } 128 }
+--- a/src/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc
++++ b/src/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc
+@@ -59,5 +59,57 @@ constexpr_hh_mm_ss()
+ 
+   static_assert(seconds{hh_mm_ss{100min}} == 100min);
+ 
+-  // TODO: treat_as_floating_point_v
++  // treat_as_floating_point_v
++  using fseconds = duration<double, ratio<1>>;
++  constexpr hh_mm_ss<fseconds> fsec{0x123.0004p5s};
++  static_assert(std::is_same_v<hh_mm_ss<fseconds>::precision, fseconds>);
++  static_assert(fsec.hours() == 2h);
++  static_assert(fsec.minutes() == 35min);
++  static_assert(fsec.seconds() == 12s);
++  static_assert(fsec.subseconds() == 0x.0004p5s);
++  static_assert(!fsec.is_negative());
++  static_assert(fsec.to_duration() == 0x123.0004p5s);
++
++  using fminutes = duration<double, ratio<60>>;
++  constexpr hh_mm_ss<fminutes> fmin{-0x1.23p4min};
++  static_assert(std::is_same_v<hh_mm_ss<fminutes>::precision, fseconds>);
++  static_assert(fmin.hours() == 0h);
++  static_assert(fmin.minutes() == 18min);
++  static_assert(fmin.seconds() == 11s);
++  static_assert(fmin.subseconds() == 0.25s);
++  static_assert(fmin.is_negative());
++  static_assert(fmin.to_duration() == -0x1.23p4min);
++}
++
++constexpr void
++default_construction()
++{
++  using namespace std::chrono;
++
++  constexpr hh_mm_ss<seconds> s1;
++  static_assert(s1.to_duration() == s1.to_duration().zero());
++  constexpr hh_mm_ss<duration<char>> s2;
++  static_assert(s2.to_duration() == s2.to_duration().zero());
++  constexpr hh_mm_ss<duration<int, std::centi>> s3;
++  static_assert(s3.to_duration() == s3.to_duration().zero());
++  constexpr hh_mm_ss<duration<long long, std::femto>> s4;
++  static_assert(s4.to_duration() == s4.to_duration().zero());
++  constexpr hh_mm_ss<duration<double>> s5;
++  static_assert(s5.to_duration() == s5.to_duration().zero());
++}
++
++constexpr void
++unsigned_rep()
++{
++  using namespace std::chrono;
++
++  constexpr duration<unsigned, std::milli> ms(3690001);
++
++  constexpr hh_mm_ss hms(ms); // PR libstdc++/108265
++  static_assert( ! hms.is_negative() );
++  static_assert( hms.to_duration() == milliseconds(ms.count()) );
++  static_assert( hms.hours() == 1h );
++  static_assert( hms.minutes() == 1min );
++  static_assert( hms.seconds() == 30s );
++  static_assert( hms.subseconds() == 1ms );
+ }
diff -pruN 11.3.0-14/debian/rules.parameters 11.3.0-15/debian/rules.parameters
--- 11.3.0-14/debian/rules.parameters	2023-05-10 09:23:29.000000000 +0000
+++ 11.3.0-15/debian/rules.parameters	2023-05-23 07:08:39.000000000 +0000
@@ -2,14 +2,14 @@
 GCC_VERSION	:= 11.3.0
 NEXT_GCC_VERSION	:= 11.3.1
 BASE_VERSION	:= 11
-SOURCE_VERSION	:= 11.3.0-14
-DEB_VERSION	:= 11.3.0-14
-DEB_EVERSION	:= 1:11.3.0-14
-DEB_GDC_VERSION	:= 11.3.0-14
+SOURCE_VERSION	:= 11.3.0-15
+DEB_VERSION	:= 11.3.0-15
+DEB_EVERSION	:= 1:11.3.0-15
+DEB_GDC_VERSION	:= 11.3.0-15
 DEB_SOVERSION	:= 5
 DEB_SOEVERSION	:= 1:5
 DEB_LIBGCC_SOVERSION	:= 
-DEB_LIBGCC_VERSION	:= 11.3.0-14
+DEB_LIBGCC_VERSION	:= 11.3.0-15
 DEB_STDCXX_SOVERSION	:= 5
 DEB_GOMP_SOVERSION	:= 5
 GCC_SONAME	:= 1
