--- old/src/hotspot/share/jvmci/jvmciRuntime.cpp 2019-11-21 11:55:26.181223130 +0100 +++ new/src/hotspot/share/jvmci/jvmciRuntime.cpp 2019-11-21 11:55:25.929218870 +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); }