X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fstat%2Fconst_stat.c;h=ffa88a32b10a113d61e0648404d0d734e0a7bf99;hb=f6aeac6a547a52beb3cb663c5e63c05c9c3728ea;hp=4fd5b200b6d70c72388ee4cbef9b7305631bad49;hpb=602a065664be1be0038b551da457ce228207a80b;p=libfirm diff --git a/ir/stat/const_stat.c b/ir/stat/const_stat.c index 4fd5b200b..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_ieee754_zero_mantissa(tv)) { + 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;