'How to make msvc 2019 not to use XMM registers?

I have a problem related to a bug in jdk 1.8. JDK bug. It says that calling JNI_CreateVM can corrupt the values of the XMM7, XMM8 and XMM15 registers. the problem is that due to optimizations the vs2019 compiler decides to use the XMM8 register, but after that the code initializes the JVM and the value inside the XMM8 register becomes corrupted. so I need to somehow tell vs2019 not to use XMM registers for optimization purposes. How to do it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source