This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][libstdc++-v3 parallel mode]
- From: Johannes Singler <singler at ira dot uka dot de>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 08 Jul 2008 17:29:32 +0200
- Subject: [PATCH][libstdc++-v3 parallel mode]
Corrects a wrong assertion (disabled by default).
Tested x86_64-unknown-linux-gnu: No regressions
Please approve for mainline and gcc-4_3-branch.
2008-07-08 Johannes Singler <singler@ira.uka.de>
* include/parallel/balanced_quicksort.h
(qsb_divide) Replace "*end" by "*(end - 1)".
Johannes
Index: include/parallel/balanced_quicksort.h
===================================================================
--- include/parallel/balanced_quicksort.h (revision 137616)
+++ include/parallel/balanced_quicksort.h (working copy)
@@ -122,11 +122,11 @@
_GLIBCXX_PARALLEL_ASSERT(
(!comp(*pivot_pos, *begin) && !comp(*(begin + n / 2), *pivot_pos))
- || (!comp(*pivot_pos, *begin) && !comp(*end, *pivot_pos))
+ || (!comp(*pivot_pos, *begin) && !comp(*(end - 1), *pivot_pos))
|| (!comp(*pivot_pos, *(begin + n / 2)) && !comp(*begin, *pivot_pos))
- || (!comp(*pivot_pos, *(begin + n / 2)) && !comp(*end, *pivot_pos))
- || (!comp(*pivot_pos, *end) && !comp(*begin, *pivot_pos))
- || (!comp(*pivot_pos, *end) && !comp(*(begin + n / 2), *pivot_pos)));
+ || (!comp(*pivot_pos, *(begin + n / 2)) && !comp(*(end - 1), *pivot_pos))
+ || (!comp(*pivot_pos, *(end - 1)) && !comp(*begin, *pivot_pos))
+ || (!comp(*pivot_pos, *(end - 1)) && !comp(*(begin + n / 2), *pivot_pos)));
#endif
// Swap pivot value to end.