aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@gcc.gnu.org>2012-01-01 12:07:34 +0000
committerJan Hubicka <hubicka@gcc.gnu.org>2012-01-01 12:07:34 +0000
commit06f1716bd710974593f641e76e648fa54ad23c3a (patch)
tree40cd72a170f39bf112cfdf721c006d95af80120b /gcc
parent41d2ea5798472c0ee36c063f654e30fa7138fb0f (diff)
downloadgcc-06f1716bd710974593f641e76e648fa54ad23c3a.zip
gcc-06f1716bd710974593f641e76e648fa54ad23c3a.tar.gz
gcc-06f1716bd710974593f641e76e648fa54ad23c3a.tar.bz2
re PR rtl-optimization/51069 (ICE in verify_loop_structure, at cfgloop.c:1559)
PR rtl-optimization/51069 * cfgloopmanip.c (remove_path): Removing path making irreducible region unconditional makes BB part of the region. * gcc.c-torture/compile/pr51069.c: New testcase. From-SVN: r182767
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cfgloopmanip.c7
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr51069.c35
4 files changed, 52 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fec1dec..f0a850d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-01 Jan Hubicka <jhjh@suse.cz>
+
+ PR rtl-optimization/51069
+ * cfgloopmanip.c (remove_path): Removing path making irreducible
+ region unconditional makes BB part of the region.
+
2012-01-01 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/51683
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 1824421..9675417 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -290,6 +290,7 @@ remove_path (edge e)
int i, nrem, n_bord_bbs;
sbitmap seen;
bool irred_invalidated = false;
+ edge_iterator ei;
if (!can_remove_branch_p (e))
return false;
@@ -329,9 +330,13 @@ remove_path (edge e)
/* Find "border" hexes -- i.e. those with predecessor in removed path. */
for (i = 0; i < nrem; i++)
SET_BIT (seen, rem_bbs[i]->index);
+ if (!irred_invalidated)
+ FOR_EACH_EDGE (ae, ei, e->src->succs)
+ if (ae != e && ae->dest != EXIT_BLOCK_PTR && !TEST_BIT (seen, ae->dest->index)
+ && ae->flags & EDGE_IRREDUCIBLE_LOOP)
+ irred_invalidated = true;
for (i = 0; i < nrem; i++)
{
- edge_iterator ei;
bb = rem_bbs[i];
FOR_EACH_EDGE (ae, ei, rem_bbs[i]->succs)
if (ae->dest != EXIT_BLOCK_PTR && !TEST_BIT (seen, ae->dest->index))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6e81414..7cc8411 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-01-01 Jan Hubicka <jh@suse.cz>
+
+ PR rtl-optimization/51069
+ * gcc.c-torture/compile/pr51069.c: New testcase.
+
2012-01-01 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/51683
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr51069.c b/gcc/testsuite/gcc.c-torture/compile/pr51069.c
new file mode 100644
index 0000000..4fdc52f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr51069.c
@@ -0,0 +1,35 @@
+
+int a, b, c, d, e, f, bar (void);
+
+void
+foo (int x)
+{
+ for (;;)
+ {
+ if (!x)
+ {
+ for (d = 6; d >= 0; d--)
+ {
+ while (!b)
+ ;
+ if (e)
+ return foo (x);
+ if (f)
+ {
+ a = 0;
+ continue;
+ }
+ for (; c; c--)
+ ;
+ }
+ }
+ if (bar ())
+ break;
+ e = 0;
+ if (x)
+ for (;;)
+ ;
+ }
+}
+
+