From fe000cd966d93cb7fe8d75fed5dcf7e1dbbac61e Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 6 Jan 2014 11:02:21 +0100 Subject: [PATCH] 8031188: Fix for 8029015: PPC64 (part 216): opto: trap based null and range checks Swap the Projs in the block list so that the new block is added behind the proper node. Reviewed-by: kvn --- hotspot/src/share/vm/opto/block.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hotspot/src/share/vm/opto/block.cpp b/hotspot/src/share/vm/opto/block.cpp index 9d2f9522bed..2553545a726 100644 --- a/hotspot/src/share/vm/opto/block.cpp +++ b/hotspot/src/share/vm/opto/block.cpp @@ -748,6 +748,11 @@ Block *PhaseCFG::fixup_trap_based_check(Node *branch, Block *block, int block_po block->_succs.map(0, get_block_for_node(proj_never ->raw_out(0))); // The target of the trap. block->_succs.map(1, get_block_for_node(proj_always->raw_out(0))); // The fall through target. + if (block->get_node(block->number_of_nodes() - block->_num_succs + 1) != proj_always) { + block->map_node(proj_never, block->number_of_nodes() - block->_num_succs + 0); + block->map_node(proj_always, block->number_of_nodes() - block->_num_succs + 1); + } + // Place the fall through block after this block. Block *bs1 = block->non_connector_successor(1); if (bs1 != bnext && move_to_next(bs1, block_pos)) {