Mercurial > hg > truffle
diff src/share/vm/opto/postaloc.cpp @ 70:b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
Summary: copy elimination of a constant value results in incorrect execution
Reviewed-by: kvn, sgoldman, rasbold
author | never |
---|---|
date | Wed, 19 Mar 2008 15:14:36 -0700 |
parents | a61af66fc99e |
children | d1605aabd0a1 |
line wrap: on
line diff
--- a/src/share/vm/opto/postaloc.cpp Tue Mar 18 23:54:17 2008 -0700 +++ b/src/share/vm/opto/postaloc.cpp Wed Mar 19 15:14:36 2008 -0700 @@ -253,7 +253,8 @@ // nodes can represent the same constant so the type and rule of the // MachNode must be checked to ensure equivalence. // -bool PhaseChaitin::eliminate_copy_of_constant(Node* val, Block *current_block, +bool PhaseChaitin::eliminate_copy_of_constant(Node* val, Node* n, + Block *current_block, Node_List& value, Node_List& regnd, OptoReg::Name nreg, OptoReg::Name nreg2) { if (value[nreg] != val && val->is_Con() && @@ -269,12 +270,12 @@ // Since they are equivalent the second one if redundant and can // be removed. // - // val will be replaced with the old value but val might have + // n will be replaced with the old value but n might have // kills projections associated with it so remove them now so that // yank_if_dead will be able to elminate the copy once the uses // have been transferred to the old[value]. - for (DUIterator_Fast imax, i = val->fast_outs(imax); i < imax; i++) { - Node* use = val->fast_out(i); + for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { + Node* use = n->fast_out(i); if (use->is_Proj() && use->outcnt() == 0) { // Kill projections have no users and one input use->set_req(0, C->top()); @@ -521,7 +522,7 @@ // 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, b, value, regnd, nreg, OptoReg::Bad)) { + 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,®nd); } else { @@ -549,7 +550,7 @@ nreg_lo = tmp.find_first_elem(); } if( value[nreg] != val || value[nreg_lo] != val ) { - if (eliminate_copy_of_constant(n, b, value, regnd, nreg, nreg_lo)) { + 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,®nd); } else {