From 1081a2d81829ce5b09adb9b30b9de6dec68a4274 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 25 Feb 2026 08:12:00 -0800 Subject: [PATCH] Build the STL with only `/O2`, not `/Os` --- CMakeLists.txt | 4 +--- stl/src/vector_algorithms.cpp | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index afb6a97f978..4ae54d0071d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,9 +105,7 @@ if(STL_USE_ANALYZE) endif() set(VCLIBS_DEBUG_OPTIONS "$<$:/Od>") - -# TRANSITION, GH-2108: Investigate building the STL with only /O2, not /Os. -set(VCLIBS_RELEASE_OPTIONS "$<$:/O2;/Os>") +set(VCLIBS_RELEASE_OPTIONS "$<$:/O2>") if(CONFIGURE_TESTING) add_subdirectory(tests) diff --git a/stl/src/vector_algorithms.cpp b/stl/src/vector_algorithms.cpp index 474d0fc1c9e..f896b8c635e 100644 --- a/stl/src/vector_algorithms.cpp +++ b/stl/src/vector_algorithms.cpp @@ -5,10 +5,6 @@ #error _M_CEE_PURE should not be defined when compiling vector_algorithms.cpp. #endif -#ifndef _DEBUG -#pragma optimize("t", on) // TRANSITION, GH-2108: Override /Os with /Ot for this TU before any function definitions -#endif - #include <__msvc_minmax.hpp> #include #include