+2011-03-23 Jeff Law <law@redhat.com>
+
+ * cfg.c (redirect_edge_succ_nodup): Duplicate the varm map
+ before removing the edge.
+
+ * cfgrtl.c (cfg_layout_redirect_edge_and_branch): Do not use E after
+ it may have been freed by redirect_branch_edge or
+ redirect_edge_succ_nodup.
+
2011-03-23 Richard Guenther <rguenther@suse.de>
* tree-stdarg.c (va_list_counter_bump): Handle bumps via
if (s->probability > REG_BR_PROB_BASE)
s->probability = REG_BR_PROB_BASE;
s->count += e->count;
- remove_edge (e);
redirect_edge_var_map_dup (s, e);
+ remove_edge (e);
e = s;
}
else
e->flags &= ~EDGE_FALLTHRU;
redirected = redirect_branch_edge (e, dest);
gcc_assert (redirected);
- e->flags |= EDGE_FALLTHRU;
- df_set_bb_dirty (e->src);
- return e;
+ redirected->flags |= EDGE_FALLTHRU;
+ df_set_bb_dirty (redirected->src);
+ return redirected;
}
/* In case we are redirecting fallthru edge to the branch edge
of conditional jump, remove it. */
&& onlyjump_p (BB_END (src)))
delete_insn (BB_END (src));
}
- ret = redirect_edge_succ_nodup (e, dest);
if (dump_file)
fprintf (dump_file, "Fallthru edge %i->%i redirected to %i\n",
e->src->index, e->dest->index, dest->index);
+ ret = redirect_edge_succ_nodup (e, dest);
}
else
ret = redirect_branch_edge (e, dest);