# HG changeset patch # User goetz # Date 1389002541 -3600 # Node ID 4345c6a92f35cf7a6280732da4fb78ef00b84e8b # Parent ad3b94907eed88af632fe0eae8313a94a6fbda13 8031188: Fix for 8029015: PPC64 (part 216): opto: trap based null and range checks Summary: Swap the Projs in the block list so that the new block is added behind the proper node. Reviewed-by: kvn diff -r ad3b94907eed -r 4345c6a92f35 src/share/vm/opto/block.cpp --- a/src/share/vm/opto/block.cpp Fri Dec 20 13:51:14 2013 +0100 +++ b/src/share/vm/opto/block.cpp Mon Jan 06 11:02:21 2014 +0100 @@ -748,6 +748,11 @@ 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)) {