--- old/hotspot/src/share/vm/opto/ifnode.cpp 2009-08-01 04:13:49.883853309 +0100 +++ new/hotspot/src/share/vm/opto/ifnode.cpp 2009-08-01 04:13:49.798468637 +0100 @@ -2,7 +2,7 @@ #pragma ident "@(#)ifnode.cpp 1.63 07/10/23 13:12:51 JVM" #endif /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -608,7 +608,7 @@ // and has one projection leading to this if and the other projection // leading to a region that merges one of this ifs control // projections. -// +// // If // / | // / | @@ -618,7 +618,7 @@ // / \ | // / \ | // / Region -// +// Node* IfNode::fold_compares(PhaseGVN* phase) { if (!EliminateAutoBox || Opcode() != Op_If) return NULL; @@ -728,6 +728,11 @@ int true_path = phi->is_diamond_phi(); if( true_path == 0 ) return NULL; + // Make sure that iff and the control of the phi are different. This + // should really only happen for dead control flow since it requires + // an illegal cycle. + if (phi->in(0)->in(1)->in(0) == iff) return NULL; + // phi->region->if_proj->ifnode->bool->cmp BoolNode *bol2 = phi->in(0)->in(1)->in(0)->in(1)->as_Bool(); @@ -754,6 +759,7 @@ } Node* new_bol = (flip ? phase->transform( bol2->negate(phase) ) : bol2); + assert(new_bol != iff->in(1), "must make progress"); iff->set_req(1, new_bol); // Intervening diamond probably goes dead phase->C->set_major_progress();