This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[cxx-mem-model] Allow memory model to be a runtime value.
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 24 Aug 2011 10:23:27 -0400
- Subject: [cxx-mem-model] Allow memory model to be a runtime value.
As I mentioned earlier, C++11 allows the memory model to be determined
at runtime. Rather than invoke a call to a runtime library or inline a
switch statement with all the valid options, just default to SEQ_CST
mode. This can easily be changed later if it is determined to be needed.
The documentation in extend.texi looks like:
Note that the C++11 standard allows for the memory model parameter
to be determined at runtime rather than at compile time. These
builtins will map any runtime value to __SYNC_MEM_SEQ_CST rather than
invoke a runtime library call or inline a switch statement. This is
standard compliant, safe, and the simplest approach for now.
Bootstrapped and no new regressions on x86_64-unknown-linux-gnu.
Andrew