JDK-6483694 : nightly failure after 6431242 putback
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris
  • CPU: x86
  • Submitted: 2006-10-18
  • Updated: 2010-04-03
  • Resolved: 2006-11-14
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
Related Reports
Relates :  
Relates :  
Description
nightly failure after 6431242 putback:
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  Internal Error (/net/prt-solx86-q1-2/PrtBuildDir/workspace/src/share/vm/opto/
matcher.cpp, 1340), pid=16889, tid=9
#
# Java VM: Java HotSpot(TM) Server VM (20061016093837.yq123930.hs-c2-debug compi
led mode)
#
# Error: assert(false,"bad AD file")
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x081c7800):  JavaThread "CompilerThread0" daemon [_thread_in_na
tive, id=9]

Stack: [0x77e26000,0x77e66000),  sp=0x77e63f58,  free space=247k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xbd0d70] void VMError::report_and_die() + 0x520
V  [libjvm.so+0x37bf77] void report_assertion_failure(const char*,int,const char*) + 0x5f
V  [libjvm.so+0x8d5f72] Node*Matcher::Label_Root(const Node*,State*,Node*,constNode*) + 0x652
V  [libjvm.so+0x8d5cea] Node*Matcher::Label_Root(const Node*,State*,Node*,constNode*) + 0x3ca
V  [libjvm.so+0x8d5cea] Node*Matcher::Label_Root(const Node*,State*,Node*,constNode*) + 0x3ca
V  [libjvm.so+0x8d5015] MachNode*Matcher::match_tree(const Node*) + 0x1ad
V  [libjvm.so+0x8d34a3] Node*Matcher::xform(Node*,int) + 0x5ef
V  [libjvm.so+0x8d08b6] void Matcher::match() + 0x716
V  [libjvm.so+0x3108d9] void Compile::Code_Gen() + 0x10d
V  [libjvm.so+0x30bb05] Compile::Compile(ciEnv*,C2Compiler*,ciMethod*,int,bool) + 0xc59
V  [libjvm.so+0x1f8a08] void C2Compiler::compile_method(ciEnv*,ciMethod*,int) + 0x68
V  [libjvm.so+0x31e50c] void CompileBroker::invoke_compiler_on_method(CompileTask*) + 0xbd0
V  [libjvm.so+0x31d010] void CompileBroker::compiler_thread_loop() + 0x798
V  [libjvm.so+0xaf7bb2] void compiler_thread_entry(JavaThread*,Thread*) + 0x2a
V  [libjvm.so+0xaf093e] void JavaThread::thread_main_inner() + 0x16e
V  [libjvm.so+0xaf067d] void JavaThread::run() + 0x359
V  [libjvm.so+0x96073b] java_start + 0xe3
C  [libc.so.1+0x9f92e] __divdi3 + 0xe
C  [libc.so.1+0x9fc10] _t_cancel + 0x10e


Current CompileTask:
C2:1846   b  sun.security.provider.ByteArrayAccess.i2bBig4

Comments
SUGGESTED FIX As per tom, a better solution is: ------- matcher.cpp ------- *** /tmp/sccs.Kma4mN Wed Oct 18 23:03:52 2006 --- matcher.cpp Wed Oct 18 23:02:05 2006 *************** *** 1137,1149 **** // as part of the current match tree. static bool match_into_reg( const Node *n, Node *m, Node *control, int i, bool shared ) { - // make ReverseBytesI/ReverseBytesL match normal when there exists control - int n_opcode = n->Opcode(); - - if ((n_opcode == Op_ReverseBytesI || n_opcode == Op_ReverseBytesL) && control) - return false; - - const Type *t = m->bottom_type(); // 'm' is a constant? Probably match it as part of this tree. Most --- 1137,1142 ---- *************** *** 1626,1631 **** --- 1619,1630 ---- n->unique_out()->is_Store() ) // Following store set_shared(n); // Force it to be a root break; + case Op_ReverseBytesI: + case Op_ReverseBytesL: + if( n->in(1)->is_Load() && // Prior load + n->outcnt() == 1 ) // Not already shared + set_shared(n); // Force it to be a root + break; case Op_BoxLock: // Cant match until we get stack-regs in ADLC case Op_IfFalse: case Op_IfTrue:
19-10-2006

EVALUATION A simplified test case attached for reproduction.
18-10-2006

SUGGESTED FIX ------- matcher.cpp ------- *** /tmp/sccs.r9aWo3 Wed Oct 18 16:41:38 2006 --- matcher.cpp Wed Oct 18 16:43:57 2006 *************** *** 1137,1148 **** // as part of the current match tree. static bool match_into_reg( const Node *n, Node *m, Node *control, int i, bool shared ) { ! // make ReverseBytesI/ReverseBytesL match normal when there exists control int n_opcode = n->Opcode(); ! if ((n_opcode == Op_ReverseBytesI || n_opcode == Op_ReverseBytesL) && control) return false; - const Type *t = m->bottom_type(); --- 1137,1150 ---- // as part of the current match tree. static bool match_into_reg( const Node *n, Node *m, Node *control, int i, bool shared ) { ! // make ReverseBytesI/ReverseBytesL match normal match tree when there exists control ! // if it is not shared. This prevents load followed reverse from using spilling stack. ! // The code here is a workaround, upon 6482634 fixed, it could be removed. ! int n_opcode = n->Opcode(); ! if ((n_opcode == Op_ReverseBytesI || n_opcode == Op_ReverseBytesL) && control && !shared) return false; const Type *t = m->bottom_type();
18-10-2006

EVALUATION It is caused of the change in match_into_reg: + // make ReverseBytesI/ReverseBytesL match normal when there exists control + int n_opcode = n->Opcode(); + + if ((n_opcode == Op_ReverseBytesI || n_opcode == Op_ReverseBytesL) && control) + return false; + See Test.java of 6431242. The code here is to avoid generating code spilling onto stack, since load followed reverse can use loadI_reversed rule. If without this code, the generated code will first spilling the value to stack then read reversely back and cost more instruction cycles. I missed a check of if the code is shared, it is not shared at above condition, return false go through the normal match tree.
18-10-2006