diff --git a/gcc-epel.spec b/gcc-epel.spec
index 0909321..eb68287 100644
--- a/gcc-epel.spec
+++ b/gcc-epel.spec
@@ -1,10 +1,10 @@
-%global DATE 20220401
-%global gitrev f0191923ac7d1fee22772d456c59737b935c3483
-%global gcc_version 11.2.1
+%global DATE 20220421
+%global gitrev 1d3172725999deb0dca93ac70393ed9a0ad0da3f
+%global gcc_version 11.3.1
%global gcc_major 11
# Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line.
-%global gcc_release 10
+%global gcc_release 2
%global nvptx_tools_gitrev 5f6f343a302d620b0868edab376c00b15741e39e
%global newlib_cygwin_gitrev 50e2a63b04bdd018484605fbb954fd1bd5147fa0
%global _unpackaged_files_terminate_build 0
@@ -325,7 +325,7 @@ Patch20: gcc11-relocatable-pch.patch
Patch21: gcc11-dejagnu-multiline.patch
Patch23: gcc11-pie.patch
Patch24: gcc11-bind-now.patch
-Patch25: gcc11-pr105123.patch
+Patch25: gcc11-pr105331.patch
Patch100: gcc11-fortran-fdec-duplicates.patch
Patch101: gcc11-fortran-flogical-as-integer.patch
@@ -900,7 +900,7 @@ so that there cannot be any synchronization problems.
%patch23 -p1 -b .pie~
%patch24 -p1 -b .now~
%endif
-%patch25 -p0 -b .pr105123~
+%patch25 -p0 -b .pr105331~
%if 0%{?rhel} >= 9
%patch100 -p1 -b .fortran-fdec-duplicates~
@@ -3467,6 +3467,12 @@ end
%endif
%changelog
+* Wed May 11 2022 Robert Scheck 11.3.1-2
+- backport from 11.3.1-2: update from releases/gcc-11-branch (#2077536)
+- backport from 11.3.1-2: fix bogus -Wuninitialized warning on va_arg with complex types on x86_64
+ (PR target/105331)
+- backport from 11.3.1-2: remove bogus assertion in std::from_chars (PR libstdc++/105324)
+
* Wed May 11 2022 Robert Scheck 11.2.1-10
- backport from 11.2.1-10: update from releases/gcc-11-branch (#2063255)
- backport from 11.2.1-10: fix x86 vector initialization expansion fallback
diff --git a/gcc11-bind-now.patch b/gcc11-bind-now.patch
index 8710490..e0b99a9 100644
--- a/gcc11-bind-now.patch
+++ b/gcc11-bind-now.patch
@@ -131,24 +131,6 @@ index 2ded5d4c50b..5671dc7dcf4 100755
--disable-libquadmath-support
disable libquadmath support for Fortran
--enable-default-pie enable Position Independent Executable as default
-@@ -19394,7 +19397,7 @@ else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
--#line 19409 "configure"
-+#line 19412 "configure"
- #include "confdefs.h"
-
- #if HAVE_DLFCN_H
-@@ -19500,7 +19503,7 @@ else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
--#line 19515 "configure"
-+#line 19518 "configure"
- #include "confdefs.h"
-
- #if HAVE_DLFCN_H
@@ -32109,6 +32112,14 @@ fi
@@ -286,24 +268,6 @@ index baa84adbb6c..669ccaede52 100755
# Check whether --enable-cet was given.
if test "${enable_cet+set}" = set; then :
-@@ -11950,7 +11968,7 @@ else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
--#line 11963 "configure"
-+#line 11983 "configure"
- #include "confdefs.h"
-
- #if HAVE_DLFCN_H
-@@ -12056,7 +12074,7 @@ else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
--#line 12069 "configure"
-+#line 12089 "configure"
- #include "confdefs.h"
-
- #if HAVE_DLFCN_H
diff --git a/lto-plugin/configure.ac b/lto-plugin/configure.ac
index 7e6f729e9dc..5d5fea8fe70 100644
--- a/lto-plugin/configure.ac
diff --git a/gcc11-libgcc-link.patch b/gcc11-libgcc-link.patch
index 8551934..1904c4b 100644
--- a/gcc11-libgcc-link.patch
+++ b/gcc11-libgcc-link.patch
@@ -19,7 +19,6 @@ that also repeats later in the @multilib_flags@, which should be harmless.
2021-08-04 Jakub Jelinek
* config/t-slibgcc (SHLIB_LINK): Add $(LDFLAGS).
- * config/t-slibgcc-darwin (SHLIB_LINK): Likewise.
* config/t-slibgcc-vms (SHLIB_LINK): Likewise.
--- libgcc/config/t-slibgcc
@@ -33,17 +32,6 @@ that also repeats later in the @multilib_flags@, which should be harmless.
-o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
$(SHLIB_OBJS) $(SHLIB_LC) && \
rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
---- libgcc/config/t-slibgcc-darwin
-+++ libgcc/config/t-slibgcc-darwin
-@@ -15,7 +15,7 @@ SHLIB_LC = -lc
- # Note that this version is used for the loader, not the linker; the linker
- # uses the stub versions named by the versioned members of $(INSTALL_FILES).
-
--SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \
-+SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) $(LDFLAGS) -dynamiclib -nodefaultlibs \
- -install_name @shlib_slibdir@/$(SHLIB_INSTALL_NAME) \
- -single_module -o $(SHLIB_DIR)/$(SHLIB_SONAME) \
- -Wl,-exported_symbols_list,$(SHLIB_MAP) \
--- libgcc/config/t-slibgcc-vms
+++ libgcc/config/t-slibgcc-vms
@@ -22,7 +22,7 @@ SHLIB_LINK = \
diff --git a/gcc11-libstdc++-docs.patch b/gcc11-libstdc++-docs.patch
index 4b4f9f8..b044a4d 100644
--- a/gcc11-libstdc++-docs.patch
+++ b/gcc11-libstdc++-docs.patch
@@ -4,7 +4,7 @@
FSF
-+ Release 11.2.1
++ Release 11.3.1
+
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation
@@ -17,7 +17,7 @@
- The API documentation, rendered into HTML, can be viewed online
+ The API documentation, rendered into HTML, can be viewed locally
-+ for the 11.2.1 release,
++ for the 11.3.1 release,
+ online
for each GCC release
and
diff --git a/gcc11-pie.patch b/gcc11-pie.patch
index 36ae11b..728d048 100644
--- a/gcc11-pie.patch
+++ b/gcc11-pie.patch
@@ -291,24 +291,6 @@ index 258b17a226e..bd4fe1fd6ca 100755
--disable-libquadmath-support
disable libquadmath support for Fortran
--enable-default-pie enable Position Independent Executable as default
-@@ -19659,7 +19661,7 @@ else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
--#line 19395 "configure"
-+#line 19409 "configure"
- #include "confdefs.h"
-
- #if HAVE_DLFCN_H
-@@ -19765,7 +19767,7 @@ else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
--#line 19501 "configure"
-+#line 19515 "configure"
- #include "confdefs.h"
-
- #if HAVE_DLFCN_H
@@ -32221,13 +32223,17 @@ fi
# Enable --enable-host-shared
# Check whether --enable-host-shared was given.
@@ -793,24 +775,6 @@ index f489f31bc70..0dfc1982844 100755
cet_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fcf-protection"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -10735,7 +10739,7 @@ else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
--#line 10748 "configure"
-+#line 10754 "configure"
- #include "confdefs.h"
-
- #if HAVE_DLFCN_H
-@@ -10841,7 +10845,7 @@ else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
--#line 10854 "configure"
-+#line 10860 "configure"
- #include "confdefs.h"
-
- #if HAVE_DLFCN_H
@@ -11524,15 +11528,31 @@ else
multilib_arg=
fi
diff --git a/gcc11-pr105123.patch b/gcc11-pr105123.patch
deleted file mode 100644
index 1b10d70..0000000
--- a/gcc11-pr105123.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-2022-04-01 Jakub Jelinek
-
- PR target/105123
- * config/i386/i386-expand.c (ix86_expand_vector_init_general): Avoid
- using word as target for expand_simple_binop when doing ASHIFT and
- IOR.
-
- * gcc.target/i386/pr105123.c: New test.
-
---- gcc/config/i386/i386-expand.c.jj 2022-03-19 13:52:53.000000000 +0100
-+++ gcc/config/i386/i386-expand.c 2022-04-01 16:51:27.253154191 +0200
-@@ -14479,9 +14479,9 @@ quarter:
- else
- {
- word = expand_simple_binop (word_mode, ASHIFT, word, shift,
-- word, 1, OPTAB_LIB_WIDEN);
-+ NULL_RTX, 1, OPTAB_LIB_WIDEN);
- word = expand_simple_binop (word_mode, IOR, word, elt,
-- word, 1, OPTAB_LIB_WIDEN);
-+ NULL_RTX, 1, OPTAB_LIB_WIDEN);
- }
- }
-
---- gcc/testsuite/gcc.target/i386/pr105123.c.jj 2022-04-01 16:56:44.549625810 +0200
-+++ gcc/testsuite/gcc.target/i386/pr105123.c 2022-04-01 16:56:33.569782511 +0200
-@@ -0,0 +1,22 @@
-+/* PR target/105123 */
-+/* { dg-do run { target sse2_runtime } } */
-+/* { dg-options "-msse2" } */
-+/* { dg-additional-options "-mtune=i686" { target ia32 } } */
-+
-+typedef unsigned short __attribute__((__vector_size__ (4 * sizeof (unsigned short)))) V;
-+
-+V
-+foo (unsigned short u, V v)
-+{
-+ return __builtin_shuffle (u * v, v);
-+}
-+
-+int
-+main ()
-+{
-+ V x = foo (1, (V) { 0, 1, 2, 3 });
-+ for (unsigned i = 0; i < 4; i++)
-+ if (x[i] != i)
-+ __builtin_abort ();
-+ return 0;
-+}
diff --git a/gcc11-pr105331.patch b/gcc11-pr105331.patch
new file mode 100644
index 0000000..fa1a9d3
--- /dev/null
+++ b/gcc11-pr105331.patch
@@ -0,0 +1,33 @@
+2022-04-21 Jakub Jelinek
+
+ PR target/105331
+ * config/i386/i386.c (ix86_gimplify_va_arg): Mark va_arg_tmp
+ temporary TREE_ADDRESSABLE before trying to gimplify ADDR_EXPR
+ of it.
+
+ * gcc.dg/pr105331.c: New test.
+
+--- gcc/config/i386/i386.c.jj 2022-04-12 09:20:07.566662842 +0200
++++ gcc/config/i386/i386.c 2022-04-21 12:03:32.201951522 +0200
+@@ -4891,6 +4891,7 @@ ix86_gimplify_va_arg (tree valist, tree
+ {
+ int i, prev_size = 0;
+ tree temp = create_tmp_var (type, "va_arg_tmp");
++ TREE_ADDRESSABLE (temp) = 1;
+
+ /* addr = &temp; */
+ t = build1 (ADDR_EXPR, build_pointer_type (type), temp);
+--- gcc/testsuite/gcc.dg/pr105331.c.jj 2022-04-21 12:09:34.398906718 +0200
++++ gcc/testsuite/gcc.dg/pr105331.c 2022-04-21 12:09:07.304283903 +0200
+@@ -0,0 +1,11 @@
++/* PR target/105331 */
++/* { dg-do compile } */
++/* { dg-options "-O -Wuninitialized" } */
++
++#include
++
++int
++foo (va_list *va)
++{
++ return va_arg (*va, double _Complex); /* { dg-bogus "may be used uninitialized" } */
++}
diff --git a/sources b/sources
index 28e3300..835d6d6 100644
--- a/sources
+++ b/sources
@@ -1,4 +1,4 @@
-SHA512 (gcc-11.2.1-20220401.tar.xz) = 10a0cda5ca957abe24e49f1eee6b2254c847282ab70f0064124a71ba6d133e67d8dec2f0071806108003999810cfbc164cff77b23755b9f15797e5b6ae32b2c0
+SHA512 (gcc-11.3.1-20220421.tar.xz) = c631a8a990a6977b70a878c34a69c64dd49387edae0931ef64433cbf5f361ecec6a4118a9a5b1eab57b354eecea125297f721ddd25daebc2290749a7eae17af2
SHA512 (isl-0.18.tar.bz2) = 85d0b40f4dbf14cb99d17aa07048cdcab2dc3eb527d2fbb1e84c41b2de5f351025370e57448b63b2b8a8cf8a0843a089c3263f9baee1542d5c2e1cb37ed39d94
SHA512 (newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz) = 002a48a7b689a81abbf16161bcaec001a842e67dfbe372e9e109092703bfc666675f16198f60ca429370e8850d564547dc505df81bc3aaca4ce6defbc014ad6c
SHA512 (nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz) = f6d10db94fa1570ae0f94df073fa3c73c8e5ee16d59070b53d94f7db0de8a031bc44d7f3f1852533da04b625ce758e022263855ed43cfc6867e0708d001e53c7