6910461: Register allocator may insert spill code at wrong insertion index
Summary: When resolving exception edges after register allocation, the C1 register allocator may insert spill code at the wrong insertion position.
Reviewed-by: kvn, never
--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp Tue Feb 28 10:04:01 2012 -0800
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp Tue Feb 28 09:13:58 2012 +0100
@@ -1884,7 +1884,7 @@
if (move_resolver.has_mappings()) {
// insert moves after first instruction
- move_resolver.set_insert_position(block->lir(), 1);
+ move_resolver.set_insert_position(block->lir(), 0);
move_resolver.resolve_and_append_moves();
}
}