From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by sourceware.org (Postfix) with ESMTPS id 5A9503858C52; Sat, 4 Feb 2023 09:27:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A9503858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x535.google.com with SMTP id be12so7231999edb.4; Sat, 04 Feb 2023 01:27:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HVgUjiBwN5hv7k0sfcp3k9bsVtlSC7Pp0yL003VcURU=; b=WR5X/+30TDwMlfj1ocW0EhhMtm2NRkzh9kZqV/Gk1rRP8hbp7bWl3MPwHkik6ZHwB+ sEccnCZxIMG24OygDlugwB71rtSwzufJdGr9AMTVUfbdPogvE4QMiY2NM8LY+NA1MJtD KyLKirfS/9ZnfNmy+1ddg7te7mDKKXO/wRSBjKt3bCWNUeI1PYbfd2/Oih8UBZMZ9SgQ 8TpbM6OXn4iR0kKr6bB+D2ehM4McxUwu5Gm07FA/HVgzEOm8Xl7qWZWqLiTGPCz4SCAQ 0m/KxpCwQEmP4emUFxrdjbjpCNyyh5EakREkrjKEwHFpFAdsbPs2dXwW34K1ewIf+bKl duHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=HVgUjiBwN5hv7k0sfcp3k9bsVtlSC7Pp0yL003VcURU=; b=CkwPpMQNKA9yuU0PGoJJTEKqPnkIH5QYKbjxiSd/8s4IEn32xsiJmQjAd0AUEfRnoS GskO4bbE3UUtBYz5Po+h0zs+9rEBATH3Oa9msGGATPql8H8JM7BPcIJQqG42BG7FpxJk u2gjLEE7swOgYwH8ZSSSLtZ5JPUTp47WvF57cPUuT9yesInDBXR3dlNvLf1hh+mb9JGa Nk9eBdQUMF44ZiMOg187I27rotfEuwDaZtNqOKwi+/Hrn0XwDBzBl+KYtbRSzGk/7gqm +UduCji+HjO6sKKb40VwozRmvwldJ6iOha4B7Gjv1AXaDCfzBIzbqPDeV9Oqr8u2dkq5 5TiA== X-Gm-Message-State: AO0yUKX4h8lMGfNEbcgF+c/JFTJt33r3W4xZuEABaHd7nOZIIh68N6oQ swyivG2Gd6SNQeJS75n4qX2ZmXD5LxPyfZv8PvI= X-Google-Smtp-Source: AK7set8oEJx4qVLbcQP2sqBUIq73VZqM/qVCD/XmCVKOXE2PCfVhWLoTUZWtMcc6OoLh+CvR2UJY1zdQLWBWSN3lOus= X-Received: by 2002:aa7:c652:0:b0:49e:3526:5671 with SMTP id z18-20020aa7c652000000b0049e35265671mr4007358edr.22.1675502856884; Sat, 04 Feb 2023 01:27:36 -0800 (PST) MIME-Version: 1.0 References: <20230204031940.A747420426@pchp3.se.axis.com> In-Reply-To: <20230204031940.A747420426@pchp3.se.axis.com> From: Jonathan Wakely Date: Sat, 4 Feb 2023 09:27:25 +0000 Message-ID: Subject: Re: [PATCH] libstdc++: Avoid use of naked int32_t in unseq_backend_simd.h, PR108672 To: Hans-Peter Nilsson Cc: "libstdc++" , gcc-patches Content-Type: multipart/alternative; boundary="0000000000009ad7f005f3dc6829" X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,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 List-Id: --0000000000009ad7f005f3dc6829 Content-Type: text/plain; charset="UTF-8" On Sat, 4 Feb 2023, 03:20 Hans-Peter Nilsson via Libstdc++, < libstdc++@gcc.gnu.org> wrote: > Tested cris-elf and native x86_64-pc-linux-gnu. > Ok to commit? > Yes, we already do this with other stdint.h types when we don't want to include stdint.h if we don't *really* need all of it. OK, thanks. > ---- 8< ---- > The use of a "naked" int32_t (i.e. without a fitting #include: > stdint.h or cstdint or inttypes.h or an equivalent internal header), > in libstdc++-v3/include/pstl/unseq_backend_simd.h, caused an error for > cris-elf and apparently pru-elf and I guess all "newlib targets". > (Unfortunately, there's a lack of other *-elf targets in recent months > of gcc-testresults archives.) > > This does not manifest on e.g. native x86_64-pc-linux-gnu, because > there, a definition is included as an effect of including stdlib.h in > cstdlib (following the trace in native xtreme-header-2_a.ii with > glibc-2.31-13+deb11u5). Maybe better than chasing the right #includes > is to directly use the built-in type, like so: > > libstdc++-v3: > > PR libstdc++/108672 > * include/pstl/unseq_backend_simd.h (__simd_or): Use __INT32_TYPE__ > instead of int32_t. > --- > libstdc++-v3/include/pstl/unseq_backend_simd.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libstdc++-v3/include/pstl/unseq_backend_simd.h > b/libstdc++-v3/include/pstl/unseq_backend_simd.h > index a05de39f7576..f6265f5c16e5 100644 > --- a/libstdc++-v3/include/pstl/unseq_backend_simd.h > +++ b/libstdc++-v3/include/pstl/unseq_backend_simd.h > @@ -74,7 +74,7 @@ __simd_or(_Index __first, _DifferenceType __n, _Pred > __pred) noexcept > const _Index __last = __first + __n; > while (__last != __first) > { > - int32_t __flag = 1; > + __INT32_TYPE__ __flag = 1; > _PSTL_PRAGMA_SIMD_REDUCTION(& : __flag) > for (_DifferenceType __i = 0; __i < __block_size; ++__i) > if (__pred(*(__first + __i))) > -- > 2.30.2 > > --0000000000009ad7f005f3dc6829--