diff -r 4cbfa5077d68 -r 623722a6aeb9 src/hotspot/share/jvmci/jvmciRuntime.cpp --- a/src/hotspot/share/jvmci/jvmciRuntime.cpp Mon Nov 25 12:32:40 2019 +0100 +++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp Mon Nov 25 12:33:15 2019 +0100 @@ -917,7 +917,7 @@ JavaThread* THREAD = JavaThread::current(); static volatile int report_error = 0; - if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) { + if (!report_error && Atomic::cmpxchg(&report_error, 0, 1) == 0) { // Only report an error once tty->print_raw_cr(message); if (JVMCIENV != NULL) { @@ -1295,7 +1295,7 @@ static void fatal_exception_in_compile(JVMCIEnv* JVMCIENV, JavaThread* thread, const char* msg) { // Only report a fatal JVMCI compilation exception once static volatile int report_init_failure = 0; - if (!report_init_failure && Atomic::cmpxchg(1, &report_init_failure, 0) == 0) { + if (!report_init_failure && Atomic::cmpxchg(&report_init_failure, 0, 1) == 0) { tty->print_cr("%s:", msg); JVMCIENV->describe_pending_exception(true); }