diff --git a/src/share/vm/opto/connode.cpp b/src/share/vm/opto/connode.cpp index 46f13c652b6d41f537060d1822c2301ffa83f651..9e82a8e44415f0c24ebe3f023846fdfc219a877d 100644 --- a/src/share/vm/opto/connode.cpp +++ b/src/share/vm/opto/connode.cpp @@ -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;