JDK-6548082 : bug in C2 conditional-move - suggested fix is provided
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 5.0u11
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2007-04-19
  • Updated: 2010-04-02
  • Resolved: 2007-04-23
Related Reports
Relates :  
Description
ugfix for conditional-move creation, if the CMOV is getting 
created inside an inner-most loop or has inputs which are hung
off the converted if-node.


==== //java/main-dev/java/hotspot5/src/share/vm/opto/loopopts.cpp#14 (text) ====
@@ -534,8 +534,12 @@
         set_ctrl(inp, cmov_ctrl);
       }
     }
-    Node *cmov = CMoveNode::make( cmov_ctrl->in(0), iff->in(1), phi->in(1+flip), phi->in(2-flip), _igvn.type(phi) );
-    register_new_node( cmov, cmov_ctrl->in(0) );
+    Node *cmov = CMoveNode::make( region, iff->in(1), phi->in(1+flip), phi->in(2-flip), _igvn.type(phi) );
+    register_new_node( cmov, region );
+    // Since we are inside loop optimizations and just created a new node, we need to check if it belongs to innermost loop
+    // and in this case update additional structure
+    IdealLoopTree *loop = get_loop(region);
+    if (!loop->_child)  loop->_body.push(cmov);
     _igvn.hash_delete(phi);
     _igvn.subsume_node( phi, cmov );
 #ifndef PRODUCT

Comments
EVALUATION Closing as will not fix. We have already approached the problem in a different manner than suggested by the licensee. See 6260293 for the fix.
23-04-2007