X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fopt_osr.c;h=cdab2205802781dd15e7170d61f19e297a0abbb1;hb=8c9921a1fc166552f6e416434fd8394a4fc210a3;hp=1916430d9fe4cec0286221011388b2de9ec31603;hpb=8e4bc2eb57a9cdde6fab823850e61ed9e85da775;p=libfirm diff --git a/ir/opt/opt_osr.c b/ir/opt/opt_osr.c index 1916430d9..cdab22058 100644 --- a/ir/opt/opt_osr.c +++ b/ir/opt/opt_osr.c @@ -22,7 +22,6 @@ * @brief Operator Strength Reduction. * @date 12.5.2006 * @author Michael Beck - * @version $Id$ * @brief * Implementation of the Operator Strength Reduction algorithm * by Keith D. Cooper, L. Taylor Simpson, Christopher A. Vick. @@ -46,6 +45,7 @@ #include "set.h" #include "tv.h" #include "hashptr.h" +#include "util.h" #include "irtools.h" #include "irloop_t.h" #include "array.h" @@ -608,13 +608,12 @@ static int is_counter_iv(ir_node *iv, iv_env *env) */ static int check_users_for_reg_pressure(ir_node *iv, iv_env *env) { - ir_node *irn, *header; + ir_node *irn; ir_node *have_user = NULL; ir_node *have_cmp = NULL; node_entry *e = get_irn_ne(iv, env); scc *pscc = e->pscc; - header = e->header; for (irn = pscc->head; irn != NULL; irn = e->next) { const ir_edge_t *edge; @@ -1156,6 +1155,12 @@ static ir_node *applyOneEdge(ir_node *iv, ir_node *rc, LFTR_edge *e, iv_env *env panic("Unsupported opcode"); } + if (tv == tarval_bad || tv_init == tarval_bad) { + tarval_set_integer_overflow_mode(ovmode); + DB((dbg, LEVEL_4, " = OVERFLOW")); + return NULL; + } + if (pscc->code == iro_Add) { tv_end = tarval_add(tv, tv_incr); } else { @@ -1165,7 +1170,7 @@ static ir_node *applyOneEdge(ir_node *iv, ir_node *rc, LFTR_edge *e, iv_env *env tarval_set_integer_overflow_mode(ovmode); - if (tv == tarval_bad || tv_init == tarval_bad || tv_end == tarval_bad) { + if (tv_end == tarval_bad) { DB((dbg, LEVEL_4, " = OVERFLOW")); return NULL; }