From 88b66a77cd93d1bc6ddd3e39b27ab967ade46086 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 21 Jun 2022 13:56:29 +0300 Subject: [PATCH] Support for multiple ENTRY --- ir_sccp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ir_sccp.c b/ir_sccp.c index df6643e..3b03a20 100644 --- a/ir_sccp.c +++ b/ir_sccp.c @@ -401,6 +401,11 @@ int ir_sccp(ir_ctx *ctx) /* A bit modified SCCP algorith of M. N. Wegman and F. K. Zadeck */ ir_bitset_incl(worklist, 1); + i = ctx->ir_base[1].op2; + while (i) { + ir_bitset_incl(worklist, i); + i = ctx->ir_base[i].op2; + } while ((i = ir_bitset_pop_first(worklist, len)) >= 0) { insn = &ctx->ir_base[i]; flags = ir_op_flags[insn->op];