Skip to content

Commit f376a3b

Browse files
authored
Work around GCC test failure that is caused by enabling optimizations. (llvm#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.
1 parent bdcf208 commit f376a3b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
// REQUIRES: long_tests
1010
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
1111

12+
// This test is super slow, in particular with msan or tsan. In order to avoid timeouts and to
13+
// spend less time waiting for this particular test to complete we compile with optimizations.
14+
// ADDITIONAL_COMPILE_FLAGS(msan): -O1
15+
// ADDITIONAL_COMPILE_FLAGS(tsan): -O1
16+
1217
// <deque>
1318

1419
// template <class InputIterator>

libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
//
99
// REQUIRES: long_tests
1010

11+
// This test is super slow, in particular with msan or tsan. In order to avoid timeouts and to
12+
// spend less time waiting for this particular test to complete we compile with optimizations.
13+
// ADDITIONAL_COMPILE_FLAGS(msan): -O1
14+
// ADDITIONAL_COMPILE_FLAGS(tsan): -O1
15+
16+
// FIXME: This and other tests fail under GCC with optimizations enabled.
17+
// More investigation is needed, but it appears that GCC is performing more constant folding.
18+
1119
// <random>
1220

1321
// template<class IntType = int>

0 commit comments

Comments
 (0)