projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not mark the transformed as visited. It makes no sense at all.
[libfirm]
/
ir
/
be
/
becopyilp2.c
diff --git
a/ir/be/becopyilp2.c
b/ir/be/becopyilp2.c
index
7208ae6
..
42fb15c
100644
(file)
--- a/
ir/be/becopyilp2.c
+++ b/
ir/be/becopyilp2.c
@@
-500,16
+500,14
@@
static void ilp2_build(ilp_env_t *ienv) {
static void ilp2_apply(ilp_env_t *ienv) {
local_env_t *lenv = ienv->env;
static void ilp2_apply(ilp_env_t *ienv) {
local_env_t *lenv = ienv->env;
- double *sol;
- lpp_sol_state_t state;
- int i, count;
+ int i;
/* first check if there was sth. to optimize */
if (lenv->first_x_var >= 0) {
/* first check if there was sth. to optimize */
if (lenv->first_x_var >= 0) {
+ int count = lenv->last_x_var - lenv->first_x_var + 1;
+ double *sol = XMALLOCN(double, count);
+ lpp_sol_state_t state = lpp_get_solution(ienv->lp, sol, lenv->first_x_var, lenv->last_x_var);
- count = lenv->last_x_var - lenv->first_x_var + 1;
- sol = xmalloc(count * sizeof(sol[0]));
- state = lpp_get_solution(ienv->lp, sol, lenv->first_x_var, lenv->last_x_var);
if (state != lpp_optimal) {
printf("WARNING %s: Solution state is not 'optimal': %d\n", ienv->co->name, state);
assert(state >= lpp_feasible && "The solution should at least be feasible!");
if (state != lpp_optimal) {
printf("WARNING %s: Solution state is not 'optimal': %d\n", ienv->co->name, state);
assert(state >= lpp_feasible && "The solution should at least be feasible!");
@@
-531,6
+529,8
@@
static void ilp2_apply(ilp_env_t *ienv) {
assert(0 && "This should be a x-var");
}
}
assert(0 && "This should be a x-var");
}
}
+
+ xfree(sol);
}
#ifdef COPYOPT_STAT
}
#ifdef COPYOPT_STAT