From 70320f41172dc0a826cef614e3c8b379fdc4444c Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 12 Aug 2020 13:52:55 +0100 Subject: [PATCH] aco: assert a label only uses one of the members in ssa_info's union MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_optimizer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 7c3cdfd667d..1e988952394 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -125,6 +125,10 @@ static constexpr uint64_t temp_labels = label_abs | label_neg | label_temp | lab label_scc_invert | label_b2i; static constexpr uint32_t val_labels = label_constant_32bit | label_constant_64bit | label_constant_16bit | label_literal; +static_assert((instr_labels & temp_labels) == 0, "labels cannot intersect"); +static_assert((instr_labels & val_labels) == 0, "labels cannot intersect"); +static_assert((temp_labels & val_labels) == 0, "labels cannot intersect"); + struct ssa_info { uint64_t label; union {