diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-23 17:35:59 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-23 17:35:59 +0000 |
commit | d5321455e35032d4c2481240a08dc736598bd290 (patch) | |
tree | 63167faa52777ebde1ca5984d9076b69601f109d /gcc | |
parent | de508de3aa579410056530a92de76d4df94a62d6 (diff) | |
download | gcc-d5321455e35032d4c2481240a08dc736598bd290.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171356 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cfg.c | 2 | ||||
-rw-r--r-- | gcc/cfgrtl.c | 8 |
3 files changed, 14 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1591ce89ce3..436be3acc48 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +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 diff --git a/gcc/cfg.c b/gcc/cfg.c index c8ef799148e..5b1dc2649f1 100644 --- a/gcc/cfg.c +++ b/gcc/cfg.c @@ -402,8 +402,8 @@ redirect_edge_succ_nodup (edge e, basic_block new_succ) 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 diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 5d64f3af019..e78f5baf6ba 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -2537,9 +2537,9 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) 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. */ @@ -2553,10 +2553,10 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) && 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); |