United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6862863 C2 compiler fails in elide_copy()
JDK-6862863 : C2 compiler fails in elide_copy()

Details
Type:
Bug
Submit Date:
2009-07-21
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2009-09-16
Component:
hotspot
OS:
solaris_10
Sub-Component:
compiler
CPU:
sparc
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u14
Fixed Versions:
hs17 (b01)

Related Reports
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
The stack trace from dbx.

-----------------  lwp# 31 / thread# 31  --------------------
 ff2c642c _lwp_kill (6, 0, ff2f2e18, feaf638c, ffffffff, 6) + 8
 ff241198 abort    (2d790, 1, fec086a0, ad260, ff2f12d8, 0) + 110
 feaf638c void os::abort(bool) (1, fedca58c, 1, fedb2000, 1858c, 18400) + 5c
 fec086a0 void VMError::report_and_die() (feded498, 0, 1, fed6071b, fed66dc6, fedf2cd8) + d2c
 fe82f6e4 void report_fatal(const char*,int,const char*) (fed090db, b3, fed09116, 148e, 38b9d08, 1b68) + 24
 feb1e290 int PhaseChaitin::elide_copy(Node*,int,Block*,Node_List&,Node_List&,bool) (38b9d40, 306b168, 0, 1ae3be4, 320aa28, 320aa08) + a8
 fe5a3e44 void PhaseChaitin::post_allocate_copy_removal() (593fe9a0, a, 20, 0, 4, 2) + 24c
 fe59e5f8 void PhaseChaitin::Register_Allocate() (593fe9a0, bf2, 6, fedb2000, 3b9d554, 3b9d160) + d44
 fe5a0d28 void Compile::Code_Gen() (0, 593ff3a8, 0, fedb2000, 593fe9a0, 593ff3a8) + 398
 fe7f5d3c Compile::Compile #Nvariant 1(ciEnv*,C2Compiler*,ciMethod*,int,bool,bool) (593ff3a8, 298db8, 2a6f28, 593ff3a8, fedfa9d4, fec945cf) + cd4
 fe5ba5e4 void C2Compiler::compile_method(ciEnv*,ciMethod*,int) (2a6f28, 593ff9ec, 2876b28, ffffffff, fec75fda, 0) + 80
 fe5bb3e4 void CompileBroker::invoke_compiler_on_method(CompileTask*) (34e50e0, 11cc00, 850, 0, fe5ba564, 2b7000) + 9e8
 fe634cac void CompileBroker::compiler_thread_loop() (0, fedec480, 2b7000, 298d10, 2f400, 2f400) + 65c
 febb50e0 void JavaThread::thread_main_inner() (2b7000, 2b7628, 1f, f, fedb2000, 0) + 48
 feaf54e8 java_start (2b7000, 49f3, fedb2000, fecffe39, 2b85c0, fedfb3e4) + 22c
 ff2c5238 _lwp_start (0, 0, 0, 0, 0, 0)

                                    

Comments
PUBLIC COMMENTS

We are running with -XX:+PrintCompilation to find the method that the compiler
is having trouble compiling.  Then we will exclude it as a workaround.
                                     
2009-07-21
SUGGESTED FIX

*** /tmp/geta.XXFEay5H  Wed Aug  5 15:54:03 2009                                                              
--- postaloc.cpp        Wed Aug  5 15:51:02 2009                                                              
***************
*** 536,542 ****
          // then 'n' is a useless copy.  Do not update the register->node                                    
          // mapping so 'n' will go dead.                                                                     
          if( value[nreg] != val ) {                                                                          
!           if (eliminate_copy_of_constant(val, n, b, value, regnd, nreg, OptoReg::Bad)) {                    
              n->replace_by(regnd[nreg]);                                                                     
              j -= yank_if_dead(n,b,&value,&regnd);                                                           
            } else {                                                                                          
--- 536,543 ----
          // then 'n' is a useless copy.  Do not update the register->node                                    
          // mapping so 'n' will go dead.                                                                     
          if( value[nreg] != val ) {                                                                          
!           if (eliminate_copy_of_constant(val, n, b, value, regnd, nreg, OptoReg::Bad) &&                    
!               regnd[nreg]->outcnt() != 0) {                                                                 
              n->replace_by(regnd[nreg]);                                                                     
              j -= yank_if_dead(n,b,&value,&regnd);                                                           
            } else {                                                                                          
***************
*** 564,570 ****
            nreg_lo = tmp.find_first_elem();                                                                  
          }                                                                                                   
          if( value[nreg] != val || value[nreg_lo] != val ) {                                                 
!           if (eliminate_copy_of_constant(val, n, b, value, regnd, nreg, nreg_lo)) {                         
              n->replace_by(regnd[nreg]);                                                                     
              j -= yank_if_dead(n,b,&value,&regnd);                                                           
            } else {                                                                                          
--- 565,572 ----
            nreg_lo = tmp.find_first_elem();                                                                  
          }                                                                                                   
          if( value[nreg] != val || value[nreg_lo] != val ) {                                                 
!           if (eliminate_copy_of_constant(val, n, b, value, regnd, nreg, nreg_lo) &&                         
!               regnd[nreg]->outcnt() != 0) {                                                                 
              n->replace_by(regnd[nreg]);                                                                     
              j -= yank_if_dead(n,b,&value,&regnd);                                                           
            } else {
                                     
2009-08-05
EVALUATION

This appears to be a bug in the changes to support copy elimination of constants 5032515.  The uses need to be guarded by regnd[nreg]->outcnt() != 0 like the other places in that code.
                                     
2009-08-05
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/a70508bb21c3
                                     
2009-08-15
EVALUATION

http://hg.openjdk.java.net/hsx/hsx16/baseline/rev/0cb45c617c84
                                     
2009-09-01
EVALUATION

http://hg.openjdk.java.net/hsx/hsx16/master/rev/0cb45c617c84
                                     
2009-09-04



Hardware and Software, Engineered to Work Together