Message ID | 20230204031940.A747420426@pchp3.se.axis.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1178055wrn; Fri, 3 Feb 2023 19:20:43 -0800 (PST) X-Google-Smtp-Source: AK7set8A1f4NSR8wLVpC9j0xEAVgwqMNgedNhf5/FsPgP5/vvtnEntHNNzUWMd/LEWisJtJRYSHB X-Received: by 2002:a05:6402:42c2:b0:4a0:bb2e:3af0 with SMTP id i2-20020a05640242c200b004a0bb2e3af0mr15055145edc.1.1675480843260; Fri, 03 Feb 2023 19:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675480843; cv=none; d=google.com; s=arc-20160816; b=WfqchtURTTCjlJ2bPmO2xJUfi++bPkGEJwE+9b3fwj1WtlIN1S2nosp6EsAeqgrCyT K6GG4mr890/z00GywOXjQS1Av5wytUP4bTd+K7aGwyF5xDOeFzqeL1AY7kEJwzA/c9ba SF3OiOBXle06Fgf3X8+NS5Bw/QmHZJxgAwy/eEiCvcUHpOZ0qr1QLHiwdkZpmKwE9s4c Jd3le1AN1woC22tfOKQiqL2wrCEOostn7DixFFOW0+k8ciZyXzzZ7sj6n6XHwklWURXz pZ9rCUrJvuuufMFzEvoYLEcHt6x3p/tHbnDU9xn5juvDuGK8SdFgl+QgFWEJ6M6vHmA5 7t5Q== 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:date:message-id :content-transfer-encoding:mime-version:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=2S49GOwVH5FSc/KCiLWpGRYliHXNOfV+os8/ns/KvZY=; b=KxB6QsVnEAVynbyQX/VRrQQHQ16aV5OfR9okar9uOJnPLrPYZXSojrE1ay3MNJa3WO OnWcCszNcE4t1OeqBUoELNtvBXoYZJaQSfo/y/9/KQVITMC/d1K5A3bXpp6rEK295EH/ c3K2hubiiguzBZk/mUI0No4OVAX1OADtynciSpYcFgQE8XTPGxTriQwV37bCqMoTDJAw 9xPcj8EQR3s0MAORh7TKKN/k9cj52tlQ1ZLbqMNt1uN7SdcUK5dxBERfh1Kz8dNTN70O ZBtL6ZnFTDJEfEl9Vk0QegGWoIw1iFnVqVGUGIOPeurrpTT+rSnmMEXYrMxKLNDboqQH sYOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=aYRwa4wQ; 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 h10-20020a0564020e8a00b004a5c7dede97si1805143eda.370.2023.02.03.19.20.42 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 19:20:43 -0800 (PST) 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=aYRwa4wQ; 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 9DEFA3857007 for <ouuuleilei@gmail.com>; Sat, 4 Feb 2023 03:20:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DEFA3857007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675480826; 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=aYRwa4wQ0dVSrqb4BWlQmS3za/3Qeqz5lXfOGhBpNTA0WDa1izP1mw1b8erdKGEMn KwnxF8ggrvERwv8Lp9eHTqV6jfjuzYCpu3Rfdkzjs6lYWZVZ8FyYFWmEUl38wi3PjJ uWPi/B2jTG+zU0+Kio5AYVZtncA/yQkw1ERDOOFY= 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: <libstdc++@gcc.gnu.org>, <gcc-patches@gcc.gnu.org> Subject: [PATCH] libstdc++: Avoid use of naked int32_t in unseq_backend_simd.h, PR108672 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Hans-Peter Nilsson via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Hans-Peter Nilsson <hp@axis.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756869000599557539?= X-GMAIL-MSGID: =?utf-8?q?1756869000599557539?= |
Series |
libstdc++: Avoid use of naked int32_t in unseq_backend_simd.h, PR108672
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Hans-Peter Nilsson
Feb. 4, 2023, 3:19 a.m. UTC
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(-)
Comments
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 > >
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)))