JDK-6529019 : C2 CTW on sparc with -XX:+VerifyOops assert(is_Mach(),"invalid node class")
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2007-02-27
  • Updated: 2010-04-03
  • Resolved: 2007-03-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u4Fixed 7Fixed hs10Fixed
Description
I got next C2 CTW failure on sparc.
gamma -XX:+VerifyOops -Xss4m -Xverify:all -XX:-ShowMessageBoxOnError -XX:+CompileTheWorld -XX:CompileTheWorldStartAt=2000 -Xbootclasspath/p:/export/home/work/CTW/jarfiles/testbase.jar
...
CompileTheWorld (2041) : inline001_1
CompileTheWorld (2042) : inline002
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  Internal Error (/net/prt-solsparc-q1-19/tmp/PrtBuildDir/workspace/src/share/vm/opto/node.hpp, 676 [ Patched ]), pid=11392, tid=9
#
# Java VM: Java HotSpot(TM) Server VM (20070222204237.kvn.6523674-fastdebug mixed mode)
#
# Error: assert(is_Mach(),"invalid node class")

In Line 219 since 'vv' is Phi node:

  217       if( vv == val ||            // Got a direct hit?
  218           (t && vv && vv->bottom_type() == t &&
  219            vv->as_Mach()->rule() == val->as_Mach()->rule()) ) { // Or same constant?
  220         assert( !n->is_Phi(), "cannot change registers at a Phi so easily" );
  221         if( OptoReg::is_stack(nk_reg) || // CISC-loading from stack OR
  222             OptoReg::is_reg(reg) || // turning into a register use OR
  223             regnd[reg]->outcnt()==1 ) { // last use of a spill-load turns into a CISC use
  224           blk_adjust += use_prior_register(n,k,regnd[reg],current_block,value,regnd);
  225           if( n->in(k) == regnd[reg] ) // Success!  Quit trying
  226             return blk_adjust;

[t@9 l@9]: print vv->dump(2)
 6562   Region  ===  6562  34000  33999  [[ 6562  6551  6565  6566  41301 ]]  !jvms: inline002::runFinals @ bci:2130
 41296  MachSpillCopy   === _  45605  [[ 41301 ]]
 44816  MachSpillCopy   === _  45604  [[ 41301 ]]
 41301  Phi     ===  6562  41296  44816  [[ 45330  45331  45332  45333  45334  45335  45336  45337  45338  45339  45340  45341  45342  45343  45344  45345  45346  45347  45348  45349  45350  45351  45352  45353  45354  45355  45356  45357  45358  45359  45360  45361  45362  45363  45364  45365 45600  41467  45366  45367  45368  45369  45370  45371  45372  45373  45374  45375  41468  45597  45596  45573  45574  45575  45576  45579  45580  45581  45582  45583  45586  45587  45588  45589  45590  45593  45594  45595 ]]  #dblcon:0.000000

The graph looks like this:

       loadConD #0.0
           |
           V
     MachSpillCopy
    / | | | | | | \  ( a lot uses)
      |         |
      V         V
MachSpillCopy  MachSpillCopy
       \       /
        \     /
          Phi
        / | | \  ( a lot uses, all are MachSpillCopy)

Comments
EVALUATION See description.
01-03-2007

SUGGESTED FIX Add vv->is_Mach() check to the condition. Webrev: http://prt-web.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/2007/20070228111347.kvn.6529019/workspace/webrevs/webrev-2007.02.28/index.html
01-03-2007