hotspot/src/share/vm/opto/memnode.cpp
changeset 1500 bea9a90f3e8f
parent 1398 342890a5d031
child 2017 5c84f9424127
child 2008 898493b2e3f1
--- 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;