[libcxx-commits] [libcxx] f376a3b - Work around GCC test failure that is caused by enabling optimizations. (#73998)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 2 21:43:46 PST 2023


Author: Eric
Date: 2023-12-03T00:43:41-05:00
New Revision: f376a3bba1900942f75092a7c2ea100a28e7cbac

URL: https://github.com/llvm/llvm-project/commit/f376a3bba1900942f75092a7c2ea100a28e7cbac
DIFF: https://github.com/llvm/llvm-project/commit/f376a3bba1900942f75092a7c2ea100a28e7cbac.diff

LOG: Work around GCC test failure that is caused by enabling optimizations. (#73998)

While trying to work around MSAN/TSAN build timeouts, we enabled
optimizations on some tests. This caused GCC to start complaining that
some values may be uninitialized. I believe GCC is wrong, but more
investigation is needed.

The values are initialized when the variable `__g` is either < 0 or >=
0. Which only leaves out NaN I believe, which is likely well into UB
   land anyway.

However, more investigation needed.

Added: 
    

Modified: 
    libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp
index 946c2cfabf02b..b99c2b87cc5fe 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp
@@ -9,6 +9,11 @@
 // REQUIRES: long_tests
 // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
 
+// This test is super slow, in particular with msan or tsan. In order to avoid timeouts and to
+// spend less time waiting for this particular test to complete we compile with optimizations.
+// ADDITIONAL_COMPILE_FLAGS(msan): -O1
+// ADDITIONAL_COMPILE_FLAGS(tsan): -O1
+
 // <deque>
 
 // template <class InputIterator>

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp
index d98a73d296668..d0f6fbf0a1203 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp
@@ -8,6 +8,14 @@
 //
 // REQUIRES: long_tests
 
+// This test is super slow, in particular with msan or tsan. In order to avoid timeouts and to
+// spend less time waiting for this particular test to complete we compile with optimizations.
+// ADDITIONAL_COMPILE_FLAGS(msan): -O1
+// ADDITIONAL_COMPILE_FLAGS(tsan): -O1
+
+// FIXME: This and other tests fail under GCC with optimizations enabled.
+// More investigation is needed, but it appears that  GCC is performing more constant folding.
+
 // <random>
 
 // template<class IntType = int>


        


More information about the libcxx-commits mailing list