From patchwork Thu Oct 20 14:20:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Arsen_Arsenovi=C4=87?= X-Patchwork-Id: 6221 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp139068wrr; Thu, 20 Oct 2022 07:22:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6j20RKunvqUTfflxti4V+1NJFl1fx6DhK/k6j4ziKS54bFHAjH0H14GOLy9SHUAOVLAVor X-Received: by 2002:a17:906:cc0d:b0:78e:2c06:8e70 with SMTP id ml13-20020a170906cc0d00b0078e2c068e70mr10890761ejb.732.1666275728697; Thu, 20 Oct 2022 07:22:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666275728; cv=none; d=google.com; s=arc-20160816; b=Pb1UIYCx6YwmBKbkY+6T0moDkggosI8Dpsjkl+Sq1vu5NOk5tsjOomjbTAXrTR4vF6 AQTIX0BkMkmIwBq3gv+C17Xfg9yZ1ncYfr9uq9zva+bS/IhgCMqwZPOPXkTIWSNPJskp ZQTn+s3kvbXk790uHNdIoLI/L4YFWQX8v1SYfMUkTCjI/ojrkHR445iEQq98wG3w14nK QaXARzaQhKwCNNlPqnTKlJDKZnuKuPd9cjps/BZU9g81I7tqgyvpi4p64IxCDwmM+BPT smZeEFY/Ldz2tjhdx7zN3xfg2LZL59eoLLFqxOM25D6ycyIIhqw3WCnBa4i0/137J+XO adEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=EkFx8bnaL3Tc6SqFmWdMw9lWg0SnP8g0L1dLQUaSAVI=; b=lObW79r4TLcJr51eut2neRqTX3p/pYZiYsy05cnGpzGQsEA7IcG2h7qa8dvMhsWBE+ 7PCXjZBnduWInNAG7UwKBvXUPapep+POWFHnGli8Dr2tr1/Q2Xe7lia5K7zhV9LANWfS 4ril2Tv36/v4+YLSS23EnSDyIZB2n6kALXeEginPS3VG87JgZWkDMtUZisucGasN9ZKF qSNM4T7wZtkq4gpI08sCswryiUHhxtrM/Wl6DKKEaAts7Fq3yRZpOBj5K4160qe7R5o2 H09yEIFLuOQqX8RnKg8Sl+EyibwmHlf9Hd2Lu7xP3xru+Zple7SYMpiuVGO7ZqScZx9T 21lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=cjB8ryDz; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id dt19-20020a170907729300b007804b5a2c48si17767526ejc.521.2022.10.20.07.22.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 07:22:08 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=cjB8ryDz; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF235385085B for ; Thu, 20 Oct 2022 14:22:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF235385085B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666275727; bh=EkFx8bnaL3Tc6SqFmWdMw9lWg0SnP8g0L1dLQUaSAVI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=cjB8ryDzE8dDqRigu3SUEEXfoMi7tvz20uezE5EvRRKxjp5IrwHAGgD7rp3dmp3Oh 5H8COxKHzON3vdnGWfyT7Qn0JulsRLeuSD0XHwFqGSgpSWq398QR200MU3zR0ay6sO SCEE0gBbHDS5RUuHXlDBJwoFzrsWetfkWHyHV4hY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050:0:465::102]) by sourceware.org (Postfix) with ESMTPS id 83DC63850870; Thu, 20 Oct 2022 14:20:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 83DC63850870 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4MtVBN6rfXz9sSg; Thu, 20 Oct 2022 16:20:44 +0200 (CEST) To: Jonathan Wakely Subject: [PATCH v2] libstdc++: Don't use gstdint.h anymore Date: Thu, 20 Oct 2022 16:20:19 +0200 Message-Id: <20221020142019.2418744-1-arsen@aarsen.me> In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4MtVBN6rfXz9sSg X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_INFOUSMEBIZ, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Arsen_Arsenovi=C4=87_via_Gcc-patches?= From: =?utf-8?q?Arsen_Arsenovi=C4=87?= Reply-To: =?utf-8?q?Arsen_Arsenovi=C4=87?= Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747211454701479539?= X-GMAIL-MSGID: =?utf-8?q?1747216738341413621?= libstdc++-v3/ChangeLog: * configure.ac: Stop generating gstdint.h. * src/c++11/compatibility-atomic-c++0x.cc: Stop using gstdint.h. --- > > +using guintptr_t = __UINTPTR_TYPE__; > > I think this should be local in the only function that uses it. Sure. Tested on x86_64-pc-linux-gnu. libstdc++-v3/configure.ac | 6 ------ libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 81d914b434a..c5ec976c026 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -440,12 +440,6 @@ GCC_CHECK_UNWIND_GETIPINFO GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])]) -if test "$is_hosted" = yes; then -# TODO: remove this and change src/c++11/compatibility-atomic-c++0x.cc to -# use instead of . -GCC_HEADER_STDINT(include/gstdint.h) -fi - GLIBCXX_ENABLE_SYMVERS([yes]) AC_SUBST(libtool_VERSION) diff --git a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc index 5a0c5459088..e21bd76245d 100644 --- a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc +++ b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc @@ -22,7 +22,6 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -#include "gstdint.h" #include #include @@ -119,13 +118,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_CONST __atomic_flag_base* __atomic_flag_for_address(const volatile void* __z) _GLIBCXX_NOTHROW { - uintptr_t __u = reinterpret_cast(__z); + using guintptr_t = __UINTPTR_TYPE__; + guintptr_t __u = reinterpret_cast(__z); __u += (__u >> 2) + (__u << 4); __u += (__u >> 7) + (__u << 5); __u += (__u >> 17) + (__u << 13); - if (sizeof(uintptr_t) > 4) + if (sizeof(guintptr_t) > 4) __u += (__u >> 31); - __u &= ~((~uintptr_t(0)) << LOGSIZE); + __u &= ~((~guintptr_t(0)) << LOGSIZE); return flag_table + __u; }