RFR(m): 8220351: Cross-modifying code
Florian Weimer
fweimer at redhat.com
Wed Jun 19 16:03:31 UTC 2019
* Martin Doerr:
> Not sure if the inline assembler code on x86 necessarily needs a "clobber memory" effect.
> I don't know what a C++ compiler is allowed to do if it doesn't know that the code has some kind of memory effect.
>
> For ebx...edx, you could also use clobber if you want to make it shorter.
> E.g. with "+a" to use eax as input and output:
> int idx = 0;
> __asm__ volatile ("cpuid " : "+a" (idx) : : "ebx", "ecx", "edx", "memory");
ebx clobbers are not supported on older GCC versions.
src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.hpp currently says
this:
// Compiler version last used for testing: gcc 4.8.2
But this is blatantly not true because GCC 4.8 cannot spill ebx in PIC
mode.
Thanks,
Florian
More information about the hotspot-dev
mailing list