diff --git a/compiler/minils/transformations/schedule_interf.ml b/compiler/minils/transformations/schedule_interf.ml index b759064..70b8945 100644 --- a/compiler/minils/transformations/schedule_interf.ml +++ b/compiler/minils/transformations/schedule_interf.ml @@ -69,12 +69,11 @@ struct nb_def_vars - nb_killed_vars + b in - (* returns the minimum element of the list with same_ctrl = true. If there is no such element, - return the minimum of the list. *) + (* returns the minimum element of the list with same_ctrl = true if possible. *) let rec min_same_ck (min_eq, min_c, min_same_ctrl) l = match l with | [] -> min_eq | (eq, c, same_ctrl)::l -> - if (c < min_c && (same_ctrl = min_same_ctrl)) or (same_ctrl && not min_same_ctrl) then + if (c < min_c) or (c = min_c && (same_ctrl && not min_same_ctrl)) then min_same_ck (eq, c, same_ctrl) l else min_same_ck (min_eq, min_c, min_same_ctrl) l