Skip to content

Commit c489ea4

Browse files
author
Michal Klocek
committed
Fix OOM crash when doing arm64 builds with old gcc-10
Gcc compiler crashes when trying optimize if statement with 3 boolean due to compiler bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109505 However issue was only fixed in gcc-11 and above, unfortunately we run gcc-10 on ci. Note it happens for us only with 64 bit arm gcc, however issue is most likely also present without cross compiling with 64-bit gcc-10. Avoid optimization in that specific case. Task-number: QTBUG-123822 Change-Id: I660e759fad8d01b4aa5f9b02095d79a18f06ade2 Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/553656 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
1 parent 67e4d62 commit c489ea4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

chromium/third_party/distributed_point_functions/code/dpf/internal/evaluate_prg_hwy.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,16 @@ absl::Status EvaluateSeedsHwy(
153153

154154
// Check if inputs and outputs are aligned.
155155
constexpr size_t kHwyAlignment = alignof(Aligned128);
156+
157+
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && ((__GNUC__ << 16) + __GNUC_MINOR__ <= (11 << 16) + 4)
158+
// Gcc Bug 109505
159+
// Try to avoid triggering endless loop in gcc and OOM
160+
// and try to avoid optimize conditional booleans in
161+
// ABSL_PREDICT_FALSE(!is_aligned || hn::Lanes(d8) < 16 || hn::Lanes(d8) % 16 != 0))
162+
volatile bool is_aligned =
163+
#else
156164
const bool is_aligned =
165+
#endif
157166
(reinterpret_cast<uintptr_t>(seeds_in) % kHwyAlignment == 0) &&
158167
(reinterpret_cast<uintptr_t>(paths) % kHwyAlignment == 0) &&
159168
(reinterpret_cast<uintptr_t>(correction_seeds) % kHwyAlignment == 0) &&

0 commit comments

Comments
 (0)