Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-03-03 Thread Jonathan Wakely via Gcc-patches
On 03/03/21 09:14 -0800, Thiago Macieira via Libstdc++ wrote: On Wednesday, 3 March 2021 06:34:26 PST Jonathan Wakely wrote: On 26/02/21 07:59 -0800, Thiago Macieira via Libstdc++ wrote: >ints can be used as futex on Linux. ptrdiff_t on 64-bit Linux can't. Yes, we should do this for GCC 11.

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-03-03 Thread Thiago Macieira via Gcc-patches
On Wednesday, 3 March 2021 06:34:26 PST Jonathan Wakely wrote: > On 26/02/21 07:59 -0800, Thiago Macieira via Libstdc++ wrote: > >ints can be used as futex on Linux. ptrdiff_t on 64-bit Linux can't. > > Yes, we should do this for GCC 11. Want me to re-submit this one alone, with the "alignas(4)"

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-03-03 Thread Hans-Peter Nilsson
On Wed, 3 Mar 2021, Jonathan Wakely wrote: > For int, there shouldn't be any need to force the alignment. I don't > think any ABI supported by GCC allows int members to be aligned to > less than __alignof__(int). (sizeof(int) last) The CRIS ABI does as in default packed, and ISTR there was some

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-03-03 Thread Jonathan Wakely via Gcc-patches
On 03/03/21 14:56 +, Jonathan Wakely wrote: On 01/03/21 09:56 +0100, Richard Biener via Libstdc++ wrote: On Sun, Feb 28, 2021 at 10:53 PM Hans-Peter Nilsson wrote: On Fri, 26 Feb 2021, Thiago Macieira via Gcc-patches wrote: On Friday, 26 February 2021 11:31:00 PST Andreas Schwab

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-03-03 Thread Andreas Schwab
On Mär 03 2021, Jonathan Wakely wrote: > For int, there shouldn't be any need to force the alignment. I don't > think any ABI supported by GCC allows int members to be aligned to > less than __alignof__(int). There is no requirement that __alignof__(int) is big enough. Andreas. -- Andreas

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-03-03 Thread Jonathan Wakely via Gcc-patches
On 01/03/21 09:56 +0100, Richard Biener via Libstdc++ wrote: On Sun, Feb 28, 2021 at 10:53 PM Hans-Peter Nilsson wrote: On Fri, 26 Feb 2021, Thiago Macieira via Gcc-patches wrote: > On Friday, 26 February 2021 11:31:00 PST Andreas Schwab wrote: > > On Feb 26 2021, Thiago Macieira wrote: >

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-03-03 Thread Jonathan Wakely via Gcc-patches
On 26/02/21 07:59 -0800, Thiago Macieira via Libstdc++ wrote: ints can be used as futex on Linux. ptrdiff_t on 64-bit Linux can't. Yes, we should do this for GCC 11. libstdc++-v3/include/std/latch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-03-01 Thread Thomas Rodgers
On 2021-02-28 13:31, Hans-Peter Nilsson wrote: On Fri, 26 Feb 2021, Thiago Macieira via Gcc-patches wrote: On Friday, 26 February 2021 11:31:00 PST Andreas Schwab wrote: On Feb 26 2021, Thiago Macieira wrote: On Friday, 26 February 2021 10:14:42 PST Andreas Schwab wrote: On Feb 26 2021,

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-03-01 Thread Richard Biener via Gcc-patches
On Sun, Feb 28, 2021 at 10:53 PM Hans-Peter Nilsson wrote: > > > > On Fri, 26 Feb 2021, Thiago Macieira via Gcc-patches wrote: > > > On Friday, 26 February 2021 11:31:00 PST Andreas Schwab wrote: > > > On Feb 26 2021, Thiago Macieira wrote: > > > > On Friday, 26 February 2021 10:14:42 PST Andreas

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-02-28 Thread Hans-Peter Nilsson
On Fri, 26 Feb 2021, Thiago Macieira via Gcc-patches wrote: > On Friday, 26 February 2021 11:31:00 PST Andreas Schwab wrote: > > On Feb 26 2021, Thiago Macieira wrote: > > > On Friday, 26 February 2021 10:14:42 PST Andreas Schwab wrote: > > >> On Feb 26 2021, Thiago Macieira via Gcc-patches

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-02-26 Thread Thiago Macieira via Gcc-patches
On Friday, 26 February 2021 11:31:00 PST Andreas Schwab wrote: > On Feb 26 2021, Thiago Macieira wrote: > > On Friday, 26 February 2021 10:14:42 PST Andreas Schwab wrote: > >> On Feb 26 2021, Thiago Macieira via Gcc-patches wrote: > >> > -alignas(__alignof__(ptrdiff_t)) ptrdiff_t _M_a; > >> >

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-02-26 Thread Andreas Schwab
On Feb 26 2021, Thiago Macieira wrote: > On Friday, 26 February 2021 10:14:42 PST Andreas Schwab wrote: >> On Feb 26 2021, Thiago Macieira via Gcc-patches wrote: >> > @@ -85,7 +85,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> > } >> > >> > private: >> > -alignas(__alignof__(ptrdiff_t)) ptrdiff_t

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-02-26 Thread Thiago Macieira via Gcc-patches
On Friday, 26 February 2021 10:14:42 PST Andreas Schwab wrote: > On Feb 26 2021, Thiago Macieira via Gcc-patches wrote: > > @@ -85,7 +85,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > } > > > > private: > > -alignas(__alignof__(ptrdiff_t)) ptrdiff_t _M_a; > > +alignas(__alignof__(int)) int

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-02-26 Thread Andreas Schwab
On Feb 26 2021, Thiago Macieira via Gcc-patches wrote: > @@ -85,7 +85,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > } > >private: > -alignas(__alignof__(ptrdiff_t)) ptrdiff_t _M_a; > +alignas(__alignof__(int)) int _M_a; Futexes must be aligned to 4 bytes. Andreas. -- Andreas

[PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-02-26 Thread Thiago Macieira via Gcc-patches
ints can be used as futex on Linux. ptrdiff_t on 64-bit Linux can't. --- libstdc++-v3/include/std/latch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/latch b/libstdc++-v3/include/std/latch index ef8c301e5e9..156aea5c5e5 100644 ---