This is the mail archive of the 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]


On 13/07/16 18:26 +0100, Jonathan Wakely wrote:
This fixes a conflict between how Parallel Mode has always used the
_GLIBCXX_ASSERTIONS macro and the new meaning we gave it for GCC 6
(enabling the lightweight debug checks).

It doesn't make sense for Parallel Mode to own that macro, and it
might be useful to enable Parallel Mode assertions without the other
checks, so I've changed all the Parallel Mode headers to check
_GLIBCXX_PARALLEL_ASSERTIONS instead. If that's not defined then it
defaults to the value of _GLIBCXX_ASSERTIONS, to preserve the old

	PR libstdc++/71856
	* include/bits/c++config (_GLIBCXX_ASSERTIONS): Define to 1 not empty.
	* include/parallel/compiletime_settings.h (_GLIBCXX_ASSERTIONS):
	Rename to _GLIBCXX_PARALLEL_ASSERTIONS and make default value depend
	* include/parallel/balanced_quicksort.h: Rename _GLIBCXX_ASSERTIONS.
	Include <unistd.h> for sleep.
	* include/parallel/losertree.h: Rename _GLIBCXX_ASSERTIONS.
	* include/parallel/merge.h: Likewise.
	* include/parallel/multiway_merge.h: Likewise.
	* include/parallel/partition.h: Likewise.
	* include/parallel/queue.h: Likewise.
	* include/parallel/sort.h: Likewise.
	* testsuite/25_algorithms/headers/algorithm/ New.

Here is a smaller patch for the gcc-6-branch, which doesn't rename the
macro, but just makes it possible to include <parallel/*> with

Tested x86_64-linux, committed to gcc-5-branch.

commit 41cc05d22def68878d0d1b3ce87d46976098189a
Author: Jonathan Wakely <>
Date:   Tue Jul 19 19:03:04 2016 +0100

    Do not define _GLIBCXX_ASSERTIONS in Parallel Mode
    	PR libstdc++/71856
    	* include/bits/c++config (_GLIBCXX_ASSERTIONS): Define to 1 not empty.
    	* include/parallel/balanced_quicksort.h: Include <unistd.h> for sleep.
    	* include/parallel/compiletime_settings.h (_GLIBCXX_ASSERTIONS):
    	Do not define here.

diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index 57024e4..4625607 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -414,7 +414,7 @@ namespace std
 // Debug Mode implies checking assertions.
 // Disable std::string explicit instantiation declarations in order to assert.
diff --git a/libstdc++-v3/include/parallel/balanced_quicksort.h b/libstdc++-v3/include/parallel/balanced_quicksort.h
index 65dec30..16ef1ef 100644
--- a/libstdc++-v3/include/parallel/balanced_quicksort.h
+++ b/libstdc++-v3/include/parallel/balanced_quicksort.h
@@ -53,6 +53,9 @@
 #include <parallel/checkers.h>
+#include <unistd.h>
 namespace __gnu_parallel
diff --git a/libstdc++-v3/include/parallel/compiletime_settings.h b/libstdc++-v3/include/parallel/compiletime_settings.h
index f4fb404..c1758aa 100644
--- a/libstdc++-v3/include/parallel/compiletime_settings.h
+++ b/libstdc++-v3/include/parallel/compiletime_settings.h
@@ -55,12 +55,6 @@
-/** @brief Switch on many _GLIBCXX_PARALLEL_ASSERTions in parallel code.
- *  Should be switched on only locally. */
 /** @brief Switch on many _GLIBCXX_PARALLEL_ASSERTions in parallel code.
  *  Consider the size of the L1 cache for

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