aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-06-01 13:55:12 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-06-01 13:55:12 +0000
commit96a956b65a8222c3dc53b3c6ee327657c517255e (patch)
treeccfc2980956279df7821e80698422ba6e03f1124
parentd88e64a6f4d4befc0d20435c81d4de6e81da5748 (diff)
downloadgcc-96a956b65a8222c3dc53b3c6ee327657c517255e.zip
gcc-96a956b65a8222c3dc53b3c6ee327657c517255e.tar.gz
gcc-96a956b65a8222c3dc53b3c6ee327657c517255e.tar.bz2
revert: re PR middle-end/66314 (ice in verify_loop_structure)
2015-06-01 Richard Biener <rguenther@suse.de> Revert 2015-05-29 Richard Biener <rguenther@suse.de> PR tree-optimization/66314 * tree-ssa-threadupdate.c (create_block_for_threading): Add parameter that says which loop the new block belongs to. (ssa_create_duplicates): Blocks duplicated for the threaded path belong to the loop of the thread destination. * gcc.dg/asan/pr66314.c: New testcase. From-SVN: r223979
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/gcc.dg/asan/pr66314.c33
-rw-r--r--gcc/tree-ssa-threadupdate.c24
4 files changed, 26 insertions, 50 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d794cee..ae19db5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2015-06-01 Richard Biener <rguenther@suse.de>
+
+ Revert
+ 2015-05-29 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/66314
+ * tree-ssa-threadupdate.c (create_block_for_threading): Add
+ parameter that says which loop the new block belongs to.
+ (ssa_create_duplicates): Blocks duplicated for the threaded
+ path belong to the loop of the thread destination.
+
2015-06-01 Martin Liska <mliska@suse.cz>
* sched-deps.c: Include pool-alloc.h before
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d74d29d..2de41e5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,13 @@
2015-06-01 Richard Biener <rguenther@suse.de>
+ Revert
+ 2015-05-29 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/66314
+ * gcc.dg/asan/pr66314.c: New testcase.
+
+2015-06-01 Richard Biener <rguenther@suse.de>
+
* gcc.dg/ipa/ipa-pta-1.c: Adjust.
2015-06-01 Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/testsuite/gcc.dg/asan/pr66314.c b/gcc/testsuite/gcc.dg/asan/pr66314.c
deleted file mode 100644
index 94dc2e8..0000000
--- a/gcc/testsuite/gcc.dg/asan/pr66314.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fprofile-arcs -fno-sanitize=address -fsanitize=kernel-address" } */
-
-char *a;
-int d;
-
-static int
-fn1 (int b, int c)
-{
- while (a)
- if (*a)
- return -126;
- if (b)
- return -12;
- if (c == -12)
- return c;
-}
-
-void
-fn2 (int b, int c)
-{
- for (;;)
- {
- d = fn1 (b, c);
- switch (d)
- {
- case -126:
- continue;
- default:
- return;
- }
- }
-}
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index a11b2c5..ce1dcdb 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -312,15 +312,13 @@ remove_ctrl_stmt_and_useless_edges (basic_block bb, basic_block dest_bb)
}
/* Create a duplicate of BB. Record the duplicate block in an array
- indexed by COUNT stored in RD. LOOP is the loop the block should
- belong to, if not NULL, in which case it will belong to the same
- loop as BB. */
+ indexed by COUNT stored in RD. */
static void
create_block_for_threading (basic_block bb,
struct redirection_data *rd,
unsigned int count,
- bitmap *duplicate_blocks, loop_p loop)
+ bitmap *duplicate_blocks)
{
edge_iterator ei;
edge e;
@@ -328,11 +326,6 @@ create_block_for_threading (basic_block bb,
/* We can use the generic block duplication code and simply remove
the stuff we do not need. */
rd->dup_blocks[count] = duplicate_block (bb, NULL, NULL);
- if (loop && rd->dup_blocks[count]->loop_father != loop)
- {
- remove_bb_from_loops (rd->dup_blocks[count]);
- add_bb_to_loop (rd->dup_blocks[count], loop);
- }
FOR_EACH_EDGE (e, ei, rd->dup_blocks[count]->succs)
e->aux = NULL;
@@ -1310,10 +1303,6 @@ ssa_create_duplicates (struct redirection_data **slot,
ssa_local_info_t *local_info)
{
struct redirection_data *rd = *slot;
- vec<jump_thread_edge *> *path = rd->path;
-
- /* Check to which loop the threading destination belongs to. */
- loop_p dest_loop = (*path).last ()->e->dest->loop_father;
/* The second duplicated block in a jump threading path is specific
to the path. So it gets stored in RD rather than in LOCAL_DATA.
@@ -1324,13 +1313,14 @@ ssa_create_duplicates (struct redirection_data **slot,
Note the search starts with the third edge on the path. The first
edge is the incoming edge, the second edge always has its source
duplicated. Thus we start our search with the third edge. */
+ vec<jump_thread_edge *> *path = rd->path;
for (unsigned int i = 2; i < path->length (); i++)
{
if ((*path)[i]->type == EDGE_COPY_SRC_BLOCK
|| (*path)[i]->type == EDGE_COPY_SRC_JOINER_BLOCK)
{
create_block_for_threading ((*path)[i]->e->src, rd, 1,
- &local_info->duplicate_blocks, dest_loop);
+ &local_info->duplicate_blocks);
break;
}
}
@@ -1340,7 +1330,7 @@ ssa_create_duplicates (struct redirection_data **slot,
if (local_info->template_block == NULL)
{
create_block_for_threading ((*path)[1]->e->src, rd, 0,
- &local_info->duplicate_blocks, dest_loop);
+ &local_info->duplicate_blocks);
local_info->template_block = rd->dup_blocks[0];
/* We do not create any outgoing edges for the template. We will
@@ -1350,7 +1340,7 @@ ssa_create_duplicates (struct redirection_data **slot,
else
{
create_block_for_threading (local_info->template_block, rd, 0,
- &local_info->duplicate_blocks, dest_loop);
+ &local_info->duplicate_blocks);
/* Go ahead and wire up outgoing edges and update PHIs for the duplicate
block. */
@@ -1687,7 +1677,7 @@ thread_single_edge (edge e)
npath->safe_push (x);
rd.path = npath;
- create_block_for_threading (bb, &rd, 0, NULL, NULL);
+ create_block_for_threading (bb, &rd, 0, NULL);
remove_ctrl_stmt_and_useless_edges (rd.dup_blocks[0], NULL);
create_edge_and_update_destination_phis (&rd, rd.dup_blocks[0], 0);