From patchwork Fri May 26 11:01:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 99437 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp379983vqr; Fri, 26 May 2023 04:02:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5mwCpnZcnTiES7p+VKE4gSottLT9Ltbzn80mQr0xu15QOtYTRKfuA6y+XbfFSyszLHL6My X-Received: by 2002:aa7:c555:0:b0:510:d6b3:a1c2 with SMTP id s21-20020aa7c555000000b00510d6b3a1c2mr1132829edr.27.1685098953994; Fri, 26 May 2023 04:02:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685098953; cv=none; d=google.com; s=arc-20160816; b=tZX6cLEoDybY3lNpXmIDR83+q2mBcRIfF1lmpDPz8nbhurwFIvVoBeqrtAf3ST3GHU pTlbvCXTa6TZjc2lhXQna0j8ODkwuNew7JlvsmswtO+5iE2sc1i7AI/ZKrba+aXpJJRq bH5GR0JN6WsvNlDwRLWs5pa4lpjK5Xa1xJ+87lZH+JISqnjaZyTqVVnFC9fGsWCRmpdl 76DCDOh6W/NRatei/nJvef5Rr8zwRLBOMVpkeYnjg8SpnMh5z52eVfUoCkVRW4CdVebb S4IgcIDK1UgTf82hwoBHkc94rXhNRV1Op4N/3Qlj+ovxAD3Q6UBFxfkv1GdqZ+sG2+S9 /5lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:organization:message-id:date :subject:to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=jeJq8RqBeKRG05yXURCOMZ51ZqFUwAKb0hkPpHxeZ3U=; b=efb0CuSv0Hd/kThyXkH3j53YBDpDHZ/6V9ZoJ1NFqFgp3ugMLLpvSP9NdXED1D65U6 Ok41I2TeMvcgyBvd1twpkZCyBOd1HstHhjVuV0KxObCuuwp0W/9KoBH28XRAYhq8RJGt 3nTN6nEYK3NcDbu+S8dgoWPq++8Lf+NbLOLKbwuwTbDZ7wD6da/H6IGicuBO6+v7Cohc pgT8n3rdsIVPbzgs1rqsQdi+6C9oAvH6uWcnJpuBBCc/tvgHq1OZ6idb1OgdpjXjl7UJ jzy7dTw1c52BuI5yYONcEiSxhjhDSrHpK3bVb5rWWSDITDKwDaog2139AceaND5qbO0C lf2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=PA3A7Uqt; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d11-20020a056402078b00b00510dda37bacsi2296346edy.66.2023.05.26.04.02.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 04:02:33 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=PA3A7Uqt; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 913C63856DF4 for ; Fri, 26 May 2023 11:02:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 913C63856DF4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685098938; bh=jeJq8RqBeKRG05yXURCOMZ51ZqFUwAKb0hkPpHxeZ3U=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=PA3A7UqtQL0gQNoUKNPHNUzD8P7WATgkZW/4KVshZmroWSldi+UTJ90+k3dpm3mg0 GaKQH8WMjDs05cprloCbdhSBMenRXv+9y63r6LwdFjLJ0htEbK/q5uOZcKoGknilTI S8MsAt2zdLhZ6mh+rC6jOvQ5JxxGc13trikozP8g= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id D74B03858D3C; Fri, 26 May 2023 11:01:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D74B03858D3C Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id B5FF62051042; Fri, 26 May 2023 13:01:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dzWt631xCayA; Fri, 26 May 2023 13:01:32 +0200 (CEST) Received: from srvEX6.campus.gsi.de (unknown [10.10.4.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 9E2F32051040; Fri, 26 May 2023 13:01:32 +0200 (CEST) Received: from minbar.localnet (140.181.3.12) by srvEX6.campus.gsi.de (10.10.4.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 26 May 2023 13:01:32 +0200 To: , Subject: [committed] libstdc++: Resolve -Wsign-compare issue Date: Fri, 26 May 2023 13:01:31 +0200 Message-ID: <24154111.EfDdHjke4D@minbar> Organization: GSI Helmholtz Centre for Heavy Ion Research MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvEX6.Campus.gsi.de (10.10.4.96) To srvEX6.campus.gsi.de (10.10.4.96) X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Matthias Kretz via Gcc-patches From: Matthias Kretz Reply-To: Matthias Kretz 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?1766954320986670059?= X-GMAIL-MSGID: =?utf-8?q?1766954320986670059?= pushed to master, will backport later tested on x86_64-pc-linux-gnu and powerpc64le-linux-gnu ----------- 8< ------------ Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_ppc.h (_S_bit_shift_left): Negative __y is UB, so prefer signed compare. --- libstdc++-v3/include/experimental/bits/simd_ppc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- ────────────────────────────────────────────────────────────────────────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research https://gsi.de stdₓ::simd ────────────────────────────────────────────────────────────────────────── diff --git a/libstdc++-v3/include/experimental/bits/simd_ppc.h b/libstdc++-v3/include/experimental/bits/simd_ppc.h index 2ea7234bd99..34daa530f02 100644 --- a/libstdc++-v3/include/experimental/bits/simd_ppc.h +++ b/libstdc++-v3/include/experimental/bits/simd_ppc.h @@ -64,7 +64,7 @@ _S_bit_shift_left(_SimdWrapper<_Tp, _Np> __x, int __y) __x = _Base::_S_bit_shift_left(__x, __y); if constexpr (sizeof(_Tp) < sizeof(int)) { - if (__y >= sizeof(_Tp) * __CHAR_BIT__) + if (__y >= int(sizeof(_Tp) * __CHAR_BIT__)) return {}; } return __x;