target/hexagon: fix -Wshadow=local build error on GCC 14
With --disable-hexagon-idef-parser, tcg_funcs_generated.c.inc fails to build under GCC 14 with: error: declaration of 'HALF' shadows a previous local [-Werror=shadow=local] This became a hard error with GCC ced651b7757e `c23: tag compatibility rules for enums`. After that GCC change, DECL_FILE_SCOPE_P is false for all enumerators, so shadowing now falls under -Wshadow=local. Rename the local variable to tmp_half to avoid the collision. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
Brian Cain committed
Jul 16, 2026 at 11:41 UTC
8aea63e9650df7ece512be227b01f648ab52e069
2 files changed
+4
-4
target/hexagon/gen_tcg.h
+2
-2
@@ -414,7 +414,7 @@
414
415
#define fGEN_TCG_STORE(SHORTCODE) \
416
do { \
417
- TCGv HALF G_GNUC_UNUSED = tcg_temp_new(); \
417
+ TCGv tmp_half G_GNUC_UNUSED = tcg_temp_new(); \
418
TCGv BYTE G_GNUC_UNUSED = tcg_temp_new(); \
419
SHORTCODE; \
420
} while (0)
@@ -422,7 +422,7 @@
422
#define fGEN_TCG_STORE_pcr(SHIFT, STORE) \
423
do { \
424
TCGv ireg = tcg_temp_new(); \
425
- TCGv HALF G_GNUC_UNUSED = tcg_temp_new(); \
425
+ TCGv tmp_half G_GNUC_UNUSED = tcg_temp_new(); \
426
TCGv BYTE G_GNUC_UNUSED = tcg_temp_new(); \
427
tcg_gen_mov_tl(EA, RxV); \
428
gen_read_ireg(ireg, MuV, SHIFT); \
target/hexagon/macros.h
+2
-2
@@ -576,8 +576,8 @@ static inline TCGv gen_read_ireg(TCGv result, TCGv val, int shift)
576
} while (0)
577
578
#ifdef QEMU_GENERATE
579
-#define fGETHALF(N, SRC) gen_get_half(HALF, N, SRC, true)
580
-#define fGETUHALF(N, SRC) gen_get_half(HALF, N, SRC, false)
579
+#define fGETHALF(N, SRC) gen_get_half(tmp_half, N, SRC, true)
580
+#define fGETUHALF(N, SRC) gen_get_half(tmp_half, N, SRC, false)
581
#else
582
#define fGETHALF(N, SRC) ((int16_t)((SRC >> ((N) * 16)) & 0xffff))
583
#define fGETUHALF(N, SRC) ((uint16_t)((SRC >> ((N) * 16)) & 0xffff))