From 2a2741ff121f0c72ca4f78caf99f7b85ac05b2f9 Mon Sep 17 00:00:00 2001 From: Jeff Genovy <29107334+jefgen@users.noreply.github.com> Date: Tue, 13 Mar 2018 01:10:11 +0000 Subject: [PATCH] ICU-13636 The VS2017 optimizer has issues with this function. Disable optimizations for now as a work-around. X-SVN-Rev: 41095 --- icu4c/source/test/cintltst/utf8tst.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/icu4c/source/test/cintltst/utf8tst.c b/icu4c/source/test/cintltst/utf8tst.c index b7062e3b82f..9f4109c2078 100644 --- a/icu4c/source/test/cintltst/utf8tst.c +++ b/icu4c/source/test/cintltst/utf8tst.c @@ -757,6 +757,14 @@ static void TestFwdBack() { } } +/** +* Ticket #13636 - Visual Studio 2017 has problems optimizing this function. +* As a workaround, we will turn off optimization just for this function on VS2017 and above. +*/ +#if defined(_MSC_VER) && (_MSC_VER > 1900) +#pragma optimize( "", off ) +#endif + static void TestFwdBackUnsafe() { /* * Use a (mostly) well-formed UTF-8 string and test at code point boundaries. @@ -842,6 +850,13 @@ static void TestFwdBackUnsafe() { } } +/** +* Ticket #13636 - Turn optimization back on. +*/ +#if defined(_MSC_VER) && (_MSC_VER > 1900) +#pragma optimize( "", on ) +#endif + static void TestSetChar() { static const uint8_t input[] = {0x61, 0xe4, 0xba, 0x8c, 0x7f, 0xfe, 0x62, 0xc5, 0x7f, 0x61, 0x80, 0x80, 0xe0, 0x00 }; -- 2.40.0