--- a/hotspot/src/share/vm/opto/memnode.cpp Thu Nov 06 20:00:03 2008 -0800
+++ b/hotspot/src/share/vm/opto/memnode.cpp Fri Nov 07 09:29:38 2008 -0800
@@ -227,6 +227,14 @@
const Type *t_adr = phase->type( address );
if( t_adr == Type::TOP ) return NodeSentinel; // caller will return NULL
+ PhaseIterGVN *igvn = phase->is_IterGVN();
+ if( can_reshape && igvn != NULL && igvn->_worklist.member(address) ) {
+ // The address's base and type may change when the address is processed.
+ // Delay this mem node transformation until the address is processed.
+ phase->is_IterGVN()->_worklist.push(this);
+ return NodeSentinel; // caller will return NULL
+ }
+
// Avoid independent memory operations
Node* old_mem = mem;