From cfe150f2c8e940324d428ca77c7e1a9b8d980b21 Mon Sep 17 00:00:00 2001 From: Debian Science Maintainers Date: Tue, 26 Dec 2023 14:26:37 -0500 Subject: [PATCH] Avoid build problem on armel caused by strange compiler. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add indirection and a result test which seem to confuse GCC 13 less than the original statements. Fixes build problem: In file included from /usr/include/c++/13/atomic:41, from /<>/test/common/doctest.h:2990, from /<>/test/common/test.h:32, from /<>/test/tbb/test_concurrent_monitor.cpp:26: In member function ‘void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order) [with _ITp = bool]’, inlined from ‘void std::atomic::store(bool, std::memory_order)’ at /usr/include/c++/13/atomic:104:20, inlined from ‘void tbb::detail::r1::concurrent_monitor_base::notify_one_relaxed() [with Context = unsigned int]’ at /<>/test/tbb/../../src/tbb/concurrent_monitor.h:293:53, inlined from ‘void tbb::detail::r1::concurrent_monitor_base::notify_one() [with Context = unsigned int]’ at /<>/test/tbb/../../src/tbb/concurrent_monitor.h:276:27, inlined from ‘void DOCTEST_ANON_FUNC_35()’ at /<>/test/tbb/test_concurrent_monitor.cpp:87:44: /usr/include/c++/13/bits/atomic_base.h:481:25: error: ‘void __atomic_store_1(volatile void*, unsigned char, int)’ writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=] 481 | __atomic_store_n(&_M_i, __i, int(__m)); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ Author: Petter Reinholdtsen Forwarded: no Bug-Debian: https://bugs.debian.org/1042009 Last-Update: 2023-07-31 Gbp-Pq: Name 1050-armel-atomic-past-buffer.patch --- src/tbb/concurrent_monitor.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tbb/concurrent_monitor.h b/src/tbb/concurrent_monitor.h index 3d20ef5..66e0fe1 100644 --- a/src/tbb/concurrent_monitor.h +++ b/src/tbb/concurrent_monitor.h @@ -290,7 +290,15 @@ public: n = my_waitset.front(); if (n != end) { my_waitset.remove(*n); - to_wait_node(n)->my_is_in_list.store(false, std::memory_order_relaxed); + wait_node* wn = to_wait_node(n); + // Artificial 'if' test to work around confused armel + // gcc 13 compiler, see + // . + if (wn) { + wn->my_is_in_list.store(false, std::memory_order_relaxed); + } else { + __TBB_ASSERT(wn, "to_wait_node(n) is NULL"); + } } } -- 2.30.2