fixed am candidate checker (handle special case loops where the load could be depende...
authorChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Mon, 10 Jul 2006 12:21:35 +0000 (12:21 +0000)
committerChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Mon, 10 Jul 2006 12:21:35 +0000 (12:21 +0000)
ir/be/ia32/ia32_optimize.c

index 2bc269f..0736872 100644 (file)
@@ -776,6 +776,8 @@ static ia32_am_cand_t is_am_candidate(ia32_code_gen_t *cg, heights_t *h, const i
                if (get_nodes_block(other) == block) {
                        other   = skip_Proj(other);
                        is_cand = heights_reachable_in_block(h, other, load) ? 0 : is_cand;
+                       /* this could happen in loops */
+                       is_cand = heights_reachable_in_block(h, load, irn) ? 0 : is_cand;
                }
        }
 
@@ -794,6 +796,8 @@ static ia32_am_cand_t is_am_candidate(ia32_code_gen_t *cg, heights_t *h, const i
                if (get_nodes_block(other) == block) {
                        other   = skip_Proj(other);
                        is_cand = heights_reachable_in_block(h, other, load) ? 0 : is_cand;
+                       /* this could happen in loops */
+                       is_cand = heights_reachable_in_block(h, load, irn) ? 0 : is_cand;
                }
        }