hotspot/src/share/vm/opto/memnode.cpp
changeset 9175 80221fe09772
parent 8728 3f1bcd33068e
child 9179 6db9c9dffe1f
--- a/hotspot/src/share/vm/opto/memnode.cpp	Fri Feb 18 10:07:34 2011 -0800
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Tue Apr 05 19:14:03 2011 -0700
@@ -2159,9 +2159,12 @@
   Node* mem     = in(MemNode::Memory);
   Node* address = in(MemNode::Address);
 
-  // Back-to-back stores to same address?  Fold em up.
-  // Generally unsafe if I have intervening uses...
-  if (mem->is_Store() && phase->eqv_uncast(mem->in(MemNode::Address), address)) {
+  // Back-to-back stores to same address?  Fold em up.  Generally
+  // unsafe if I have intervening uses...  Also disallowed for StoreCM
+  // since they must follow each StoreP operation.  Redundant StoreCMs
+  // are eliminated just before matching in final_graph_reshape.
+  if (mem->is_Store() && phase->eqv_uncast(mem->in(MemNode::Address), address) &&
+      mem->Opcode() != Op_StoreCM) {
     // Looking at a dead closed cycle of memory?
     assert(mem != mem->in(MemNode::Memory), "dead loop in StoreNode::Ideal");