Skip to contentSkip to conversation

hash: fix maybe-uninitialized warnings on build

PATCH Applied Bruce Richardson 4 participants 5 messages Feb 12 – Feb 13

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hash: fix maybe-uninitialized warnings on build

Following recent changes to the test-meson-build.sh script[1] to use more build-types warnings are seen in the hash library GFNI code about values possibly being uninitialized.

In function ‘_mm512_mask_permutexvar_epi8’,

    inlined from ‘__rte_thash_gfni’ at ../lib/hash/rte_thash_x86_gfni.h:150:6:

/usr/lib/gcc/x86_64-linux-gnu/15/include/avx512vbmiintrin.h:97:20: error: ‘tuple_bytes_2’ may be used uninitialized [-Werror=maybe-uninitialized]

These all appear to be a false positive, but fix these by explicitly zero-initializing the offending values.

[1] 177acaf5cf75 ("devtools: test different build types")

Fixes 4fd8c4cb0de1 ("hash: add new Toeplitz hash implementation")
---
 lib/hash/rte_thash_x86_gfni.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/hash/rte_thash_x86_gfni.h +2 -2
index 99226b7592..69973503fd 100644
@@ -89,9 +89,9 @@ __rte_thash_gfni(const uint64_t *mtrx, const uint8_t *tuple,
 	const __m512i shift_8 = _mm512_set1_epi8(8);
 	__m512i xor_acc = _mm512_setzero_si512();
 	__m512i perm_bytes = _mm512_setzero_si512();
-	__m512i vals, matrixes, tuple_bytes_2;
+	__m512i vals, matrixes, tuple_bytes_2 = _mm512_setzero_si512();
 	__m512i tuple_bytes = _mm512_setzero_si512();
-	__mmask64 load_mask, permute_mask_2;
+	__mmask64 load_mask, permute_mask_2 = 0;
 	__mmask64 permute_mask = 0;
 	int chunk_len = 0, i = 0;
 	uint8_t mtrx_msk;
Signature · 1 line
2.51.0
Acked-by on v1 1/1
#1 lore raw
Quoted 37 lines · Bruce Richardson

Following recent changes to the test-meson-build.sh script[1] to use more build-types warnings are seen in the hash library GFNI code about values possibly being uninitialized.

In function ‘_mm512_mask_permutexvar_epi8’,

     inlined from ‘__rte_thash_gfni’ at ../lib/hash/rte_thash_x86_gfni.h:150:6:

/usr/lib/gcc/x86_64-linux-gnu/15/include/avx512vbmiintrin.h:97:20: error: ‘tuple_bytes_2’ may be used uninitialized [-Werror=maybe-uninitialized]

These all appear to be a false positive, but fix these by explicitly zero-initializing the offending values.

[1] 177acaf5cf75 ("devtools: test different build types")

Fixes 4fd8c4cb0de1 ("hash: add new Toeplitz hash implementation")
---
  lib/hash/rte_thash_x86_gfni.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
lib/hash/rte_thash_x86_gfni.h +2 -2
index 99226b7592..69973503fd 100644
@@ -89,9 +89,9 @@ __rte_thash_gfni(const uint64_t *mtrx, const uint8_t *tuple,
  	const __m512i shift_8 = _mm512_set1_epi8(8);
  	__m512i xor_acc = _mm512_setzero_si512();
  	__m512i perm_bytes = _mm512_setzero_si512();
-	__m512i vals, matrixes, tuple_bytes_2;
+	__m512i vals, matrixes, tuple_bytes_2 = _mm512_setzero_si512();
  	__m512i tuple_bytes = _mm512_setzero_si512();
-	__mmask64 load_mask, permute_mask_2;
+	__mmask64 load_mask, permute_mask_2 = 0;
  	__mmask64 permute_mask = 0;
  	int chunk_len = 0, i = 0;
  	uint8_t mtrx_msk;
Signature · 2 lines
Regards,
Vladimir
Acked-by on v1 1/1
#2 lore raw
In reply to Bruce Richardson
Quoted 12 lines · Bruce Richardson

Following recent changes to the test-meson-build.sh script[1] to use more build-types warnings are seen in the hash library GFNI code about values possibly being uninitialized.

In function ‘_mm512_mask_permutexvar_epi8’,

    inlined from ‘__rte_thash_gfni’ at ../lib/hash/rte_thash_x86_gfni.h:150:6:

/usr/lib/gcc/x86_64-linux-gnu/15/include/avx512vbmiintrin.h:97:20: error: ‘tuple_bytes_2’ may be used uninitialized [-Werror=maybe-uninitialized]

These all appear to be a false positive, but fix these by explicitly zero-initializing the offending values.

Quoted 6 lines

[1] 177acaf5cf75 ("devtools: test different build types")

Fixes 4fd8c4cb0de1 ("hash: add new Toeplitz hash implementation")

Too bad Intel CI did not catch it.

Signature · 1 line
David Marchand
#3 lore raw
Quoted 16 lines · David Marchand
Quoted 14 lines · Bruce Richardson

Following recent changes to the test-meson-build.sh script[1] to use more build-types warnings are seen in the hash library GFNI code about values possibly being uninitialized.

In function ‘_mm512_mask_permutexvar_epi8’,

    inlined from ‘__rte_thash_gfni’ at ../lib/hash/rte_thash_x86_gfni.h:150:6:

/usr/lib/gcc/x86_64-linux-gnu/15/include/avx512vbmiintrin.h:97:20: error: ‘tuple_bytes_2’ may be used uninitialized [-Werror=maybe-uninitialized]

These all appear to be a false positive, but fix these by explicitly zero-initializing the offending values.

[1] 177acaf5cf75 ("devtools: test different build types")

Quoted 9 lines
Quoted 4 lines
Fixes 4fd8c4cb0de1 ("hash: add new Toeplitz hash implementation")

Too bad Intel CI did not catch it.

I don't think any of the CIs use the test-meson-build scripts, do they? It's more a convenience for maintainers.

#4 lore raw
In reply to David Marchand

12/02/2026 17:54, David Marchand:

Quoted 16 lines
Quoted 14 lines · Bruce Richardson

Following recent changes to the test-meson-build.sh script[1] to use more build-types warnings are seen in the hash library GFNI code about values possibly being uninitialized.

In function ‘_mm512_mask_permutexvar_epi8’,

    inlined from ‘__rte_thash_gfni’ at ../lib/hash/rte_thash_x86_gfni.h:150:6:

/usr/lib/gcc/x86_64-linux-gnu/15/include/avx512vbmiintrin.h:97:20: error: ‘tuple_bytes_2’ may be used uninitialized [-Werror=maybe-uninitialized]

These all appear to be a false positive, but fix these by explicitly zero-initializing the offending values.

[1] 177acaf5cf75 ("devtools: test different build types")

Quoted 8 lines
Quoted 4 lines
Fixes 4fd8c4cb0de1 ("hash: add new Toeplitz hash implementation")

Too bad Intel CI did not catch it.

Applied, thanks.