JDK-6831314 : C2 may incorrectly change control of type nodes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs16,9,10
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2009-04-17
  • Updated: 2019-09-13
  • Resolved: 2017-11-06
Related Reports
Relates :  
Description
In very rare cases optimizations in IfNode::Ideal() and Loopopts may incorrectly  change control of a type node
because TypeNode::depends_only_on_test() returns true.

The next code

if (a != b)
  if (a != null && b != null)
    if (a != b)
      x = ((CastClass)a).f;

is transformed into

if (a != b)
  x = ((CastClass)a).f;

Comments
Will not fix. As evaluation said it is only observed with modified C2 code.
06-11-2017

ILW = Incorrect optimization in C2, rare, disable loopopts/compilation = HLM = P3
20-02-2017

EVALUATION This is not observed without modifying C2. Will address in a future release.
31-03-2011

EVALUATION Incorrect VM behaviour, added sqe-7-mustfix
15-12-2010

SUGGESTED FIX TypeNode::depends_only_on_test() { return (in(0) == NULL) ? true : false; }
17-04-2009