From 1737e96a0fa12fcd619b7818e959bef53b56a5b7 Mon Sep 17 00:00:00 2001 From: Aaron Jencks <32805004+aaron-jencks@users.noreply.github.com> Date: Thu, 13 Jul 2023 04:02:14 -0500 Subject: [PATCH] [core] Add volatile keyword to asm block in rdtsc (#2759). --- srtcore/sync_posix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srtcore/sync_posix.cpp b/srtcore/sync_posix.cpp index c44fe86c2..8cb475ea7 100644 --- a/srtcore/sync_posix.cpp +++ b/srtcore/sync_posix.cpp @@ -52,7 +52,7 @@ static void rdtsc(uint64_t& x) asm("mov %0=ar.itc" : "=r"(x)::"memory"); #elif SRT_SYNC_CLOCK == SRT_SYNC_CLOCK_AMD64_RDTSC uint32_t lval, hval; - asm("rdtsc" : "=a"(lval), "=d"(hval)); + asm volatile("rdtsc" : "=a"(lval), "=d"(hval)); x = hval; x = (x << 32) | lval; #elif SRT_SYNC_CLOCK == SRT_SYNC_CLOCK_WINQPC