Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
stage
rpms
gcc
Commits
095ab2af
Commit
095ab2af
authored
2 years ago
by
Circle Automation
Browse files
Options
Download
Patches
Plain Diff
import gcc-8.5.0-16.el8_7
parent
80167698
cc8
imports/cc8/gcc-8.5.0-26.el8_10
imports/cc8/gcc-8.5.0-24.el8_10
imports/cc8/gcc-8.5.0-23.el8_10
imports/cc8/gcc-8.5.0-22.el8_10
imports/cc8/gcc-8.5.0-18.el8
imports/cc8/gcc-8.5.0-16.el8_7
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SOURCES/gcc8-pr105502.patch
+98
-0
SOURCES/gcc8-pr105502.patch
SPECS/gcc.spec
+7
-1
SPECS/gcc.spec
with
105 additions
and
1 deletion
+105
-1
SOURCES/gcc8-pr105502.patch
0 → 100644
+
98
−
0
View file @
095ab2af
From b005000525ab0a5116d21217c41fb1da5bd03796 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely <jwakely@redhat.com>
Date: Fri, 6 May 2022 21:19:17 +0100
Subject: [PATCH] libstdc++: Fix deserialization for std::normal_distribution
[PR105502]
This fixes a regression in std::normal_distribution deserialization that
caused the object to be left unchanged if the __state_avail value read
from the stream was false.
libstdc++-v3/ChangeLog:
PR libstdc++/105502
* include/bits/random.tcc
(operator>>(basic_istream<C,T>&, normal_distribution<R>&)):
Update state when __state_avail is false.
* testsuite/26_numerics/random/normal_distribution/operators/serialize.cc:
Check that deserialized object equals serialized one.
(cherry picked from commit 909ef4e2727ddc50a32d6ad379a1f1ccc1043c6a)
---
libstdc++-v3/include/bits/random.tcc | 2 +-
.../operators/serialize.cc | 36 ++++++++++++++++++-
2 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc
index 0a299baedc5..0f758671f69 100644
--- a/libstdc++-v3/include/bits/random.tcc
+++ b/libstdc++-v3/include/bits/random.tcc
@@ -1941,7 +1941,7 @@
_GLIBCXX_BEGIN_NAMESPACE_VERSION
bool __saved_avail;
if (__is >> __mean >> __stddev >> __saved_avail)
{
- if (__saved_avail && (__is >> __x._M_saved))
+ if (!__saved_avail || (__is >> __x._M_saved))
{
__x._M_saved_available = __saved_avail;
__x.param(typename normal_distribution<_RealType>::
diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/operators/serialize.cc
index a65d4004161..8cc70886bc7 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/operators/serialize.cc
@@ -25,6 +25,7 @@
#include <random>
#include <sstream>
+#include <testsuite_hooks.h>
void
test01()
@@ -37,10 +38,43 @@
test01()
str << u;
str >> v;
+ VERIFY( u == v );
+}
+
+void
+test_pr105502()
+{
+ // PR libstdc++/105502 std::normal_distribution deserialization issue
+ std::stringstream str;
+ std::normal_distribution<> d{1, 2}, d2;
+ std::minstd_rand0 g;
+ str << d;
+ VERIFY( str );
+ str >> d2;
+ VERIFY( str );
+ VERIFY( d == d2 );
+
+ (void) d(g); // sets d._M_saved_available = true
+ str.str("");
+ str.clear();
+ str << d;
+ VERIFY( str );
+ str >> d2;
+ VERIFY( str );
+ VERIFY( d == d2 );
+
+ (void) d(g); // sets d._M_saved_available = false
+ str.str("");
+ str.clear();
+ str << d;
+ VERIFY( str );
+ str >> d2;
+ VERIFY( str );
+ VERIFY( d == d2 );
}
int main()
{
test01();
- return 0;
+ test_pr105502();
}
--
2.31.1
This diff is collapsed.
Click to expand it.
SPECS/gcc.spec
+
7
−
1
View file @
095ab2af
...
...
@@ -4,7 +4,7 @@
%
global
gcc_major
8
#
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
1
5
%
global
gcc_release
1
6
%
global
nvptx_tools_gitrev
c28050f60193b3b95a18866a96f03334e874e78f
%
global
nvptx_newlib_gitrev
aadc8eb0ec43b7cd0dd2dfb484bae63c8b05ef24
%
global
_unpackaged_files_terminate_build
0
...
...
@@ -286,6 +286,7 @@ Patch25: gcc8-aarch64-mtune-neoverse-512tvb.patch
Patch26: gcc8-rh2028609.patch
Patch27: gcc8-libgfortran-default-values.patch
Patch28: gcc8-rh2001788.patch
Patch29: gcc8-pr105502.patch
Patch30: gcc8-rh1668903-1.patch
Patch31: gcc8-rh1668903-2.patch
...
...
@@ -896,6 +897,7 @@ so that there cannot be any synchronization problems.
%
patch26
-
p1
-
b
.
rh2028609
~
%
patch27
-
p1
-
b
.
libgfortran
-
default
~
%
patch28
-
p1
-
b
.
rh2001788
~
%
patch29
-
p1
-
b
.
pr105502
~
%
patch30
-
p0
-
b
.
rh1668903
-
1
~
%
patch31
-
p0
-
b
.
rh1668903
-
2
~
...
...
@@ -3311,6 +3313,10 @@ fi
%{ANNOBIN_GCC_PLUGIN_DIR}/gcc-annobin.so.0.0.0
%changelog
* Fri Nov 18 2022 Marek Polacek <polacek@redhat.com> 8.5.0-16
- fix deserialization for std::normal_distribution (#2144075,
PR libstdc++/105502)
* Wed Jul 20 2022 Marek Polacek <polacek@redhat.com> 8.5.0-15
- backport straight-line-speculation mitigation (#2108721)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets