peephole_ia32_Test() would due to a bug only remove an ia32_Test if its direct succes...
authorChristoph Mallon <christoph.mallon@gmx.de>
Sat, 4 Oct 2008 17:38:35 +0000 (17:38 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sat, 4 Oct 2008 17:38:35 +0000 (17:38 +0000)
[r22479]

ir/be/ia32/ia32_optimize.c

index dab1127..fdbd566 100644 (file)
@@ -274,12 +274,14 @@ static void peephole_ia32_Test(ir_node *node)
 
        /* walk schedule up and abort when we find left or some other node destroys
           the flags */
-       schedpoint = sched_prev(node);
-       while(schedpoint != left) {
+       schedpoint = node;
+       for (;;) {
                schedpoint = sched_prev(schedpoint);
-               if(arch_irn_is(arch_env, schedpoint, modify_flags))
+               if (schedpoint == left)
+                       break;
+               if (arch_irn_is(arch_env, schedpoint, modify_flags))
                        return;
-               if(schedpoint == block)
+               if (schedpoint == block)
                        panic("couldn't find left");
        }