Skip to content

Commit c6e2a5b

Browse files
committed
8282555: Missing memory edge when spilling MoveF2I, MoveD2L etc
Reviewed-by: stuefe Backport-of: 4a5e7a1ada611cfdefdc3b9a6fada05494e07390
1 parent 87bcc4e commit c6e2a5b

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/hotspot/share/opto/chaitin.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,14 @@ void PhaseChaitin::fixup_spills() {
16881688
if( cisc->oper_input_base() > 1 && mach->oper_input_base() <= 1 ) {
16891689
assert( cisc->oper_input_base() == 2, "Only adding one edge");
16901690
cisc->ins_req(1,src); // Requires a memory edge
1691+
} else {
1692+
// There is no space reserved for a memory edge before the inputs for
1693+
// instructions which have "stackSlotX" parameter instead of "memory".
1694+
// For example, "MoveF2I_stack_reg". We always need a memory edge from
1695+
// src to cisc, else we might schedule cisc before src, loading from a
1696+
// spill location before storing the spill.
1697+
assert(cisc->memory_operand() == NULL, "no memory operand, only stack");
1698+
cisc->add_prec(src);
16911699
}
16921700
block->map_node(cisc, j); // Insert into basic block
16931701
n->subsume_by(cisc, C); // Correct graph

test/hotspot/jtreg/compiler/intrinsics/unsafe/HeapByteBufferTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@
3535
* HeapByteBufferTest
3636
*/
3737

38+
/**
39+
* @test
40+
* @bug 8282555
41+
* @summary intermittent, check that spilling MoveF2I etc produce memory edge
42+
* @modules java.base/jdk.internal.misc
43+
* @library /test/lib
44+
*
45+
* @run main/othervm -Djdk.test.lib.random.seed=42
46+
* -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:+OptoScheduling
47+
* HeapByteBufferTest
48+
* @run main/othervm
49+
* -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:+OptoScheduling
50+
* HeapByteBufferTest
51+
*/
52+
3853
public class HeapByteBufferTest extends ByteBufferTest {
3954

4055
public HeapByteBufferTest(long iterations, boolean direct) {

0 commit comments

Comments
 (0)