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]

[C++ PATCH] Fix up __cpp_transactional_memory value (PR c++/86068)


Hi!

As mentioned in the PR, the current __cpp_transactional_memory macro
value with -fgnu-tm is clearly bogus, what will be standardized in 2105
is unknown.

The big question is if we should go with the value that was meant to be used
in r228462 as this patch does, or if we should go for 201505 - is
atomic_cancel implemented now?

In any case, bootstrapped/regtested on x86_64-linux and i686-linux.

2018-06-06  Jakub Jelinek  <jakub@redhat.com>

	PR c++/86068
	* c-cppbuiltin.c (c_cpp_builtins): Fix a typo, set
	__cpp_transactional_memory to 201500 instead of 210500.

	* include/bits/c++config: Check __cpp_transactional_memory >= 201500L
	rather than __cpp_transactional_memory >= 201505L.

--- gcc/c-family/c-cppbuiltin.c.jj	2018-06-04 09:20:01.356136845 +0200
+++ gcc/c-family/c-cppbuiltin.c	2018-06-06 12:30:23.399425653 +0200
@@ -981,7 +981,7 @@ c_cpp_builtins (cpp_reader *pfile)
       if (flag_tm)
 	/* Use a value smaller than the 201505 specified in
 	   the TS, since we don't yet support atomic_cancel.  */
-	cpp_define (pfile, "__cpp_transactional_memory=210500");
+	cpp_define (pfile, "__cpp_transactional_memory=201500");
       if (flag_sized_deallocation)
 	cpp_define (pfile, "__cpp_sized_deallocation=201309");
       if (aligned_new_threshold)
--- libstdc++-v3/include/bits/c++config.jj	2018-05-10 22:40:51.010061973 +0200
+++ libstdc++-v3/include/bits/c++config	2018-06-06 15:36:49.883421506 +0200
@@ -535,7 +535,7 @@ namespace std
 // Most of the following conditions are due to limitations in the current
 // implementation.
 #if __cplusplus >= 201103L && _GLIBCXX_USE_CXX11_ABI			\
-  && _GLIBCXX_USE_DUAL_ABI && __cpp_transactional_memory >= 201505L	\
+  && _GLIBCXX_USE_DUAL_ABI && __cpp_transactional_memory >= 201500L	\
   &&  !_GLIBCXX_FULLY_DYNAMIC_STRING && _GLIBCXX_USE_WEAK_REF		\
   && _GLIBCXX_USE_ALLOCATOR_NEW
 #define _GLIBCXX_TXN_SAFE transaction_safe

	Jakub


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