From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id E31813858C78 for ; Mon, 22 Apr 2024 16:06:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E31813858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E31813858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713802004; cv=none; b=Z+GpbGJhcVDLCnYSmKdeEUtonBswIKLLJcC5hVO80o1IsJq+8zuUKXHDSe7KZWlXT+YzsmoRWUulgIZ+6fvm8OItbZDngqBIobqsj0C5vt/ng7vqTxBURcqxO/Sn45E/Y15TZh/UxRyusJyfze61NYlhh9+3kdcfvO5oZU61prQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713802004; c=relaxed/simple; bh=YX03QcBzriIchbOGDQzLbs+olRWBsIhxUBJQbRaZoU0=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=dw4jLC6UfRPPyS8ebCg01PxDLk0eaSX+xeXxUdpBDyKsxUXFMe6jNGjLO5akCH+7ywbDbKryliO5FqvLraZHQA/ZYO693OxEE2txIIKVeXD396ve7LDiAnnlEG12jaZYazkJGkX65pioykHUx1dgfd+pNDBr0dmee8Mqx22hDJs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713801993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bqgSFmKhtEqhY6bcVbcSaoZqq4mS7x6rPmZJZdDCVKw=; b=DYUPG5nkseYwqJhKAs1oKvnXv/zOAcQisiweQRlb1/2cTTHmcyVr4e4qfOITxYrLyuDI2m NZnI6K2V+ApMgFazVqOPjtAYm4Ae5zIkr8LHrvjrfk7wE99I/sIeZhXG7yCbbTt2AuMD2m bl9PEf7B/58vVERnHd/ZBof/gS1o+Mg= Received: from mail-yb1-f200.google.com (mail-yb1-f200.google.com [209.85.219.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-561-12l3JWRWNUaSPgIylthYyw-1; Mon, 22 Apr 2024 12:06:32 -0400 X-MC-Unique: 12l3JWRWNUaSPgIylthYyw-1 Received: by mail-yb1-f200.google.com with SMTP id 3f1490d57ef6-de46f4eacd3so8673236276.3 for ; Mon, 22 Apr 2024 09:06:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713801991; x=1714406791; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bqgSFmKhtEqhY6bcVbcSaoZqq4mS7x6rPmZJZdDCVKw=; b=ckugX0vn9gJsmU1APA/wo0l3b9MPLrTs+3EtfqTYus4WXJ3Y08jiBD67oAeRv7wzNH eUpEJrkLhgi7KZKj6r9s4SewGLRY3qPhwNd3CLsgP622t9NQiDE3mMAopFvXVC8g70xV LkQJPLSi31meqtnC3tPf3Ej4IBexZGqpNjMIqTlf5vygcg8CKwlYkBtHE6q0sxsekb1A RRpB5nCp3h6oJobiEQRq1Pr0E+QPbtHshKC0+bL1npeDBk0VcluZuoAHh7uY0jO6mrn4 KCFaPeclURFrZ4+3y8BX6DpU6UESoqW2E3/S5QFkANkvd8HVJOvHlnwcxEYtaQryXPai qPdA== X-Forwarded-Encrypted: i=1; AJvYcCVoVoBZ3czhSOCunBQsL9tztfYcz9RG+MMCJfHmbr/0caoQXbxx/v2P/AT4LK67gIUUBB2QCwF2eaWxOg161Yqed5mKQIs= X-Gm-Message-State: AOJu0YzJCFijuC7ZF/MGhTBSWz8YoFDyzRIvsayHxglV9AQfOBSw5G0U 0gYeXpmxYTFyXvKSQm2Hp7xH51llKA1mp0xoncqlntKjBL34mVnUcvjpMTuh2mQ2WM6GQE7iAm1 RfkbQi/iHsLgHUtfam2qgf5zRznTaa764gn0EfxaYEt2WkmfM/1UhWl63RrsttkAxWCjz7yRriq kRnXcLz9eRZupr/EPHBNYTG0lI4NM= X-Received: by 2002:a25:d803:0:b0:dc6:dc58:8785 with SMTP id p3-20020a25d803000000b00dc6dc588785mr10114966ybg.62.1713801991476; Mon, 22 Apr 2024 09:06:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkL9QVbq+fn41At7Mk7+5bKHodd2YZwShxrcZUCCAumPi4NJAO53r3039lktppVIpoBHQVZI0ITxzyDsUNFR4= X-Received: by 2002:a25:d803:0:b0:dc6:dc58:8785 with SMTP id p3-20020a25d803000000b00dc6dc588785mr10114947ybg.62.1713801991183; Mon, 22 Apr 2024 09:06:31 -0700 (PDT) MIME-Version: 1.0 References: <5859837.GXAFRqVoOG@centauriprime> In-Reply-To: <5859837.GXAFRqVoOG@centauriprime> From: Jonathan Wakely Date: Mon, 22 Apr 2024 17:06:15 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: Silence irrelevant warnings in To: Matthias Kretz Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 22 Apr 2024 at 16:30, Matthias Kretz wrote: > > Tested on x86_64-linux-gnu, powerpc64le-linux-gnu, aarch64-linux-gnu, arm= - > linux-gnueabihf > > OK for trunk and backports? OK, thanks > > ----------------------------- 8< --------------------------------- > > > Avoid > -Wnarrowing in C code; > -Wtautological-compare in unconditional static_assert (necessary for > faking a dependency on a template parameter) > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > * include/experimental/bits/simd.h: Ignore -Wnarrowing for > arm_neon.h. > (__int_for_sizeof): Replace tautological compare with checking > for invalid template parameter value. > * include/experimental/bits/simd_builtin.h (__extract_part): > Remove tautological compare by combining two static_assert. > --- > libstdc++-v3/include/experimental/bits/simd.h | 8 +++++++- > libstdc++-v3/include/experimental/bits/simd_builtin.h | 3 +-- > 2 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3= / > include/experimental/bits/simd.h > index 03c2e17a326..6ef9c955cfa 100644 > --- a/libstdc++-v3/include/experimental/bits/simd.h > +++ b/libstdc++-v3/include/experimental/bits/simd.h > @@ -44,7 +44,12 @@ > #if _GLIBCXX_SIMD_X86INTRIN > #include > #elif _GLIBCXX_SIMD_HAVE_NEON > +#pragma GCC diagnostic push > +// narrowing conversion of '__a' from 'uint64_t' {aka 'long long unsigne= d > int'} to > +// 'int64x1_t' {aka 'long long int'} [-Wnarrowing] > +#pragma GCC diagnostic ignored "-Wnarrowing" > #include > +#pragma GCC diagnostic pop > #endif > #if _GLIBCXX_SIMD_HAVE_SVE > #include > @@ -598,6 +603,7 @@ struct __is_bitmask > constexpr auto > __int_for_sizeof() > { > + static_assert(_Bytes > 0); > if constexpr (_Bytes =3D=3D sizeof(int)) > return int(); > #ifdef __clang__ > @@ -663,7 +669,7 @@ struct _Ip > return _Ip{}; > } > else > - static_assert(_Bytes !=3D _Bytes, "this should be unreachable"); > + static_assert(_Bytes =3D=3D 0, "this should be unreachable"); > } > #pragma GCC diagnostic pop > > diff --git a/libstdc++-v3/include/experimental/bits/simd_builtin.h b/libs= tdc+ > +-v3/include/experimental/bits/simd_builtin.h > index af0c4886108..49c7c7e1c70 100644 > --- a/libstdc++-v3/include/experimental/bits/simd_builtin.h > +++ b/libstdc++-v3/include/experimental/bits/simd_builtin.h > @@ -278,8 +278,7 @@ __extract_part(const _SimdWrapper<_Tp, _Np> __x) > __extract_part(const _SimdWrapper __x) > { > static_assert(_Combine =3D=3D 1, "_Combine !=3D 1 not implemented"); > - static_assert(__have_avx512f && _Np =3D=3D _Np); > - static_assert(_Total >=3D 2 && _Index + _Combine <=3D _Total && _Ind= ex >=3D 0); > + static_assert(__have_avx512f && _Total >=3D 2 && _Index + _Combine <= =3D > _Total && _Index >=3D 0); > return __x._M_data >> (_Index * _Np / _Total); > } > > -- > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > Dr. Matthias Kretz https://mattkretz.github.io > GSI Helmholtz Centre for Heavy Ion Research https://gsi.de > std=E2=82=93::simd > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 >