aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadupdate.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-12-15 08:19:55 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-12-15 08:19:55 +0000
commit0675001e9827fe45b6d9994452915e8929651ecd (patch)
tree53e1e3c4dd8e23039265c95b7a6992126ecdb915 /gcc/tree-ssa-threadupdate.c
parent451f11993580c3fb0b80da62885a00f8ee265304 (diff)
downloadgcc-0675001e9827fe45b6d9994452915e8929651ecd.zip
gcc-0675001e9827fe45b6d9994452915e8929651ecd.tar.gz
gcc-0675001e9827fe45b6d9994452915e8929651ecd.tar.bz2
re PR tree-optimization/64284 (ICE: Segmentation fault)
2014-12-15 Richard Biener <rguenther@suse.de> PR tree-optimization/64284 * tree-ssa-threadupdate.c (duplicate_seme_region): Mark the loop for removal if we copied the loop header. * gcc.dg/torture/pr64284.c: New testcase. From-SVN: r218733
Diffstat (limited to 'gcc/tree-ssa-threadupdate.c')
-rw-r--r--gcc/tree-ssa-threadupdate.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index 12f83ba..c7a476a 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -2364,7 +2364,7 @@ duplicate_seme_region (edge entry, edge exit,
basic_block *region_copy)
{
unsigned i;
- bool free_region_copy = false, copying_header = false;
+ bool free_region_copy = false;
struct loop *loop = entry->dest->loop_father;
edge exit_copy;
edge redirected;
@@ -2388,10 +2388,7 @@ duplicate_seme_region (edge entry, edge exit,
initialize_original_copy_tables ();
- if (copying_header)
- set_loop_copy (loop, loop_outer (loop));
- else
- set_loop_copy (loop, loop);
+ set_loop_copy (loop, loop);
if (!region_copy)
{
@@ -2453,6 +2450,8 @@ duplicate_seme_region (edge entry, edge exit,
}
/* Redirect the entry and add the phi node arguments. */
+ if (entry->dest == loop->header)
+ mark_loop_for_removal (loop);
redirected = redirect_edge_and_branch (entry, get_bb_copy (entry->dest));
gcc_assert (redirected != NULL);
flush_pending_stmts (entry);