From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88241 invoked by alias); 1 Apr 2017 16:48:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 87299 invoked by uid 89); 1 Apr 2017 16:48:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:2336 X-Spam-User: qpsmtpd, 2 recipients X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 01 Apr 2017 16:48:18 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1cuMCF-0004bu-BK from Andrew_Jenner@mentor.com ; Sat, 01 Apr 2017 09:48:15 -0700 Received: from [IPv6:::1] (137.202.0.87) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Sat, 1 Apr 2017 17:48:11 +0100 From: Andrew Jenner Subject: [PATCH 4/9] libstdc++ changes for ia16 To: GCC Patches , Message-ID: <916ca0f1-1bb4-4032-8bfe-abd39b5714a1@codesourcery.com> Date: Sat, 01 Apr 2017 16:48:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------B11C3BE3540E5B3D07431B19" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2017-04/txt/msg00013.txt.bz2 --------------B11C3BE3540E5B3D07431B19 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 216 2017-04-01 Andrew Jenner * src/c++11/cow-stdexcept.cc (_ITM_RU2): Declare. (txnal_read_ptr): Allow 16-bit pointers. * src/c++11/codecvt.cc (read_utf8_code_point): Handle 16-bit int. --------------B11C3BE3540E5B3D07431B19 Content-Type: text/x-patch; name="gcc_ia16_libstdc++.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gcc_ia16_libstdc++.patch" Content-length: 2207 Index: libstdc++-v3/src/c++11/cow-stdexcept.cc =================================================================== --- libstdc++-v3/src/c++11/cow-stdexcept.cc (revision 475331) +++ libstdc++-v3/src/c++11/cow-stdexcept.cc (revision 475455) @@ -208,6 +208,8 @@ extern void* _ZGTtnaX (size_t sz) __attr extern void _ZGTtdlPv (void* ptr) __attribute__((weak)); extern uint8_t _ITM_RU1(const uint8_t *p) ITM_REGPARM __attribute__((weak)); +extern uint16_t _ITM_RU2(const uint16_t *p) + ITM_REGPARM __attribute__((weak)); extern uint32_t _ITM_RU4(const uint32_t *p) ITM_REGPARM __attribute__((weak)); extern uint64_t _ITM_RU8(const uint64_t *p) @@ -272,12 +274,15 @@ _txnal_cow_string_C1_for_exceptions(void static void* txnal_read_ptr(void* const * ptr) { static_assert(sizeof(uint64_t) == sizeof(void*) - || sizeof(uint32_t) == sizeof(void*), - "Pointers must be 32 bits or 64 bits wide"); + || sizeof(uint32_t) == sizeof(void*) + || sizeof(uint16_t) == sizeof(void*), + "Pointers must be 16 bit or 32 bits or 64 bits wide"); #if __UINTPTR_MAX__ == __UINT64_MAX__ return (void*)_ITM_RU8((const uint64_t*)ptr); -#else +#elif __UINTPTR__MAX__ == __UINT32_MAX__ return (void*)_ITM_RU4((const uint32_t*)ptr); +#else + return (void*)_ITM_RU2((const uint16_t*)ptr); #endif } Index: libstdc++-v3/src/c++11/codecvt.cc =================================================================== --- libstdc++-v3/src/c++11/codecvt.cc (revision 475331) +++ libstdc++-v3/src/c++11/codecvt.cc (revision 475455) @@ -177,7 +177,7 @@ namespace unsigned char c3 = from.next[2]; if ((c3 & 0xC0) != 0x80) return invalid_mb_sequence; - char32_t c = (c1 << 12) + (c2 << 6) + c3 - 0xE2080; + char32_t c = ((char32_t)c1 << 12) + (c2 << 6) + c3 - 0xE2080; if (c <= maxcode) from.next += 3; return c; @@ -199,7 +199,8 @@ namespace unsigned char c4 = from.next[3]; if ((c4 & 0xC0) != 0x80) return invalid_mb_sequence; - char32_t c = (c1 << 18) + (c2 << 12) + (c3 << 6) + c4 - 0x3C82080; + char32_t c = ((char32_t)c1 << 18) + ((char32_t)c2 << 12) + (c3 << 6) + + c4 - 0x3C82080; if (c <= maxcode) from.next += 4; return c; --------------B11C3BE3540E5B3D07431B19--