1.1 --- a/src/share/vm/opto/memnode.cpp Wed Aug 27 00:21:55 2008 -0700 1.2 +++ b/src/share/vm/opto/memnode.cpp Wed Aug 27 09:15:46 2008 -0700 1.3 @@ -214,6 +214,9 @@ 1.4 Node *ctl = in(MemNode::Control); 1.5 if (ctl && remove_dead_region(phase, can_reshape)) 1.6 return this; 1.7 + ctl = in(MemNode::Control); 1.8 + // Don't bother trying to transform a dead node 1.9 + if( ctl && ctl->is_top() ) return NodeSentinel; 1.10 1.11 // Ignore if memory is dead, or self-loop 1.12 Node *mem = in(MemNode::Memory); 1.13 @@ -244,6 +247,7 @@ 1.14 1.15 if (mem != old_mem) { 1.16 set_req(MemNode::Memory, mem); 1.17 + if (phase->type( mem ) == Type::TOP) return NodeSentinel; 1.18 return this; 1.19 } 1.20 1.21 @@ -1316,6 +1320,7 @@ 1.22 Node* opt_mem = MemNode::optimize_memory_chain(mem, addr_t, phase); 1.23 if (opt_mem != mem) { 1.24 set_req(MemNode::Memory, opt_mem); 1.25 + if (phase->type( opt_mem ) == Type::TOP) return NULL; 1.26 return this; 1.27 } 1.28 const TypeOopPtr *t_oop = addr_t->isa_oopptr(); 1.29 @@ -2447,8 +2452,7 @@ 1.30 // Return a node which is more "ideal" than the current node. Strip out 1.31 // control copies 1.32 Node *MemBarNode::Ideal(PhaseGVN *phase, bool can_reshape) { 1.33 - if (remove_dead_region(phase, can_reshape)) return this; 1.34 - return NULL; 1.35 + return remove_dead_region(phase, can_reshape) ? this : NULL; 1.36 } 1.37 1.38 //------------------------------Value------------------------------------------