[Bug,libstdc++/90276] PSTL tests fail in Debug Mode
Checks
Commit Message
I replied to bugzilla rather than sending to proper mailing list !
At the same time it looks like you also found the root cause of the
problem Jonathan. Just let me know if you want to deal with it eventually.
François
-------- Forwarded Message --------
Subject: Re: [Bug libstdc++/90276] PSTL tests fail in Debug Mode
Date: Wed, 31 Jan 2024 19:09:02 +0100
From: François Dumont <frs.dumont@gmail.com>
To: redi at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>,
fdumont@gcc.gnu.org
Here is the reason of the
20_util/specialized_algorithms/pstl/uninitialized_copy_move.cc FAIL.
Maybe it fixes some other tests too, I need to run all of them.
libstdc++: Do not forward arguments several times [PR90276]
Forwarding several times the same arguments results in UB. It is
detected
by the _GLIBCXX_DEBUG mode as an attempt to use a singular iterator
which has
been moved.
libstdc++-v3/ChangeLog
PR libstdc++/90276
* testsuite/util/pstl/test_utils.h: Remove std::forward<>
calls when
done several times on the same arguments.
Ok to commit ?
François
On 31/01/2024 14:11, redi at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90276
>
> Jonathan Wakely <redi at gcc dot gnu.org> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> See Also| |https://github.com/llvm/llv
> | |m-project/issues/80136
>
Comments
On Wed, 31 Jan 2024 at 18:18, François Dumont <frs.dumont@gmail.com> wrote:
> I replied to bugzilla rather than sending to proper mailing list !
>
> At the same time it looks like you also found the root cause of the
> problem Jonathan. Just let me know if you want to deal with it eventually.
>
I'll take care of it, thanks.
> François
>
> -------- Forwarded Message --------
> Subject: Re: [Bug libstdc++/90276] PSTL tests fail in Debug Mode
> Date: Wed, 31 Jan 2024 19:09:02 +0100
> From: François Dumont <frs.dumont@gmail.com> <frs.dumont@gmail.com>
> To: redi at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>
> <gcc-bugzilla@gcc.gnu.org>, fdumont@gcc.gnu.org
>
> Here is the reason of the
> 20_util/specialized_algorithms/pstl/uninitialized_copy_move.cc FAIL.
>
> Maybe it fixes some other tests too, I need to run all of them.
>
> libstdc++: Do not forward arguments several times [PR90276]
>
> Forwarding several times the same arguments results in UB. It is
> detected
> by the _GLIBCXX_DEBUG mode as an attempt to use a singular iterator
> which has
> been moved.
>
> libstdc++-v3/ChangeLog
>
> PR libstdc++/90276
> * testsuite/util/pstl/test_utils.h: Remove std::forward<>
> calls when
> done several times on the same arguments.
>
> Ok to commit ?
>
> François
>
>
> On 31/01/2024 14:11, redi at gcc dot gnu.org wrote:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90276
>
> Jonathan Wakely <redi at gcc dot gnu.org> changed:
>
> What |Removed |Added
>
> ----------------------------------------------------------------------------
> See Also| |https://github.com/llvm/llv
> | |m-project/issues/80136
>
>
@@ -1088,13 +1088,14 @@ struct reverse_invoker
operator()(Rest&&... rest)
{
// Random-access iterator
- iterator_invoker<std::random_access_iterator_tag, IsReverse>()(std::forward<Rest>(rest)...);
+ iterator_invoker<std::random_access_iterator_tag, IsReverse>()(rest...);
// Forward iterator
- iterator_invoker<std::forward_iterator_tag, IsReverse>()(std::forward<Rest>(rest)...);
+
+ iterator_invoker<std::forward_iterator_tag, IsReverse>()(rest...);
// Bidirectional iterator
- iterator_invoker<std::bidirectional_iterator_tag, IsReverse>()(std::forward<Rest>(rest)...);
+ iterator_invoker<std::bidirectional_iterator_tag, IsReverse>()(rest...);
}
};
@@ -1104,8 +1105,8 @@ struct invoke_on_all_iterator_types
void
operator()(Rest&&... rest)
{
- reverse_invoker</* IsReverse = */ std::false_type>()(std::forward<Rest>(rest)...);
- reverse_invoker</* IsReverse = */ std::true_type>()(std::forward<Rest>(rest)...);
+ reverse_invoker</* IsReverse = */ std::false_type>()(rest...);
+ reverse_invoker</* IsReverse = */ std::true_type>()(rest...);
}
};
//============================================================================
@@ -1118,10 +1119,10 @@ invoke_on_all_policies(Op op, T&&... rest)
using namespace __pstl::execution;
// Try static execution policies
- invoke_on_all_iterator_types()(seq, op, std::forward<T>(rest)...);
- invoke_on_all_iterator_types()(unseq, op, std::forward<T>(rest)...);
- invoke_on_all_iterator_types()(par, op, std::forward<T>(rest)...);
- invoke_on_all_iterator_types()(par_unseq, op, std::forward<T>(rest)...);
+ invoke_on_all_iterator_types()(seq, op, rest...);
+ invoke_on_all_iterator_types()(unseq, op, rest...);
+ invoke_on_all_iterator_types()(par, op, rest...);
+ invoke_on_all_iterator_types()(par_unseq, op, rest...);
}
template <typename F>