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]

[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


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