|  | 
|  | 1 | +From ddba656f3f0ff3406b689d04e97ca40016140b18 Mon Sep 17 00:00:00 2001 | 
|  | 2 | +From: Max Ihlenfeldt <max@igalia.com> | 
|  | 3 | +Date: Thu, 5 Oct 2023 14:41:11 +0000 | 
|  | 4 | +Subject: [PATCH] Fix "static_assert failed" build error on 32-bit ARM | 
|  | 5 | + | 
|  | 6 | +117 introduced some code where a static_assert is guarded by a constexpr | 
|  | 7 | +if, and the assert will fail if the if-condition is false. Recent clang | 
|  | 8 | +versions (e.g. clang 17) are able to handle this, but with clang <= 15, | 
|  | 9 | +there is a build error because the static_assert fails. | 
|  | 10 | + | 
|  | 11 | +Given that the code compiles fine with clang 17, we know that the logic | 
|  | 12 | +checks out, even if clang 14/15 is unable to recognize it. Thus, we just | 
|  | 13 | +comment out the static_assert. | 
|  | 14 | + | 
|  | 15 | +Upstream-Status: Inappropriate [specific to older versions of clang] | 
|  | 16 | +Signed-off-by: Max Ihlenfeldt <max@igalia.com> | 
|  | 17 | +--- | 
|  | 18 | + v8/src/maglev/maglev-code-generator.cc | 4 ++-- | 
|  | 19 | + 1 file changed, 2 insertions(+), 2 deletions(-) | 
|  | 20 | + | 
|  | 21 | +diff --git a/v8/src/maglev/maglev-code-generator.cc b/v8/src/maglev/maglev-code-generator.cc | 
|  | 22 | +index e5ec70c..271a311 100644 | 
|  | 23 | +--- a/v8/src/maglev/maglev-code-generator.cc | 
|  | 24 | ++++ b/v8/src/maglev/maglev-code-generator.cc | 
|  | 25 | +@@ -419,7 +419,7 @@ class ParallelMoveResolver { | 
|  | 26 | +   void EmitMovesFromSource(RegisterT source_reg, GapMoveTargets&& targets) { | 
|  | 27 | +     DCHECK(moves_from_register_[source_reg.code()].is_empty()); | 
|  | 28 | +     if constexpr (DecompressIfNeeded) { | 
|  | 29 | +-      static_assert(COMPRESS_POINTERS_BOOL); | 
|  | 30 | ++      // static_assert(COMPRESS_POINTERS_BOOL); | 
|  | 31 | +       if (targets.needs_decompression == kNeedsDecompression) { | 
|  | 32 | +         __ DecompressTagged(source_reg, source_reg); | 
|  | 33 | +       } | 
|  | 34 | +@@ -462,7 +462,7 @@ class ParallelMoveResolver { | 
|  | 35 | +     // Decompress after the first move, subsequent moves reuse this register so | 
|  | 36 | +     // they're guaranteed to be decompressed. | 
|  | 37 | +     if constexpr (DecompressIfNeeded) { | 
|  | 38 | +-      static_assert(COMPRESS_POINTERS_BOOL); | 
|  | 39 | ++      // static_assert(COMPRESS_POINTERS_BOOL); | 
|  | 40 | +       if (targets.needs_decompression == kNeedsDecompression) { | 
|  | 41 | +         __ DecompressTagged(register_with_slot_value, register_with_slot_value); | 
|  | 42 | +         targets.needs_decompression = kDoesNotNeedDecompression; | 
0 commit comments