diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-10-08 14:01:00 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-10-08 14:45:36 +0100 |
commit | c06617a79b41da37d80d7e88a3dbc56818f3e706 (patch) | |
tree | 254a3bb062025ad8711614a17d487cb414a7bd6d /gcc/tree-vectorizer.c | |
parent | 629e0547af33221a925f38757b52a9284148b68a (diff) | |
download | gcc-c06617a79b41da37d80d7e88a3dbc56818f3e706.zip gcc-c06617a79b41da37d80d7e88a3dbc56818f3e706.tar.gz gcc-c06617a79b41da37d80d7e88a3dbc56818f3e706.tar.bz2 |
libstdc++: Avoid divide by zero in default template arguments
My previous attempt to fix this only worked when m is a power of two.
There is still a bug when a=00 and !has_single_bit(m).
Instead of trying to make _Mod work for a==0 this change ensures that we
never instantiate it with a==0. For C++17 we can use if-constexpr, but
otherwise we need to use a different multipler. It doesn't matter what
we use, as it won't actually be called, only instantiated.
libstdc++-v3/ChangeLog:
* include/bits/random.h (__detail::_Mod): Revert last change.
(__detail::__mod): Do not use _Mod for a==0 case.
* testsuite/26_numerics/random/linear_congruential_engine/operators/call.cc:
Check other cases with a==0. Also check runtime results.
* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
line.
Diffstat (limited to 'gcc/tree-vectorizer.c')
0 files changed, 0 insertions, 0 deletions