Mercurial > hg > truffle
diff src/share/vm/opto/memnode.cpp @ 305:ab075d07f1ba
6736417: Fastdebug C2 crashes in StoreBNode::Ideal
Summary: The result of step_through_mergemem() and remove_dead_region() is not checked in some cases.
Reviewed-by: never
author | kvn |
---|---|
date | Wed, 27 Aug 2008 09:15:46 -0700 |
parents | c3e045194476 |
children | 8261ee795323 |
line wrap: on
line diff
--- a/src/share/vm/opto/memnode.cpp Wed Aug 27 00:21:55 2008 -0700 +++ b/src/share/vm/opto/memnode.cpp Wed Aug 27 09:15:46 2008 -0700 @@ -214,6 +214,9 @@ Node *ctl = in(MemNode::Control); if (ctl && remove_dead_region(phase, can_reshape)) return this; + ctl = in(MemNode::Control); + // Don't bother trying to transform a dead node + if( ctl && ctl->is_top() ) return NodeSentinel; // Ignore if memory is dead, or self-loop Node *mem = in(MemNode::Memory); @@ -244,6 +247,7 @@ if (mem != old_mem) { set_req(MemNode::Memory, mem); + if (phase->type( mem ) == Type::TOP) return NodeSentinel; return this; } @@ -1316,6 +1320,7 @@ Node* opt_mem = MemNode::optimize_memory_chain(mem, addr_t, phase); if (opt_mem != mem) { set_req(MemNode::Memory, opt_mem); + if (phase->type( opt_mem ) == Type::TOP) return NULL; return this; } const TypeOopPtr *t_oop = addr_t->isa_oopptr(); @@ -2447,8 +2452,7 @@ // Return a node which is more "ideal" than the current node. Strip out // control copies Node *MemBarNode::Ideal(PhaseGVN *phase, bool can_reshape) { - if (remove_dead_region(phase, can_reshape)) return this; - return NULL; + return remove_dead_region(phase, can_reshape) ? this : NULL; } //------------------------------Value------------------------------------------