From 8196d8e3e34f2b9d43699066ac24ac58c2168666 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sat, 4 Oct 2008 17:38:35 +0000 Subject: [PATCH] peephole_ia32_Test() would due to a bug only remove an ia32_Test if its direct successor was the desired node. If the desired node was an indirect successor, it would incorrectly identify it as flags destroyer. [r22479] --- ir/be/ia32/ia32_optimize.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ir/be/ia32/ia32_optimize.c b/ir/be/ia32/ia32_optimize.c index dab11270b..fdbd56638 100644 --- a/ir/be/ia32/ia32_optimize.c +++ b/ir/be/ia32/ia32_optimize.c @@ -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"); } -- 2.20.1