This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]