public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: More new AIX errors
       [not found] ` <20201126223304.GN1312820@redhat.com>
@ 2020-11-26 23:02   ` Jonathan Wakely
  2020-11-27 17:50     ` David Edelsohn
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wakely @ 2020-11-26 23:02 UTC (permalink / raw)
  To: David Edelsohn; +Cc: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]

On 26/11/20 22:33 +0000, Jonathan Wakely wrote:
>On 26/11/20 15:33 -0500, David Edelsohn via Libstdc++ wrote:
>>Hi, Jonathan
>>
>>Thanks for the recent fixes.  I still see a few errors that have crept
>>in on AIX.  All the same:
>>
>>FAIL: 17_intro/headers/c++2020/all_no_rtti.cc (test for excess errors)
>>FAIL: 17_intro/headers/c++2020/all_pedantic_errors.cc (test for excess errors)
>>FAIL: 17_intro/headers/c++2020/operator_names.cc (test for excess errors)
>>FAIL: 17_intro/headers/c++2020/stdc++.cc (test for excess errors)
>>FAIL: 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc (test for
>>excess errors)
>>
>>/tmp/GCC/powerpc-ibm-aix7.2.3.0/libstdc++-v3/include/latch:64: error:
>>'notify_all' is not a member of 'std::__atomic_impl'
>>/tmp/GCC/powerpc-ibm-aix7.2.3.0/libstdc++-v3/include/latch:75: error:
>>'__atomic_wait' is not a member of 'std'; did you mean
>>'__atomic_val_t'?
>>
>>Can you take a look when you have a moment?
>
>I think that was caused by r11-5436 which added <latch> to the
>precompiled header <bits/stdc++.h>, and <latch> incorrectly assumes
>that the atomic waiting functions are always available. They're not
>available for the gthr-single.h multilib on AIX.
>
>I'm testing the fix now.

And here it is. Committed to trunk.



[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 2151 bytes --]

commit 71988274865bf049c7705ce33350661b75f0af74
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Nov 26 21:54:46 2020

    libstdc++: Only define std::latch if atomic waiting is available
    
    libstdc++-v3/ChangeLog:
    
            * include/std/latch: Depend on _GLIBCXX_HAS_GTHREADS and
            _GLIBCXX_HAVE_LINUX_FUTEX.
            * include/std/version (__cpp_lib_latch): Define conditionally.

diff --git a/libstdc++-v3/include/std/latch b/libstdc++-v3/include/std/latch
index 9d9c880a88bd..3af295b4eb43 100644
--- a/libstdc++-v3/include/std/latch
+++ b/libstdc++-v3/include/std/latch
@@ -27,20 +27,22 @@
  */
 
 #ifndef _GLIBCXX_LATCH
-#define _GLIBCXX_LATCH
+#define _GLIBCXX_LATCH 1
 
 #pragma GCC system_header
 
 #if __cplusplus > 201703L
-#define __cpp_lib_latch 201907L
 
 #include <bits/atomic_base.h>
 #include <ext/numeric_traits.h>
 
+#if defined _GLIBCXX_HAS_GTHREADS || _GLIBCXX_HAVE_LINUX_FUTEX
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
+#define __cpp_lib_latch 201907L
+
   class latch
   {
   public:
@@ -87,5 +89,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   };
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
+#endif // GTHREADS || LINUX_FUTEX
 #endif // __cplusplus > 201703L
 #endif // _GLIBCXX_LATCH
diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index cf0454dbaf84..0f2da8a5ddd9 100644
--- a/libstdc++-v3/include/std/version
+++ b/libstdc++-v3/include/std/version
@@ -216,7 +216,9 @@
 #ifdef _GLIBCXX_HAS_GTHREADS
 # define __cpp_lib_jthread 201911L
 #endif
-#define __cpp_lib_latch 201907L
+#if defined _GLIBCXX_HAS_GTHREADS || defined _GLIBCXX_HAVE_LINUX_FUTEX
+# define __cpp_lib_latch 201907L
+#endif
 #define __cpp_lib_list_remove_return_type 201806L
 #if __cpp_lib_concepts
 # define __cpp_lib_make_obj_using_allocator 201811L
@@ -226,7 +228,7 @@
 #if __cpp_lib_concepts
 # define __cpp_lib_ranges 201911L
 #endif
-#if defined _GLIBCXX_HAS_GTHREADS || _GLIBCXX_HAVE_LINUX_FUTEX
+#if defined _GLIBCXX_HAS_GTHREADS || defined _GLIBCXX_HAVE_LINUX_FUTEX
 # define __cpp_lib_semaphore 201907L
 #endif
 #define __cpp_lib_shift 201806L

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: More new AIX errors
  2020-11-26 23:02   ` More new AIX errors Jonathan Wakely
@ 2020-11-27 17:50     ` David Edelsohn
  0 siblings, 0 replies; 2+ messages in thread
From: David Edelsohn @ 2020-11-27 17:50 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, GCC Patches

On Thu, Nov 26, 2020 at 6:02 PM Jonathan Wakely <jwakely@redhat.com> wrote:
>
> On 26/11/20 22:33 +0000, Jonathan Wakely wrote:
> >On 26/11/20 15:33 -0500, David Edelsohn via Libstdc++ wrote:
> >>Hi, Jonathan
> >>
> >>Thanks for the recent fixes.  I still see a few errors that have crept
> >>in on AIX.  All the same:
> >>
> >>FAIL: 17_intro/headers/c++2020/all_no_rtti.cc (test for excess errors)
> >>FAIL: 17_intro/headers/c++2020/all_pedantic_errors.cc (test for excess errors)
> >>FAIL: 17_intro/headers/c++2020/operator_names.cc (test for excess errors)
> >>FAIL: 17_intro/headers/c++2020/stdc++.cc (test for excess errors)
> >>FAIL: 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc (test for
> >>excess errors)
> >>
> >>/tmp/GCC/powerpc-ibm-aix7.2.3.0/libstdc++-v3/include/latch:64: error:
> >>'notify_all' is not a member of 'std::__atomic_impl'
> >>/tmp/GCC/powerpc-ibm-aix7.2.3.0/libstdc++-v3/include/latch:75: error:
> >>'__atomic_wait' is not a member of 'std'; did you mean
> >>'__atomic_val_t'?
> >>
> >>Can you take a look when you have a moment?
> >
> >I think that was caused by r11-5436 which added <latch> to the
> >precompiled header <bits/stdc++.h>, and <latch> incorrectly assumes
> >that the atomic waiting functions are always available. They're not
> >available for the gthr-single.h multilib on AIX.
> >
> >I'm testing the fix now.
>
> And here it is. Committed to trunk.

That fixed it!

Thanks, David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-27 17:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAGWvnyn3kNAnb4Bfc-oqKCHEji4pWj08oe+4BMzWTms=k4YRJA@mail.gmail.com>
     [not found] ` <20201126223304.GN1312820@redhat.com>
2020-11-26 23:02   ` More new AIX errors Jonathan Wakely
2020-11-27 17:50     ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).