From patchwork Sat Feb 4 03:19:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 1737418 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=qLhmCINi; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P7ySn1m5Gz23hd for ; Sat, 4 Feb 2023 14:20:07 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 700A8385800A for ; Sat, 4 Feb 2023 03:20:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 700A8385800A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675480803; bh=2S49GOwVH5FSc/KCiLWpGRYliHXNOfV+os8/ns/KvZY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qLhmCINi4I/HZQ4tyrBAMZL/yFqzztxj0/QO8bITw6IwniinYcVcSXnUnDIGkA0qm aY833TvanKT44ujbRKHMDeL54SNSJrVx+2MMuQAFgM8/1cLZ586dAkuU0bDDx9GePA 28GmmFhPmCOw/Iu/8vLnx3SXyirxa5gYTkjcw61s= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 66AED3858C52; Sat, 4 Feb 2023 03:19:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 66AED3858C52 To: , Subject: [PATCH] libstdc++: Avoid use of naked int32_t in unseq_backend_simd.h, PR108672 MIME-Version: 1.0 Message-ID: <20230204031940.A747420426@pchp3.se.axis.com> Date: Sat, 4 Feb 2023 04:19:40 +0100 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, SPF_HELO_PASS, 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: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Tested cris-elf and native x86_64-pc-linux-gnu. Ok to commit? ---- 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)))