From eb378e4cd03820764f89dcc72f01714f5b40f809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Tue, 16 Mar 2021 21:02:42 +0100 Subject: [PATCH] intel/compiler: Use assume() instead of assert() for array bounds. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should make both GCC and clang happy and make them believe that the array bounds are not exceeded. Signed-off-by: Timur Kristóf Reviewed-by: Jason Ekstrand Part-of: --- src/intel/compiler/brw_inst.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/intel/compiler/brw_inst.h b/src/intel/compiler/brw_inst.h index 550dfb0db49..51888cc8b72 100644 --- a/src/intel/compiler/brw_inst.h +++ b/src/intel/compiler/brw_inst.h @@ -1273,8 +1273,8 @@ BRW_IA16_ADDR_IMM(send_dst, -1, -1, 62, 56, 52) static inline uint64_t brw_inst_bits(const brw_inst *inst, unsigned high, unsigned low) { - assert(high < 128); - assert(high >= low); + assume(high < 128); + assume(high >= low); /* We assume the field doesn't cross 64-bit boundaries. */ const unsigned word = high / 64; assert(word == low / 64); @@ -1295,8 +1295,8 @@ brw_inst_bits(const brw_inst *inst, unsigned high, unsigned low) static inline void brw_inst_set_bits(brw_inst *inst, unsigned high, unsigned low, uint64_t value) { - assert(high < 128); - assert(high >= low); + assume(high < 128); + assume(high >= low); const unsigned word = high / 64; assert(word == low / 64);