changeset 309:eaf496ad4a14

6732698: crash with dead code from compressed oops in gcm Reviewed-by: rasbold
author never
date Thu, 28 Aug 2008 23:03:55 -0700
parents 756b58154237
children cf6f0e32e518
files src/share/vm/opto/matcher.cpp
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/matcher.cpp	Thu Aug 28 10:22:12 2008 -0700
+++ b/src/share/vm/opto/matcher.cpp	Thu Aug 28 23:03:55 2008 -0700
@@ -1450,6 +1450,8 @@
   Node *leaf = s->_leaf;
   // Check for instruction or instruction chain rule
   if( rule >= _END_INST_CHAIN_RULE || rule < _BEGIN_INST_CHAIN_RULE ) {
+    assert(C->node_arena()->contains(s->_leaf) || !has_new_node(s->_leaf),
+           "duplicating node that's already been matched");
     // Instruction
     mach->add_req( leaf->in(0) ); // Set initial control
     // Reduce interior of complex instruction
@@ -1872,6 +1874,12 @@
 
         // Clone addressing expressions as they are "free" in most instructions
         if( mem_op && i == MemNode::Address && mop == Op_AddP ) {
+          if (m->in(AddPNode::Base)->Opcode() == Op_DecodeN) {
+            // Bases used in addresses must be shared but since
+            // they are shared through a DecodeN they may appear
+            // to have a single use so force sharing here.
+            set_shared(m->in(AddPNode::Base)->in(1));
+          }
           Node *off = m->in(AddPNode::Offset);
           if( off->is_Con() ) {
             set_visited(m);  // Flag as visited now