fix
[libfirm] / ir / ana / execfreq.c
index eafdba8..957dc89 100644 (file)
@@ -45,6 +45,7 @@
 #include "firm_common_t.h"
 #include "set.h"
 #include "hashptr.h"
+#include "debug.h"
 
 #include "irprog_t.h"
 #include "irgraph_t.h"
@@ -292,6 +293,7 @@ compute_execfreq(ir_graph * irg, double loop_weight)
 
        x = solve_lgs(matrix, rhs, size);
        if (x == NULL) {
+               DEBUG_ONLY(ir_fprintf(stderr, "Debug Warning: Couldn't estimate execution frequencies for %+F\n", irg));
                ef->infeasible = 1;
        } else {
                ef->max = 0.0;
@@ -367,15 +369,15 @@ compute_execfreq(ir_graph * irg, double loop_weight)
 #ifdef USE_GSL
                gsl_vector_free(x);
 #endif
-               free(matrix);
-               free(rhs);
-
                memset(&ef->hook, 0, sizeof(ef->hook));
                ef->hook.context = ef;
                ef->hook.hook._hook_node_info = exec_freq_node_info;
                register_hook(hook_node_info, &ef->hook);
        }
 
+       free(matrix);
+       free(rhs);
+
        return ef;
 }