[clang] [clang-cl] Document behavior difference of strict aliasing in clang-cl vs clang. (PR #68460)

via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 9 10:53:48 PDT 2023


================
@@ -4722,3 +4724,17 @@ The Visual C++ Toolset has a slightly more elaborate mechanism for detection.
     The registry information is used to help locate the installation as a final
     fallback.  This is only possible for pre-VS2017 installations and is
     considered deprecated.
+
+Restrictions and Limitations compared to Clang
+----------------------------------------------
+
+Strict Aliasing
+^^^^^^^^^^^^^^^
+
+Strict aliasing (TBAA) is turned off by default in clang-cl at optimization
+levels O3 and below, and turned on at Ofast. Whereas in clang, strict aliasing
----------------
zmodem wrote:

clang-cl uses MSVC's `-O` flag, so there is no `-O3` or `-Ofast`. So unless I'm missing something, I think we should say that it's always off by default in clang-cl.

https://github.com/llvm/llvm-project/pull/68460


More information about the cfe-commits mailing list