[Bug libstdc++/100164] [11 Regression] semaphore_impl not declared on AIX

2021-04-20 Thread rodgertq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100164

Thomas Rodgers  changed:

   What|Removed |Added

  Attachment #50643|0   |1
is obsolete||
  Attachment #50645|0   |1
is obsolete||

--- Comment #10 from Thomas Rodgers  ---
Created attachment 50646
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50646=edit
Work around broken macro name

This patch works around the borked macro name that David pointed out on the
mailing list. I left in the commented out _GLIBCXX_HAVE_POSIX_SEMAPHORE checks
and have temporarily replaced them with _GLIBCXX__GLIBCXX_HAVE_POSIX_SEMAPHORE,
and forced the posix semaphore test to always run if that macro is defined.

I am not sufficiently versed in the arcane ways in which config.h is
transformed to c++config.h but the borked macro transformation ideally should
be fixed and the commented out checks restored.

[Bug libstdc++/100164] [11 Regression] semaphore_impl not declared on AIX

2021-04-20 Thread dje at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100164

--- Comment #9 from David Edelsohn  ---
The previous semaphore_base.h implementation had a fallback that hid a bug in
the macros:

#if defined _GLIBCXX_HAVE_LINUX_FUTEX && !_GLIBCXX_REQUIRE_POSIX_SEMAPHORE
  // Use futex if available and didn't force use of POSIX
  using __fast_semaphore = __atomic_semaphore<__detail::__platform_wait_t>;
#elif _GLIBCXX_HAVE_POSIX_SEMAPHORE
  using __fast_semaphore = __platform_semaphore;
#else
  using __fast_semaphore = __atomic_semaphore;
#endif

The problem is that libstdc++ configure defines
_GLIBCXX_HAVE_POSIX_SEMAPHORE in config.h.  libstdc++ uses sed to
rewrite config.h to c++config.h and prepends _GLIBCXX_, so c++config.h
contains

#define _GLIBCXX__GLIBCXX_HAVE_POSIX_SEMAPHORE 1

And bits/semaphore_base.h is not testing that corrupted macro.  Either
semaphore_base.h needs to test for the corrupted macro, or libtsdc++
configure needs to define HAVE_POSIX_SEMAPHORE without itself
prepending _GLIBCXX_  so that the c++config.h rewriting works
correctly and defines the correct macro for semaphore_base.h.

[Bug libstdc++/100164] [11 Regression] semaphore_impl not declared on AIX

2021-04-20 Thread dje at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100164

--- Comment #8 from David Edelsohn  ---
I am not certain why you cannot log in to the compile farm system.
I am testing the patch on one of the AIX systems inside IBM.

[Bug libstdc++/100164] [11 Regression] semaphore_impl not declared on AIX

2021-04-20 Thread rodgertq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100164

--- Comment #7 from Thomas Rodgers  ---
Created attachment 50645
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50645=edit
Disable  on unsupported targets

Let's try this with the right patch attached this time

[Bug libstdc++/100164] [11 Regression] semaphore_impl not declared on AIX

2021-04-20 Thread dje at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100164

--- Comment #6 from David Edelsohn  ---
Created attachment 50644
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50644=edit
pre-processed source for 17_intro/headers/c++2020/all_attributes.cc

[Bug libstdc++/100164] [11 Regression] semaphore_impl not declared on AIX

2021-04-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100164

--- Comment #5 from Jakub Jelinek  ---
Comment on attachment 50643
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50643
Disable  on unsupported targets

+#else
+  __gthread_yield();

The changelog said you want to use __thread_yield(); there instead...

[Bug libstdc++/100164] [11 Regression] semaphore_impl not declared on AIX

2021-04-20 Thread rodgertq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100164

--- Comment #4 from Thomas Rodgers  ---
It would appear that I cannot log into either of the AIX machines in the
compile farm.

[Bug libstdc++/100164] [11 Regression] semaphore_impl not declared on AIX

2021-04-20 Thread rodgertq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100164

--- Comment #3 from Thomas Rodgers  ---
Created attachment 50643
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50643=edit
Disable  on unsupported targets

This patch is probably not the most elegant way to do this, it probably should
be a dg-effective-target check and it disables  on platforms where
there is a suitable Posix implementation, but this feature is experimental for
GCC11.

[Bug libstdc++/100164] [11 Regression] semaphore_impl not declared on AIX

2021-04-20 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100164

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org
 Status|NEW |ASSIGNED

[Bug libstdc++/100164] [11 Regression] semaphore_impl not declared on AIX

2021-04-20 Thread rodgertq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100164

Thomas Rodgers  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |rodgertq at gcc dot 
gnu.org

--- Comment #2 from Thomas Rodgers  ---
Investigating