X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fstat%2Fconst_stat.c;h=ffa88a32b10a113d61e0648404d0d734e0a7bf99;hb=44faeb9742640d3498eb4482f98eb1255607c4d6;hp=7ff898a21826413e820b967c801bee40cfe2316f;hpb=02f5da72d6dc3994960a2dc2c2ee648c6d8fcb63;p=libfirm diff --git a/ir/stat/const_stat.c b/ir/stat/const_stat.c index 7ff898a21..ffa88a32b 100644 --- a/ir/stat/const_stat.c +++ b/ir/stat/const_stat.c @@ -69,16 +69,18 @@ static float_classify_t classify_float_value(tarval *tv) { ir_mode *mode = get_tarval_mode(tv); if (tv == get_mode_null(mode)) - return STAT_FC_1; + return STAT_FC_0; else if (tv == get_mode_one(mode)) return STAT_FC_1; else if (tarval_is_finite(tv) && tarval_ieee754_zero_mantissa(tv)) { int exp = tarval_ieee754_get_exponent(tv); - if (exp == 1) - return STAT_FC_2; - else if (exp == -1) - return STAT_FC_0_5; + if (! tarval_is_negative(tv)) { + if (exp == 1) + return STAT_FC_2; + else if (exp == -1) + return STAT_FC_0_5; + } return STAT_FC_POWER_OF_TWO; } return STAT_FC_OTHER;