fix another illegal usage of compound_graph_path stuff
[libfirm] / ir / stat / const_stat.c
index 7ff898a..abe0dd7 100644 (file)
@@ -23,9 +23,7 @@
  * @author  Michael Beck
  * @version $Id$
  */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include "firmstat_t.h"
 #include "tv_t.h"
@@ -69,16 +67,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;