From: Michael Beck Date: Wed, 13 Sep 2006 12:41:31 +0000 (+0000) Subject: BugFix: X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=29c261eb7fcde02881347c75879f6e263c71e5ec;p=libfirm BugFix: - When moving Stores over Phis we must ensure that the store block is different from the Phi-block, otherwise the post-dominance did NOT mean we we expect (and a Store is moved from the end of a block to its start) [r8240] --- diff --git a/ir/opt/ldstopt.c b/ir/opt/ldstopt.c index 2235bc4ef..bb407e94b 100644 --- a/ir/opt/ldstopt.c +++ b/ir/opt/ldstopt.c @@ -959,11 +959,13 @@ static unsigned optimize_phi(ir_node *phi, walk_env_t *wenv) return 0; /* check if the block is post dominated by Phi-block - and has no exception exit */ + and has no exception exit. Note that block must be different from + Phi-block, else we would move a Store from end End of a block to its + Start... */ bl_info = get_irn_link(block); if (bl_info->flags & BLOCK_HAS_EXC) return 0; - if (! block_postdominates(phi_block, block)) + if (block == phi_block || ! block_postdominates(phi_block, block)) return 0; }