From 61f9afe7d83da074a72f563e419bffa9d3948154 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 17 Feb 2020 14:38:43 +1100 Subject: [PATCH 7/7] string_conversion: workaround GCC10 codegen bug --- src/common/string_conversion.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/string_conversion.cc b/src/common/string_conversion.cc index 11d60a36..bcc54576 100644 --- a/src/common/string_conversion.cc +++ b/src/common/string_conversion.cc @@ -115,7 +115,9 @@ void UTF32ToUTF16Char(wchar_t in, uint16_t out[2]) { } static inline uint16_t Swap(uint16_t value) { - return (value >> 8) | static_cast(value << 8); + // HACK: Use addition rather than bitwise-or to workaround an internal + // compiler bug in AST generator for left-rotate under GCC-10_pre. + return (value >> 8u) + static_cast(value << 8u); } string UTF16ToUTF8(const vector &in, bool swap) { -- 2.28.0