]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix compile issue in VEX/priv/guest_amd64_helpers.c with GCC8 master
authorMark Wielaard <mark@klomp.org>
Sat, 13 Jun 2026 22:01:49 +0000 (00:01 +0200)
committerMark Wielaard <mark@klomp.org>
Sat, 13 Jun 2026 22:06:21 +0000 (00:06 +0200)
GCC 8.5.0 doesn't like a direct variable declaration after a case
statement.

priv/guest_amd64_helpers.c: In function 'amd64g_dirtyhelper_CPUID_avx2':
priv/guest_amd64_helpers.c:3653:10: error: a label can only be part of a
statement and a declaration is not a statement

Create a block for the case statement to declare the variable.

VEX/priv/guest_amd64_helpers.c

index a516e498b08351fcd1b12fc55d369f9a504a9ea0..2fc532868d3446c417cccbfe68e6936b175952fc 100644 (file)
@@ -3649,12 +3649,13 @@ void amd64g_dirtyhelper_CPUID_avx2 ( VexGuestAMD64State* st,
       case 0x80000000:
          SET_ABCD(0x80000008, 0x00000000, 0x00000000, 0x00000000);
          break;
       case 0x80000000:
          SET_ABCD(0x80000008, 0x00000000, 0x00000000, 0x00000000);
          break;
-      case 0x80000001:
+      case 0x80000001: {
          ULong ecx_extra = 0;
          ecx_extra = hasLZCNT ? (1U << 5) : 0;
          SET_ABCD(0x00000000, 0x00000000, 0x00000001 | ecx_extra,
                   0x2c100800);
          break;
          ULong ecx_extra = 0;
          ecx_extra = hasLZCNT ? (1U << 5) : 0;
          SET_ABCD(0x00000000, 0x00000000, 0x00000001 | ecx_extra,
                   0x2c100800);
          break;
+      }
       case 0x80000002:
          SET_ABCD(0x65746e49, 0x2952286c, 0x726f4320, 0x4d542865);
          break;
       case 0x80000002:
          SET_ABCD(0x65746e49, 0x2952286c, 0x726f4320, 0x4d542865);
          break;