From 9db902314bdaa621457b126b0d54dc577b3a2db1 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 8 Oct 2016 10:21:24 +0200 Subject: [PATCH] Fix bug where pushes were being placed in the wrong blocks. --- mach/proto/mcg/pass_convertstackops.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mach/proto/mcg/pass_convertstackops.c b/mach/proto/mcg/pass_convertstackops.c index d73924d67..64bca0762 100644 --- a/mach/proto/mcg/pass_convertstackops.c +++ b/mach/proto/mcg/pass_convertstackops.c @@ -1,6 +1,6 @@ #include "mcg.h" -static ARRAYOF(struct ir) pops; +static PMAPOF(struct basicblock, struct ir) pops; static PMAPOF(struct basicblock, struct ir) pushes; static struct ir* get_last_push(struct basicblock* bb) @@ -62,7 +62,7 @@ static void convert_block(struct procedure* proc, struct basicblock* bb) ir = get_first_pop(outbb); if (!ir || (ir->size != lastpush->size)) return; - array_appendu(&pops, ir); + pmap_add(&pops, outbb, ir); /* Also abort unless *every* predecessor block of the one we've * just found *also* ends in a push of the same size. */ @@ -93,7 +93,8 @@ static void convert_block(struct procedure* proc, struct basicblock* bb) for (i=0; isize); for (j=0; jroot = phi; *ir = *phi; - array_insert(&bb->irs, ir, 0); } } } -- 2.34.1