From b136ba7215d5ee4f8ce3469933e2097c1b0e479b Mon Sep 17 00:00:00 2001 From: AMR5210 Date: Sat, 18 Jul 2026 06:11:25 +0000 Subject: [PATCH] fix: replace std::deque with std::vector in HeuristicTree BFS GCC 14 triggers -Wstrict-overflow=2 inside std::deque internals (_M_create_nodes and _M_destroy_nodes) when the container is used in check_if_structurally_correct(). Both the initializer-list constructor and the destructor inline into the call site, causing the warning to fire as a -Werror build failure on Raspberry Pi OS and other GCC 14 environments. Replace std::deque with std::vector and an index-based front pointer, which avoids the problematic STL code paths entirely. The BFS semantics are unchanged. Fixes: #1303 Signed-off-by: AMR5210 --- src/runtime/CL/mlgo/HeuristicTree.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/runtime/CL/mlgo/HeuristicTree.cpp b/src/runtime/CL/mlgo/HeuristicTree.cpp index f7b706902b0..4ba139032e8 100644 --- a/src/runtime/CL/mlgo/HeuristicTree.cpp +++ b/src/runtime/CL/mlgo/HeuristicTree.cpp @@ -28,8 +28,8 @@ #include "support/Cast.h" #include -#include #include +#include namespace arm_compute { namespace mlgo @@ -175,13 +175,15 @@ bool HeuristicTree::add_branch(NodeID id, Condition cond, NodeID t_node, NodeID bool HeuristicTree::check_if_structurally_correct() const { - std::set visited; - std::deque to_visit{_root}; + std::set visited; + std::vector to_visit; + to_visit.push_back(_root); + std::size_t front = 0; - while (!to_visit.empty()) + while (front < to_visit.size()) { - auto id = to_visit.front(); - to_visit.pop_front(); + auto id = to_visit[front]; + ++front; if (_tree.find(id) == _tree.end()) { ARM_COMPUTE_LOG_INFO_MSG_WITH_FORMAT_CORE("Missing node %zu", id);