From c06315482599a3e85990ea326bfcf1c08a288421 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Tue, 2 Sep 2008 13:42:39 +0000 Subject: [PATCH] extending r21638: check sign when classifying float constants [r21652] --- ir/stat/const_stat.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ir/stat/const_stat.c b/ir/stat/const_stat.c index fc2c21009..ffa88a32b 100644 --- a/ir/stat/const_stat.c +++ b/ir/stat/const_stat.c @@ -75,10 +75,12 @@ static float_classify_t classify_float_value(tarval *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; -- 2.20.1