From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2152) id 737E73858C52; Sat, 4 Feb 2023 17:39:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 737E73858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675532350; bh=KpExdHNmDCNs8upLFyKvPRkKqEm0IRSaRB5/UJB+XbI=; h=From:To:Subject:Date:From; b=RYGMDe6vHcWSXE7U/6Y06D315PrqD9z0jBjEXZFHDTRsMn60WugKO8sS36etJjSdw p15ejE7JhS5gl97b5Hov5O9r+31A/BOmFCPVT8A2AotUV94N3SvSfgcK0OWjCJENSK d1lCVsLZ+TrcheXbvQfrYr3m8W+vn7scWvhfWjP0= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Hans-Peter Nilsson To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-5702] libstdc++: Avoid use of naked int32_t in unseq_backend_simd.h, PR108672 X-Act-Checkin: gcc X-Git-Author: Hans-Peter Nilsson X-Git-Refname: refs/heads/master X-Git-Oldrev: 08fde093cab28b893e9d2bccfee68d660cfa0774 X-Git-Newrev: 72058eea9d407edc85558efc76cde5ceb1d06b0a Message-Id: <20230204173910.737E73858C52@sourceware.org> Date: Sat, 4 Feb 2023 17:39:10 +0000 (GMT) List-Id: https://gcc.gnu.org/g:72058eea9d407edc85558efc76cde5ceb1d06b0a commit r13-5702-g72058eea9d407edc85558efc76cde5ceb1d06b0a Author: Hans-Peter Nilsson Date: Sat Feb 4 18:38:45 2023 +0100 libstdc++: Avoid use of naked int32_t in unseq_backend_simd.h, PR108672 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. Diff: --- 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 a05de39f757..f6265f5c16e 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)))