On 10/29/26 18:20, Jonathan Wakely wrote:
This adds -O0 to the 25_algorithms/pstl/*/*.cc tests when compiled with
-D_GLIBCXX_DEBUG (which I do as part of my routine testing).  This more
than halves the time it takes to run that part of the testsuite with a
single -std option, going from 35 minutes to 16 minutes on my laptop.
Surprisingly, the compilation time dominates some of these tests, not
the execution time. Disabling optimization makes a big difference.

As  a side note I noticed the same for 23_containers/flat_* tests, compilation time dominates.

And my patch sent here:

https://gcc.gnu.org/pipermail/libstdc++/2026-October/068154.html

is improving things a lot.

I'll also try on those tests then.



For some tests which execute particularly slowly the runtime size (e.g.
sequence length or number of iterations) is also reduced for debug mode.

The equivalent change for 26_numerics/pstl/numeric_ops/*.cc goes from
3.5 minutes to 1 minute, but the absolute gain is much smaller so I
haven't done that as part of this commit.

libstdc++-v3/ChangeLog:

        * testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc: Add
        -O0 to options for debug mode.
        * testsuite/25_algorithms/pstl/alg_merge/merge.cc: Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/fill.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/generate.cc:
        Likewise.
        * 
testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc:
        Likewise.
        * 
testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/remove_copy.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/replace.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/swap_ranges.cc:
        Likewise.
        * 
testsuite/25_algorithms/pstl/alg_modifying_operations/transform_binary.cc:
        Likewise.
        * 
testsuite/25_algorithms/pstl/alg_modifying_operations/transform_unary.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc:
        Likewise.
        * 
testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/adjacent_find.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/for_each.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/mismatch.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc:
        Likewise.
        * testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc:
        Likewise.
---

Tested x86_64-linux.

  .../testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc  | 1 +
  libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/merge.cc | 1 +
  .../25_algorithms/pstl/alg_modifying_operations/copy_if.cc   | 1 +
  .../25_algorithms/pstl/alg_modifying_operations/copy_move.cc | 1 +
  .../25_algorithms/pstl/alg_modifying_operations/fill.cc      | 1 +
  .../25_algorithms/pstl/alg_modifying_operations/generate.cc  | 1 +
  .../pstl/alg_modifying_operations/is_partitioned.cc          | 1 +
  .../25_algorithms/pstl/alg_modifying_operations/partition.cc | 1 +
  .../pstl/alg_modifying_operations/partition_copy.cc          | 1 +
  .../25_algorithms/pstl/alg_modifying_operations/remove.cc    | 1 +
  .../pstl/alg_modifying_operations/remove_copy.cc             | 1 +
  .../25_algorithms/pstl/alg_modifying_operations/replace.cc   | 1 +
  .../pstl/alg_modifying_operations/replace_copy.cc            | 1 +
  .../25_algorithms/pstl/alg_modifying_operations/rotate.cc    | 1 +
  .../pstl/alg_modifying_operations/rotate_copy.cc             | 1 +
  .../pstl/alg_modifying_operations/swap_ranges.cc             | 1 +
  .../pstl/alg_modifying_operations/transform_binary.cc        | 1 +
  .../pstl/alg_modifying_operations/transform_unary.cc         | 1 +
  .../25_algorithms/pstl/alg_modifying_operations/unique.cc    | 1 +
  .../pstl/alg_modifying_operations/unique_copy_equal.cc       | 1 +
  .../25_algorithms/pstl/alg_nonmodifying/adjacent_find.cc     | 1 +
  .../testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc  | 1 +
  .../testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc  | 1 +
  .../testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc   | 1 +
  .../testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc   | 1 +
  .../testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc    | 1 +
  .../25_algorithms/pstl/alg_nonmodifying/find_end.cc          | 1 +
  .../25_algorithms/pstl/alg_nonmodifying/find_first_of.cc     | 1 +
  .../testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc | 1 +
  .../25_algorithms/pstl/alg_nonmodifying/for_each.cc          | 1 +
  .../25_algorithms/pstl/alg_nonmodifying/mismatch.cc          | 1 +
  .../testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc | 1 +
  .../25_algorithms/pstl/alg_nonmodifying/nth_element.cc       | 1 +
  .../testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc | 1 +
  .../25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc      | 1 +
  .../25_algorithms/pstl/alg_nonmodifying/search_n.cc          | 1 +
  .../pstl/alg_sorting/lexicographical_compare.cc              | 5 +++++
  .../testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc | 5 +++++
  .../25_algorithms/pstl/alg_sorting/partial_sort_copy.cc      | 5 +++++
  39 files changed, 51 insertions(+)

diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc
index a9205553574a..1bad19c28d27 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- inplace_merge.pass.cpp --------------------------------------------===//
  //
diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/merge.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/merge.cc
index eab12608515a..c5545b6a6efb 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/merge.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/merge.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- merge.pass.cpp ----------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc
index 9c1f1725ac21..45d68e6fb26a 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- copy_if.pass.cpp --------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc
index 5f4f984ae067..b5657cf87e3d 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- copy_move.pass.cpp ------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/fill.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/fill.cc
index d5b40658d57e..749d4cdb855c 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/fill.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/fill.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- fill.pass.cpp -----------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/generate.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/generate.cc
index c04e51207c21..13dbdfd2ed16 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/generate.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/generate.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- generate.pass.cpp -------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc
index 20ee7d296f7e..b9a675432207 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- is_partitioned.pass.cpp -------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc
index 58979bac2b00..6f49b7f8b1f2 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- partition.pass.cpp ------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc
index 804fcba2bf2b..6a4757bfd173 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- partition_copy.pass.cpp -------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc
index 9d8e5b9b305e..561937fcbab8 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- remove.pass.cpp ---------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove_copy.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove_copy.cc
index 37d7b6679dd1..ab88f275aead 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove_copy.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove_copy.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- remove_copy.pass.cpp ----------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace.cc
index c6a515e4c88d..137a04603b17 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- replace.pass.cpp --------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc
index 18f6b5491685..12230f1e5333 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- replace_copy.pass.cpp ---------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc
index 9ec9b3bcc9b4..2da4e616b2ea 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- rotate.pass.cpp ---------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc
index 1b788e1b7ee5..7c5c29c5b0c3 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc
@@ -4,6 +4,7 @@
  // { dg-timeout-factor 3 }
  // { dg-timeout-factor 5 { target debug_mode } }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- rotate_copy.pass.cpp ----------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/swap_ranges.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/swap_ranges.cc
index e371c3b2b048..d27f0c22486d 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/swap_ranges.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/swap_ranges.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- swap_ranges.pass.cpp ----------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_binary.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_binary.cc
index 16b815c5d514..7c7a5524db7f 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_binary.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_binary.cc
@@ -4,6 +4,7 @@
  // { dg-timeout-factor 3 }
  // { dg-timeout-factor 5 { target debug_mode } }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- transform_binary.pass.cpp -----------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_unary.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_unary.cc
index ddd8249b6787..8b685109ece5 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_unary.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_unary.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- transform_unary.pass.cpp ------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc
index 0f21e0450896..852c5ab18405 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- unique.pass.cpp ---------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc
index c5bc25c9140c..67dc1380d856 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- unique_copy_equal.pass.cpp ----------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/adjacent_find.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/adjacent_find.cc
index a79f11bb1ed4..37f1f30dc813 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/adjacent_find.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/adjacent_find.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- adjacent_find.pass.cpp --------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc
index 0f03d00cdbc8..a80bb6f5f42e 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- all_of.pass.cpp ---------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc
index a4bbb7d176e7..9daecb9d99ca 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- any_of.pass.cpp ---------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc
index b99754c51f15..b9bdee09a535 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- count.pass.cpp ----------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc
index 0e5ad030ee7d..27f18ba2f56f 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- equal.pass.cpp ----------------------------------------------------===//
  //
diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc
index c303ba689d7c..9da0140de978 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- find.pass.cpp -----------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc
index e6a65a9848b6..7860b25901d4 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 4 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- find_end.pass.cpp -------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc
index 5a4a81a8db7e..38c190778739 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- find_first_of.pass.cpp --------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc
index 04ef148b5f3c..fc66f636a2e7 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- find_if.pass.cpp --------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/for_each.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/for_each.cc
index 51c51221b3c3..750791d07f5c 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/for_each.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/for_each.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- for_each.pass.cpp -------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/mismatch.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/mismatch.cc
index 441f5d1e3782..a9ac0e4b6d16 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/mismatch.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/mismatch.cc
@@ -4,6 +4,7 @@
  // { dg-timeout-factor 3 }
  // { dg-timeout-factor 5 { target debug_mode } }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- mismatch.pass.cpp -------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc
index a49b6b2d45fc..910561cc62a7 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- none_of.pass.cpp --------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
index 63e6abe2ea46..9d64298ddc57 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- nth_element.pass.cpp ----------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc
index f3cc5d3bc0fe..d2188b9386be 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- reverse.pass.cpp --------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc
index a6c39a2268ba..aad48289bac4 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- reverse_copy.pass.cpp ---------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc
index fab146fc74c4..c18e537d39d0 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- search_n.pass.cpp -------------------------------------------------===//
  //
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc
 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc
index 78edeb025d78..033403059d8e 100644
--- 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc
+++ 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc
@@ -4,6 +4,7 @@
  // { dg-timeout-factor 3 }
  // { dg-timeout-factor 5 { target debug_mode } }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- lexicographical_compare.pass.cpp ----------------------------------===//
  //
@@ -105,7 +106,11 @@ void
  test_string(Predicate pred)
  {
+#ifndef _GLIBCXX_DEBUG
      const std::size_t max_n = 1000000;
+#else
+    const std::size_t max_n = 10000;
+#endif
      std::string in1 = "";
      std::string in2 = "";
      for (std::size_t n1 = 0; n1 <= max_n; ++n1)
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
index 797d0ee9340c..66fb878859b6 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
@@ -4,6 +4,7 @@
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
  // { dg-xfail-run-if "see PR 90276" { debug_mode } }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- partial_sort.pass.cpp ---------------------------------------------===//
  //
@@ -120,7 +121,11 @@ void
  test_partial_sort(Compare compare)
  {
+#ifndef _GLIBCXX_DEBUG
      const std::size_t n_max = 100000;
+#else
+    const std::size_t n_max = 10000;
+#endif
      Sequence<T> in(n_max);
      Sequence<T> exp(n_max);
      for (std::size_t n = 0; n < n_max; n = n <= 16 ? n + 1 : size_t(3.1415 * 
n))
diff --git 
a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc 
b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc
index 72336d628856..66343a400a88 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc
@@ -3,6 +3,7 @@
  // { dg-do run { target c++17 } }
  // { dg-timeout-factor 3 }
  // { dg-require-effective-target tbb_backend }
+// { dg-additional-options "-O0" { target debug_mode } }
//===-- partial_sort_copy.pass.cpp ----------------------------------------===//
  //
@@ -140,7 +141,11 @@ test_partial_sort_copy(Compare compare)
  {
typedef typename Sequence<T>::iterator iterator_type;
+#ifndef _GLIBCXX_DEBUG
      const std::size_t n_max = 100000;
+#else
+    const std::size_t n_max = 10000;
+#endif
      Sequence<T> in(n_max);
      Sequence<T> out(2 * n_max);
      Sequence<T> exp(2 * n_max);

Reply via email to