mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
6833879: Assigning positive zero is ignored when old value is negative zero
Don't perform CMOVE identity optimization for floating point types Reviewed-by: kvn, never
This commit is contained in:
parent
df05badc49
commit
716c78f080
1 changed files with 4 additions and 0 deletions
|
@ -128,6 +128,10 @@ Node *CMoveNode::is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f
|
|||
// Swapped Cmp is OK
|
||||
(phase->eqv(cmp->in(2),f) &&
|
||||
phase->eqv(cmp->in(1),t)) ) {
|
||||
// Give up this identity check for floating points because it may choose incorrect
|
||||
// value around 0.0 and -0.0
|
||||
if ( cmp->Opcode()==Op_CmpF || cmp->Opcode()==Op_CmpD )
|
||||
return NULL;
|
||||
// Check for "(t==f)?t:f;" and replace with "f"
|
||||
if( b->_test._test == BoolTest::eq )
|
||||
return f;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue