# HG changeset patch # User goetz # Date 1422618836 -3600 # Node ID 8c2a0d2d5ccbac15be7eaf6009f768b17cab00bd # Parent ea802a4750aa190e5b297e832c50509bf51aa1c6 8071996: split_if accesses NULL region of ConstraintCast Reviewed-by: kvn diff --git a/src/share/vm/opto/ifnode.cpp b/src/share/vm/opto/ifnode.cpp --- a/src/share/vm/opto/ifnode.cpp +++ b/src/share/vm/opto/ifnode.cpp @@ -145,10 +145,18 @@ Node* v = u->fast_out(k); // User of the phi // CNC - Allow only really simple patterns. // In particular I disallow AddP of the Phi, a fairly common pattern - if( v == cmp ) continue; // The compare is OK - if( (v->is_ConstraintCast()) && - v->in(0)->in(0) == iff ) - continue; // CastPP/II of the IfNode is OK + if (v == cmp) continue; // The compare is OK + if (v->is_ConstraintCast()) { + // If the cast is derived from data flow edges, it may not have a control. + // If so, it should be save to split. But follow-up code can not deal with + // this (l. 359). So skip. + if (v->in(0) == NULL) { + return NULL; + } + if (v->in(0)->in(0) == iff) { + continue; // CastPP/II of the IfNode is OK + } + } // Disabled following code because I cannot tell if exactly one // path dominates without a real dominator check. CNC 9/9/1999 //uint vop = v->Opcode();