Mesa (master): intel/compiler: Fix array bounds warning on GCC 10.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 22 07:58:01 UTC 2020


Module: Mesa
Branch: master
Commit: e45ea781f859fcfa44ca2aacda05bcfe59aef0e0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e45ea781f859fcfa44ca2aacda05bcfe59aef0e0

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Tue Jan 21 17:58:31 2020 +0100

intel/compiler: Fix array bounds warning on GCC 10.

Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/intel/compiler/brw_inst.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/intel/compiler/brw_inst.h b/src/intel/compiler/brw_inst.h
index 9daf8f21849..550dfb0db49 100644
--- a/src/intel/compiler/brw_inst.h
+++ b/src/intel/compiler/brw_inst.h
@@ -1273,6 +1273,7 @@ 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);
    /* We assume the field doesn't cross 64-bit boundaries. */
    const unsigned word = high / 64;
@@ -1294,6 +1295,7 @@ 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);
    const unsigned word = high / 64;
    assert(word == low / 64);



More information about the mesa-commit mailing list