On Sat, May 18, 2019 at 06:40:16PM -0400, tedheadster wrote: > On Sat, May 18, 2019 at 5:30 PM Segher Boessenkool > <segher@xxxxxxxxxxxxxxxxxxx> wrote: > > That won't help, the compiler will remove those dead stores. > > > > Add a > > > > asm("" ::: "memory"); > > > > between these two lines? > > This didn't seem to do anything: [ snip ] Apparently nothing is actually in memory, I thought you would force that. Oh well. Something like *__ebx = *__ecx = *__edx = 0; asm volatile("" : "+r"(*__eax), "+r"(*__ebx), "+r"(*__ecx), "+r"(*__edx)); __cpuid (__leaf, *__eax, *__ebx, *__ecx, *__edx); should do the trick. Segher