Prevent computations with tarval_bad.
authorSebastian Buchwald <Sebastian.Buchwald@kit.edu>
Thu, 10 Nov 2011 09:50:36 +0000 (10:50 +0100)
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>
Thu, 10 Nov 2011 09:51:10 +0000 (10:51 +0100)
This fixes opt/fehler206.c.

ir/opt/opt_osr.c

index e0dffba..f0e705a 100644 (file)
@@ -1156,6 +1156,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 +1171,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;
                }