From: Michael Beck Date: Fri, 9 Apr 2010 15:34:33 +0000 (+0000) Subject: Bugfix: add missing NaN handling for Cmp nodes inside combo. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=b9ce124512010114e2b9d200465e389f61c13053;hp=585313e4f787bffe4852682a6dc0f933fc91d845;p=libfirm Bugfix: add missing NaN handling for Cmp nodes inside combo. This fixes testsuite/backend/floatset.c ... [r27367] --- diff --git a/ir/opt/combo.c b/ir/opt/combo.c index 73c54fd2e..f8a507082 100644 --- a/ir/opt/combo.c +++ b/ir/opt/combo.c @@ -2302,15 +2302,26 @@ static void compute_Cmp(node_t *node) node_t *r = get_irn_node(get_Cmp_right(cmp)); lattice_elem_t a = l->type; lattice_elem_t b = r->type; + ir_mode *mode = get_irn_mode(get_Cmp_left(cmp)); if (a.tv == tarval_top || b.tv == tarval_top) { node->type.tv = tarval_top; } else if (r->part == l->part) { /* both nodes congruent, we can probably do something */ - node->type.tv = tarval_b_true; + if (mode_is_float(mode)) { + /* beware of NaN's */ + node->type.tv = tarval_bottom; + } else { + node->type.tv = tarval_b_true; + } } else if (is_con(a) && is_con(b)) { /* both nodes are constants, we can probably do something */ - node->type.tv = tarval_b_true; + if (mode_is_float(mode)) { + /* beware of NaN's */ + node->type.tv = tarval_bottom; + } else { + node->type.tv = tarval_b_true; + } } else { node->type.tv = tarval_bottom; }