--- old/src/hotspot/share/opto/macro.cpp 2020-06-22 20:25:32.942562000 +0200 +++ new/src/hotspot/share/opto/macro.cpp 2020-06-22 20:25:32.009567000 +0200 @@ -946,8 +946,8 @@ assert(ac->is_clonebasic(), "unexpected array copy kind"); Node* membar_after = ac->proj_out(TypeFunc::Control)->unique_ctrl_out(); disconnect_projections(ac, _igvn); - assert(alloc->in(0)->is_Proj() && alloc->in(0)->in(0)->Opcode() == Op_MemBarCPUOrder, "mem barrier expected before allocation"); - Node* membar_before = alloc->in(0)->in(0); + assert(alloc->in(TypeFunc::Memory)->is_Proj() && alloc->in(TypeFunc::Memory)->in(0)->Opcode() == Op_MemBarCPUOrder, "mem barrier expected before allocation"); + Node* membar_before = alloc->in(TypeFunc::Memory)->in(0); disconnect_projections(membar_before->as_MemBar(), _igvn); if (membar_after->is_MemBar()) { disconnect_projections(membar_after->as_MemBar(), _igvn); --- old/test/hotspot/jtreg/compiler/arraycopy/TestEliminateArrayCopy.java 2020-06-22 20:25:36.645629000 +0200 +++ new/test/hotspot/jtreg/compiler/arraycopy/TestEliminateArrayCopy.java 2020-06-22 20:25:35.705602000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,14 +23,17 @@ /* * @test - * @bug 8076188 + * @bug 8076188 8246153 * @summary arraycopy to non escaping destination may be eliminated * @library / * * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement * -XX:CompileCommand=dontinline,compiler.arraycopy.TestEliminateArrayCopy*::m* * compiler.arraycopy.TestEliminateArrayCopy - * + * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:+IgnoreUnrecognizedVMOptions -XX:+StressReflectiveCode + * -XX:CompileCommand=dontinline,compiler.arraycopy.TestEliminateArrayCopy*::m* + * compiler.arraycopy.TestEliminateArrayCopy */ package compiler.arraycopy;