BugFix:
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 13 Sep 2006 12:41:31 +0000 (12:41 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 13 Sep 2006 12:41:31 +0000 (12:41 +0000)
 - 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]

ir/opt/ldstopt.c

index 2235bc4..bb407e9 100644 (file)
@@ -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;
   }