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

Message ID 20180606134156.GJ14160@tucnak
State New
Headers show
Series
  • [C++] Fix up __cpp_transactional_memory value (PR c++/86068)
Related show

Commit Message

Jakub Jelinek June 6, 2018, 1:41 p.m.
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.


	Jakub

Comments

Jason Merrill June 6, 2018, 5:44 p.m. | #1
On Wed, Jun 6, 2018 at 3:41 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> 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?


This patch is OK; atomic_cancel is not implemented.

Jason

Patch

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