[libstdc++] : backport inline keyword on std::find

Message ID patch-19144-tamar@arm.com
State New
Headers
Series [libstdc++] : backport inline keyword on std::find |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Test passed

Commit Message

Tamar Christina Jan. 10, 2025, 2:32 p.m. UTC
  Hi All,

This is a backport version of the same patch as
https://gcc.gnu.org/pipermail/gcc-patches/2024-December/671618.html

for the release branches.  I'd like to backport this to GCC 14,13 and 12 where
the first regression showed up.  I am however aware that GCC 12 is going to
get it's last release soon and as such a backport to 12 may not be desirable
for a non correctness fix.

If that is the case I would be happy with just 13 and 14.

I've benchmarked the patch on the branches and see the regressions go away to
what they were in GCC 11.

Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.

Ok for GCC-14 and GCC-13?

Thanks,
Tamar

libstdc++-v3/ChangeLog:

	* include/bits/hashtable.h (find): Add inline keyword.

---




--
  

Comments

Jonathan Wakely Jan. 10, 2025, 2:35 p.m. UTC | #1
On Fri, 10 Jan 2025 at 14:32, Tamar Christina <tamar.christina@arm.com> wrote:
>
> Hi All,
>
> This is a backport version of the same patch as
> https://gcc.gnu.org/pipermail/gcc-patches/2024-December/671618.html
>
> for the release branches.  I'd like to backport this to GCC 14,13 and 12 where
> the first regression showed up.  I am however aware that GCC 12 is going to
> get it's last release soon and as such a backport to 12 may not be desirable
> for a non correctness fix.
>
> If that is the case I would be happy with just 13 and 14.
>
> I've benchmarked the patch on the branches and see the regressions go away to
> what they were in GCC 11.
>
> Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
>
> Ok for GCC-14 and GCC-13?

Yes for both.

I'm tempted to say it's OK for 12 as well. Maybe leave it a few weeks
in case we get reports of negative consequences for the 13 and 14
backport?

>
> Thanks,
> Tamar
>
> libstdc++-v3/ChangeLog:
>
>         * include/bits/hashtable.h (find): Add inline keyword.
>
> ---
> diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h
> index 834288c747c28e8625d9d8db387e6abe719b6c87..f5f421d2fd3218d827d673cf7dd1ec9cd9495982 100644
> --- a/libstdc++-v3/include/bits/hashtable.h
> +++ b/libstdc++-v3/include/bits/hashtable.h
> @@ -1723,7 +1723,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>            typename _ExtractKey, typename _Equal,
>            typename _Hash, typename _RangeHash, typename _Unused,
>            typename _RehashPolicy, typename _Traits>
> -    auto
> +    auto inline
>      _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
>                _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::
>      find(const key_type& __k)
> @@ -1746,7 +1746,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>            typename _ExtractKey, typename _Equal,
>            typename _Hash, typename _RangeHash, typename _Unused,
>            typename _RehashPolicy, typename _Traits>
> -    auto
> +    auto inline
>      _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
>                _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::
>      find(const key_type& __k) const
>
>
>
>
> --
  
Tamar Christina Jan. 10, 2025, 2:37 p.m. UTC | #2
> -----Original Message-----
> From: Jonathan Wakely <jwakely@redhat.com>
> Sent: Friday, January 10, 2025 2:36 PM
> To: Tamar Christina <Tamar.Christina@arm.com>
> Cc: gcc-patches@gcc.gnu.org; nd <nd@arm.com>; libstdc++@gcc.gnu.org
> Subject: Re: [PATCH][libstdc++]: backport inline keyword on std::find
> 
> On Fri, 10 Jan 2025 at 14:32, Tamar Christina <tamar.christina@arm.com> wrote:
> >
> > Hi All,
> >
> > This is a backport version of the same patch as
> > https://gcc.gnu.org/pipermail/gcc-patches/2024-December/671618.html
> >
> > for the release branches.  I'd like to backport this to GCC 14,13 and 12 where
> > the first regression showed up.  I am however aware that GCC 12 is going to
> > get it's last release soon and as such a backport to 12 may not be desirable
> > for a non correctness fix.
> >
> > If that is the case I would be happy with just 13 and 14.
> >
> > I've benchmarked the patch on the branches and see the regressions go away to
> > what they were in GCC 11.
> >
> > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
> >
> > Ok for GCC-14 and GCC-13?
> 
> Yes for both.
> 
> I'm tempted to say it's OK for 12 as well. Maybe leave it a few weeks
> in case we get reports of negative consequences for the 13 and 14
> backport?
> 

Sure, that works for me!

Thanks!,
Tamar

> >
> > Thanks,
> > Tamar
> >
> > libstdc++-v3/ChangeLog:
> >
> >         * include/bits/hashtable.h (find): Add inline keyword.
> >
> > ---
> > diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-
> v3/include/bits/hashtable.h
> > index
> 834288c747c28e8625d9d8db387e6abe719b6c87..f5f421d2fd3218d827d673cf
> 7dd1ec9cd9495982 100644
> > --- a/libstdc++-v3/include/bits/hashtable.h
> > +++ b/libstdc++-v3/include/bits/hashtable.h
> > @@ -1723,7 +1723,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >            typename _ExtractKey, typename _Equal,
> >            typename _Hash, typename _RangeHash, typename _Unused,
> >            typename _RehashPolicy, typename _Traits>
> > -    auto
> > +    auto inline
> >      _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
> >                _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::
> >      find(const key_type& __k)
> > @@ -1746,7 +1746,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >            typename _ExtractKey, typename _Equal,
> >            typename _Hash, typename _RangeHash, typename _Unused,
> >            typename _RehashPolicy, typename _Traits>
> > -    auto
> > +    auto inline
> >      _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
> >                _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::
> >      find(const key_type& __k) const
> >
> >
> >
> >
> > --
  

Patch

diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h
index 834288c747c28e8625d9d8db387e6abe719b6c87..f5f421d2fd3218d827d673cf7dd1ec9cd9495982 100644
--- a/libstdc++-v3/include/bits/hashtable.h
+++ b/libstdc++-v3/include/bits/hashtable.h
@@ -1723,7 +1723,7 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	   typename _ExtractKey, typename _Equal,
 	   typename _Hash, typename _RangeHash, typename _Unused,
 	   typename _RehashPolicy, typename _Traits>
-    auto
+    auto inline
     _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
 	       _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::
     find(const key_type& __k)
@@ -1746,7 +1746,7 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	   typename _ExtractKey, typename _Equal,
 	   typename _Hash, typename _RangeHash, typename _Unused,
 	   typename _RehashPolicy, typename _Traits>
-    auto
+    auto inline
     _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
 	       _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::
     find(const key_type& __k) const