--- old/src/share/vm/opto/block.cpp 2016-04-15 13:45:46.252051239 +0200 +++ new/src/share/vm/opto/block.cpp 2016-04-15 13:45:45.403054900 +0200 @@ -72,7 +72,7 @@ } #endif -uint Block::code_alignment() { +uint Block::code_alignment() const { // Check for Root block if (_pre_order == 0) return CodeEntryAlignment; // Check for Start block @@ -1726,8 +1726,14 @@ first_block()->set_loop_alignment(targ_block); } else { - // Backbranch into the middle of a trace - targ_block->set_loop_alignment(targ_block); + // That loop may already have a loop top (we're reaching it again + // through the backedge of an outer loop) + Block* b = prev(targ_block); + bool has_top = targ_block->head()->is_Loop() && b->has_loop_alignment() && !b->head()->is_Loop(); + if (!has_top) { + // Backbranch into the middle of a trace + targ_block->set_loop_alignment(targ_block); + } } return loop_rotated; --- old/src/share/vm/opto/block.hpp 2016-04-15 13:45:47.335046570 +0200 +++ new/src/share/vm/opto/block.hpp 2016-04-15 13:45:46.511050123 +0200 @@ -197,7 +197,7 @@ // Report the alignment required by this block. Must be a power of 2. // The previous block will insert nops to get this alignment. - uint code_alignment(); + uint code_alignment() const; uint compute_loop_alignment(); // BLOCK_FREQUENCY is a sentinel to mark uses of constant block frequencies. --- old/src/share/vm/opto/c2_globals.hpp 2016-04-15 13:45:48.286042471 +0200 +++ new/src/share/vm/opto/c2_globals.hpp 2016-04-15 13:45:47.586045489 +0200 @@ -587,7 +587,7 @@ range(0, 100) \ \ product(bool, BlockLayoutRotateLoops, true, \ - "Allow back branches to be fall throughs in the block layour") \ + "Allow back branches to be fall throughs in the block layout") \ \ diagnostic(bool, InlineReflectionGetCallerClass, true, \ "inline sun.reflect.Reflection.getCallerClass(), known to be " \