PR108672 re-fixed after [PATCH] libstdc++: Synchronize PSTL with upstream

Message ID 20230630034847.0D200203F8@pchp3.se.axis.com
State Repeat Merge
Headers
Series PR108672 re-fixed after [PATCH] libstdc++: Synchronize PSTL with upstream |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Hans-Peter Nilsson June 30, 2023, 3:48 a.m. UTC
  > Date: Mon, 26 Jun 2023 11:57:49 -0700
> From: Thomas Rodgers via Gcc-patches <gcc-patches@gcc.gnu.org>

> On Wed, May 17, 2023 at 12:32 PM Jonathan Wakely <jwakely@redhat.com> wrote:
> > All the actual code changes look good.

Unfortunately, this overwrote the fix for PR108672.  I take
it there's a step missing from the synchronization process;
a check that no local commits are overwritten?  Sounds like
something that can be fully scripted (not volunteering) or
already available (like, "list all commits affecting
contents touched by/between two named commits").

I did *not* check whether any other local commits were also
overwritten.  Also, not sure about whether better try to get
this upstreamed: __INT32_TYPE__ seems gcc-specific.

Anyway, r13-5702-g72058eea9d407e was "re-committed" per
below as obvious after regtesting cris-elf.

brgds, H-P

-- >8 --
Subject: libstdc++: Re-apply PR108672 fix (avoid use of naked int32_t in unseq_backend_simd.h)

The fix was overwritten by r14-2109-g3162ca09dbdc2e "libstdc++:
Synchronize PSTL with upstream".

libstdc++-v3:

	PR libstdc++/108672
	* include/pstl/unseq_backend_simd.h (__simd_or): Re-apply using
	__INT32_TYPE__ instead of int32_t.
---
 libstdc++-v3/include/pstl/unseq_backend_simd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jonathan Wakely June 30, 2023, 8:42 a.m. UTC | #1
On Fri, 30 Jun 2023 at 04:48, Hans-Peter Nilsson wrote:
>
> > Date: Mon, 26 Jun 2023 11:57:49 -0700
> > From: Thomas Rodgers via Gcc-patches <gcc-patches@gcc.gnu.org>
>
> > On Wed, May 17, 2023 at 12:32 PM Jonathan Wakely <jwakely@redhat.com> wrote:
> > > All the actual code changes look good.
>
> Unfortunately, this overwrote the fix for PR108672.  I take
> it there's a step missing from the synchronization process;
> a check that no local commits are overwritten?  Sounds like
> something that can be fully scripted (not volunteering) or
> already available (like, "list all commits affecting
> contents touched by/between two named commits").
>
> I did *not* check whether any other local commits were also
> overwritten.  Also, not sure about whether better try to get
> this upstreamed: __INT32_TYPE__ seems gcc-specific.

Clang does support it too, but I agree that upstream might not want that change.


> Anyway, r13-5702-g72058eea9d407e was "re-committed" per
> below as obvious after regtesting cris-elf.

Thanks.

I'll add an include/pstl/LOCAL_PATCHES file listed the commits we
apply locally after importing the upstream sources.

Based on git history, the initial list of commits is:

r9-6908-g0360f9ad4048ea
r9-6942-g9eda9f9231f287
r9-7071-ga34d6343a758f6
r10-572-g34d878c7bc86d4
r10-1314-g32bab8b6ad0a90
r11-7339-g7e647d71d556b7
r12-7699-gac73c944eac88f
r13-3708-ge3b10249119fb4
r13-5702-g72058eea9d407e

But several of those have been incorporated upstream, or were
reapplied correctly to our downstream copies. We'll go through the
list and find which ones need to stay there.

It looks like r10-1314-g32bab8b6ad0a90 was lost and should be re-applied.
  
Jonathan Wakely June 30, 2023, 9:57 a.m. UTC | #2
On Fri, 30 Jun 2023 at 09:42, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> On Fri, 30 Jun 2023 at 04:48, Hans-Peter Nilsson wrote:
> >
> > > Date: Mon, 26 Jun 2023 11:57:49 -0700
> > > From: Thomas Rodgers via Gcc-patches <gcc-patches@gcc.gnu.org>
> >
> > > On Wed, May 17, 2023 at 12:32 PM Jonathan Wakely <jwakely@redhat.com> wrote:
> > > > All the actual code changes look good.
> >
> > Unfortunately, this overwrote the fix for PR108672.  I take
> > it there's a step missing from the synchronization process;
> > a check that no local commits are overwritten?  Sounds like
> > something that can be fully scripted (not volunteering) or
> > already available (like, "list all commits affecting
> > contents touched by/between two named commits").
> >
> > I did *not* check whether any other local commits were also
> > overwritten.  Also, not sure about whether better try to get
> > this upstreamed: __INT32_TYPE__ seems gcc-specific.
>
> Clang does support it too, but I agree that upstream might not want that change.
>
>
> > Anyway, r13-5702-g72058eea9d407e was "re-committed" per
> > below as obvious after regtesting cris-elf.
>
> Thanks.
>
> I'll add an include/pstl/LOCAL_PATCHES file listed the commits we
> apply locally after importing the upstream sources.
>
> Based on git history, the initial list of commits is:

For the record:

> r9-6908-g0360f9ad4048ea
Upstream: c7c6413119380828d92e8beb5fb2f35d3f2e1572
> r9-6942-g9eda9f9231f287
Upstream: 2e15f4ac572bcf429ec12e8f3efbb8ad254042c7
> r9-7071-ga34d6343a758f6
Upstream: 8a497a958be1f4656eff9664e1be29491f3795d2
and 86d4ec756b5e0bc72d7e78fc574e05802959ead4
> r10-572-g34d878c7bc86d4
Not upstream (GCC-specific).
> r10-1314-g32bab8b6ad0a90
Not upstream (probably should be)
> r11-7339-g7e647d71d556b7
Upstream: b152f9f392d42e1c8e29f382f876480631575190
> r12-7699-gac73c944eac88f
Not upstream (GCC-specific)
> r13-3708-ge3b10249119fb4
Not upstream (GCC-specific)
> r13-5702-g72058eea9d407e
Not upstream (GCC-specific)
>
> But several of those have been incorporated upstream, or were
> reapplied correctly to our downstream copies. We'll go through the
> list and find which ones need to stay there.
>
> It looks like r10-1314-g32bab8b6ad0a90 was lost and should be re-applied.
  

Patch

diff --git a/libstdc++-v3/include/pstl/unseq_backend_simd.h b/libstdc++-v3/include/pstl/unseq_backend_simd.h
index 69784bcdbe66..f3c38fbbbc2a 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)))