public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "François Dumont" <frs.dumont@gmail.com>
To: Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: Jonathan Wakely <jwakely@redhat.com>,
	Rainer Orth <ro@cebitec.uni-bielefeld.de>,
	Jonathan Wakely via Gcc-patches <gcc-patches@gcc.gnu.org>,
	libstdc++ <libstdc++@gcc.gnu.org>
Subject: Re: [PATCH] Move std::search into algobase.h
Date: Fri, 2 Jun 2023 09:33:32 +0200	[thread overview]
Message-ID: <8f43b613-f185-8e46-8fc6-02bc286125b5@gmail.com> (raw)
In-Reply-To: <CAH6eHdSdbpRGvq2MuU9+whgN3iMdZfz6kGYE8MqhBZK1oDL6Xw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1882 bytes --]

I haven't been able to reproduce so far.

Here is however a patch that I think will fix the problem. At least 
failing tests are UNRESOLVED on my system.

     libstdc++: Fix broken _GLIBCXX_PARALLEL mode

     Add missing <parallel/search.h> include in <parallel/algobase.h>.

     Detect availability of <omp.h> in tests needing it to make them 
UNSUPPORTED
     rather than PASS when header is missing.

     libstdc++-v3/ChangeLog:

             * include/parallel/algobase.h: Include <parallel/search.h>.
             * testsuite/lib/libstdc++.exp (check_effective_target_omp): 
New.
             * testsuite/17_intro/headers/c++2011/parallel_mode.cc:
             Add { dg-require-effective-target omp }.
             * testsuite/17_intro/headers/c++2014/parallel_mode.cc: 
Likewise.
             * testsuite/17_intro/headers/c++2017/parallel_mode.cc: 
Likewise.

Ok to commit ?


On 01/06/2023 23:57, Jonathan Wakely wrote:
>
>
> On Thu, 1 Jun 2023, 21:37 François Dumont via Libstdc++, 
> <libstdc++@gcc.gnu.org <mailto:libstdc%2B%2B@gcc.gnu.org>> wrote:
>
>     It's of course not as easy as I thought.
>
>     I would never have detected this problem on my system because I'm
>     missing omp.h.
>
>     I've implemented and added a:
>
>     // { dg-require-effective-target omp }
>
>     so that now those tests are UNRESOLVED rather than PASS.
>
>     Now I've install OMP and try to rebuild lib to reproduce the failure.
>
>
> You shouldn't need to install anything, just build gcc and don't 
> configure it with --disable-libgomp
>
I haven't used --disable-libgomp. But maybe when I run configure the 1st 
time it tried to detect OMP install and failed to find it as I just 
installed it.

I'll tried to rebuild everything to see if I can eventually have those 
tests PASS.

François

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

diff --git a/libstdc++-v3/include/parallel/algobase.h b/libstdc++-v3/include/parallel/algobase.h
index 4e4cc0fa0f2..9e5b86558e4 100644
--- a/libstdc++-v3/include/parallel/algobase.h
+++ b/libstdc++-v3/include/parallel/algobase.h
@@ -41,6 +41,7 @@
 #include <parallel/algorithmfwd.h>
 #include <parallel/find.h>
 #include <parallel/find_selectors.h>
+#include <parallel/search.h>
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/parallel_mode.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/parallel_mode.cc
index ccad7694083..7e5c2999c7a 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2011/parallel_mode.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/parallel_mode.cc
@@ -18,6 +18,7 @@
 // { dg-options "-std=gnu++11" }
 // { dg-do compile { target c++11 } }
 // { dg-require-normal-mode "" }
+// { dg-require-effective-target omp }
 
 #if __has_include(<omp.h>)
 # define _GLIBCXX_PARALLEL 1
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/parallel_mode.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/parallel_mode.cc
index 604dbda7c32..bc828de0ed6 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2014/parallel_mode.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/parallel_mode.cc
@@ -18,6 +18,7 @@
 // { dg-options "-std=gnu++14" }
 // { dg-do compile { target c++14 } }
 // { dg-require-normal-mode "" }
+// { dg-require-effective-target omp }
 
 #if __has_include(<omp.h>)
 # define _GLIBCXX_PARALLEL 1
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2017/parallel_mode.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2017/parallel_mode.cc
index 0fa7fae8d27..7c829249645 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2017/parallel_mode.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2017/parallel_mode.cc
@@ -17,6 +17,7 @@
 
 // { dg-do compile { target c++17 } }
 // { dg-require-normal-mode "" }
+// { dg-require-effective-target omp }
 
 #if __has_include(<omp.h>)
 # define _GLIBCXX_PARALLEL 1
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index c83147ce99a..0207a15c57e 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -1421,6 +1421,14 @@ proc check_effective_target_tzdb { } {
     }]
 }
 
+# Return 1 if OMP is available.
+proc check_effective_target_omp { } {
+    return [check_v3_target_prop_cached et_omp {
+	set cond "__has_include(<omp.h>)"
+	return [v3_check_preprocessor_condition omp $cond]
+    }]
+}
+
 set additional_prunes ""
 
 if { [info exists env(GCC_RUNTEST_PARALLELIZE_DIR)] \

  reply	other threads:[~2023-06-02  7:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 17:39 François Dumont
2023-05-31 17:55 ` Jonathan Wakely
2023-06-01 11:52   ` Rainer Orth
2023-06-01 12:05     ` Jonathan Wakely
2023-06-01 13:50       ` François Dumont
2023-06-01 20:36       ` François Dumont
2023-06-01 21:57         ` Jonathan Wakely
2023-06-02  7:33           ` François Dumont [this message]
2023-06-02  7:43             ` Jonathan Wakely
2023-06-02  9:47               ` François Dumont
2023-06-02 11:30                 ` Jonathan Wakely
2023-06-02 12:34                   ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f43b613-f185-8e46-8fc6-02bc286125b5@gmail.com \
    --to=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=ro@cebitec.uni-bielefeld.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).