From 4f1ac3ebd8b6d5fd21e2ae3c9599c89a3a8e2261 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Fri, 26 Jan 2018 11:48:02 -0800 Subject: [PATCH] intel/ir: Fix invalid type aliasing with undefined behavior in test_eu_compact. --- src/intel/compiler/test_eu_compact.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/intel/compiler/test_eu_compact.cpp b/src/intel/compiler/test_eu_compact.cpp index 1532e3b9840..f6924abd368 100644 --- a/src/intel/compiler/test_eu_compact.cpp +++ b/src/intel/compiler/test_eu_compact.cpp @@ -149,13 +149,13 @@ test_fuzz_compact_instruction(struct brw_codegen *p, brw_inst src) for (int bit1 = 0; bit1 < 128; bit1++) { brw_inst instr = src; - uint32_t *bits = (uint32_t *)&instr; + uint64_t *bits = instr.data; if (skip_bit(p->devinfo, &src, bit1)) continue; - bits[bit0 / 32] ^= (1 << (bit0 & 31)); - bits[bit1 / 32] ^= (1 << (bit1 & 31)); + bits[bit0 / 64] ^= (1ull << (bit0 & 63)); + bits[bit1 / 64] ^= (1ull << (bit1 & 63)); clear_pad_bits(p->devinfo, &instr); -- 2.16.1