From 7e1cce8cb508a8af770443360721fbb3d3b40237 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 9 Jun 2022 05:48:48 +0000 Subject: [PATCH] 8288051: Loom: Extend the compilation warning workaround in stack chunk copy Reviewed-by: coleenp --- src/hotspot/share/oops/stackChunkOop.inline.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/oops/stackChunkOop.inline.hpp b/src/hotspot/share/oops/stackChunkOop.inline.hpp index 633452ee4a0..4b15958df2f 100644 --- a/src/hotspot/share/oops/stackChunkOop.inline.hpp +++ b/src/hotspot/share/oops/stackChunkOop.inline.hpp @@ -316,6 +316,12 @@ inline void stackChunkOopDesc::copy_from_stack_to_chunk(intptr_t* from, intptr_t assert(to >= start_address(), "Chunk underflow"); assert(to + size <= end_address(), "Chunk overflow"); +#if !defined(AMD64) || !defined(AARCH64) || defined(ZERO) + // Suppress compilation warning-as-error on unimplemented architectures + // that stub out arch-specific methods. Some compilers are smart enough + // to figure out the argument is always null and then warn about it. + if (to != nullptr) +#endif memcpy(to, from, size << LogBytesPerWord); } @@ -330,7 +336,9 @@ inline void stackChunkOopDesc::copy_from_chunk_to_stack(intptr_t* from, intptr_t assert(from + size <= end_address(), ""); #if !defined(AMD64) || !defined(AARCH64) || defined(ZERO) - // Suppress compilation error from dummy function (somewhere). + // Suppress compilation warning-as-error on unimplemented architectures + // that stub out arch-specific methods. Some compilers are smart enough + // to figure out the argument is always null and then warn about it. if (to != nullptr) #endif memcpy(to, from, size << LogBytesPerWord);