GCC 12.2 should be released rather soon, and we should consider rebasing DTS/GTS GCC from it.
This may be moved to DTS 12.1 if we don't have the time to do the rebase.
Moved to DTS 12.1.
Rebase done. I see a new fail: 833068:FAIL: g++.dg/torture/pr106922.C -O2 (test for excess errors) 833133:FAIL: g++.dg/torture/pr106922.C -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) 833198:FAIL: g++.dg/torture/pr106922.C -O3 -g (test for excess errors) 833266:FAIL: g++.dg/torture/pr106922.C -O2 -flto -fno-use-linker-plugin -flto-partition=none (test for excess errors) 1813595:FAIL: g++.dg/torture/pr106922.C -O2 (test for excess errors) 1813660:FAIL: g++.dg/torture/pr106922.C -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) 1813725:FAIL: g++.dg/torture/pr106922.C -O3 -g (test for excess errors) 1813793:FAIL: g++.dg/torture/pr106922.C -O2 -flto -fno-use-linker-plugin -flto-partition=none (test for excess errors) due to Excess errors: /builddir/build/BUILD/gcc-12.2.1-20221121/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/stl_vector.h:730:22: warning: '*(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*)((char*)&externals + offsetof(MyOptionalsStruct, MyOptionalsStruct::external2.MyOptionalStructWithInt::myoptional.std::optional<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::<unnamed>.std::_Optional_base<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, false, false>::<unnamed>)).std::vector<std::basic_string<char> >::<anonymous>.std::_Vector_base<std::basic_string<char>, std::allocator<std::basic_string<char> > >::_M_impl.std::_Vector_base<std::basic_string<char>, std::allocator<std::basic_string<char> > >::_Vector_impl::<anonymous>.std::_Vector_base<std::basic_string<char>, std::allocator<std::basic_string<char> > >::_Vector_impl_data::_M_finish' may be used uninitialized [-Wmaybe-uninitialized] /builddir/build/BUILD/gcc-12.2.1-20221121/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/stl_vector.h:730:22: warning: '*(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*)((char*)&externals + offsetof(MyOptionalsStruct, MyOptionalsStruct::external2.MyOptionalStructWithInt::myoptional.std::optional<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::<unnamed>.std::_Optional_base<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, false, false>::<unnamed>)).std::vector<std::basic_string<char> >::<anonymous>.std::_Vector_base<std::basic_string<char>, std::allocator<std::basic_string<char> > >::_M_impl.std::_Vector_base<std::basic_string<char>, std::allocator<std::basic_string<char> > >::_Vector_impl::<anonymous>.std::_Vector_base<std::basic_string<char>, std::allocator<std::basic_string<char> > >::_Vector_impl_data::_M_start' may be used uninitialized [-Wmaybe-uninitialized] that I can't reproduce with vanilla GCC 12.
(In reply to Marek Polacek from comment #3) > Rebase done. I see a new fail: > > 833068:FAIL: g++.dg/torture/pr106922.C -O2 (test for excess errors) > 833133:FAIL: g++.dg/torture/pr106922.C -O3 -fomit-frame-pointer > -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess > errors) > 833198:FAIL: g++.dg/torture/pr106922.C -O3 -g (test for excess errors) > 833266:FAIL: g++.dg/torture/pr106922.C -O2 -flto -fno-use-linker-plugin > -flto-partition=none (test for excess errors) > 1813595:FAIL: g++.dg/torture/pr106922.C -O2 (test for excess errors) > 1813660:FAIL: g++.dg/torture/pr106922.C -O3 -fomit-frame-pointer > -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess > errors) > 1813725:FAIL: g++.dg/torture/pr106922.C -O3 -g (test for excess errors) > 1813793:FAIL: g++.dg/torture/pr106922.C -O2 -flto -fno-use-linker-plugin > -flto-partition=none (test for excess errors) > > due to > > Excess errors: > /builddir/build/BUILD/gcc-12.2.1-20221121/obj-x86_64-redhat-linux/x86_64- > redhat-linux/libstdc++-v3/include/bits/stl_vector.h:730:22: warning: > '*(std::vector<std::basic_string<char, std::char_traits<char>, > std::allocator<char> >, std::allocator<std::basic_string<char, > std::char_traits<char>, std::allocator<char> > > >*)((char*)&externals + > offsetof(MyOptionalsStruct, > MyOptionalsStruct::external2.MyOptionalStructWithInt::myoptional.std:: > optional<std::vector<std::basic_string<char, std::char_traits<char>, > std::allocator<char> >, std::allocator<std::basic_string<char, > std::char_traits<char>, std::allocator<char> > > > > >::<unnamed>.std::_Optional_base<std::vector<std::basic_string<char, > std::char_traits<char>, std::allocator<char> >, > std::allocator<std::basic_string<char, std::char_traits<char>, > std::allocator<char> > > >, false, > false>::<unnamed>)).std::vector<std::basic_string<char> > >::<anonymous>.std::_Vector_base<std::basic_string<char>, > std::allocator<std::basic_string<char> > > >::_M_impl.std::_Vector_base<std::basic_string<char>, > std::allocator<std::basic_string<char> > > >::_Vector_impl::<anonymous>.std::_Vector_base<std::basic_string<char>, > std::allocator<std::basic_string<char> > >::_Vector_impl_data::_M_finish' > may be used uninitialized [-Wmaybe-uninitialized] > /builddir/build/BUILD/gcc-12.2.1-20221121/obj-x86_64-redhat-linux/x86_64- > redhat-linux/libstdc++-v3/include/bits/stl_vector.h:730:22: warning: > '*(std::vector<std::basic_string<char, std::char_traits<char>, > std::allocator<char> >, std::allocator<std::basic_string<char, > std::char_traits<char>, std::allocator<char> > > >*)((char*)&externals + > offsetof(MyOptionalsStruct, > MyOptionalsStruct::external2.MyOptionalStructWithInt::myoptional.std:: > optional<std::vector<std::basic_string<char, std::char_traits<char>, > std::allocator<char> >, std::allocator<std::basic_string<char, > std::char_traits<char>, std::allocator<char> > > > > >::<unnamed>.std::_Optional_base<std::vector<std::basic_string<char, > std::char_traits<char>, std::allocator<char> >, > std::allocator<std::basic_string<char, std::char_traits<char>, > std::allocator<char> > > >, false, > false>::<unnamed>)).std::vector<std::basic_string<char> > >::<anonymous>.std::_Vector_base<std::basic_string<char>, > std::allocator<std::basic_string<char> > > >::_M_impl.std::_Vector_base<std::basic_string<char>, > std::allocator<std::basic_string<char> > > >::_Vector_impl::<anonymous>.std::_Vector_base<std::basic_string<char>, > std::allocator<std::basic_string<char> > >::_Vector_impl_data::_M_start' may > be used uninitialized [-Wmaybe-uninitialized] > > > that I can't reproduce with vanilla GCC 12. Reproduces with -D_GLIBCXX_USE_CXX11_ABI=0. I think I'll fix the test by adding: #define _GLIBCXX_USE_CXX11_ABI 1 but I won't do a rebuild just because of this.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (devtoolset-12-gcc bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:3272