From b7f1181f8641df765c533183b81d132b1ded365a Mon Sep 17 00:00:00 2001 From: Aaron Jencks <32805004+aaron-jencks@users.noreply.github.com> Date: Fri, 30 Jun 2023 10:04:14 -0500 Subject: [PATCH] Add volatile keyword to asm block in rdtsc --- 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