aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr71881.c25
-rw-r--r--gcc/tree-loop-distribution.c6
4 files changed, 41 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 318baa2..9e39380 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2016-07-15 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/71881
+ * tree-loop-distribution.c (destroy_loop): Remove blocks in
+ reverse DOM order to make debug temp generation happy.
+
+2016-07-15 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/71887
* tree-ssa-phiopt.c (absorbing_element_p): Add rhs arg and
verify it is not zero for division / modulo handling.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b4892fc..c3a5600 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2016-07-15 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/71881
+ * gcc.dg/torture/pr71881.c: New testcase.
+
+2016-07-15 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/71887
* gcc.dg/torture/pr71887.c: New testcase.
diff --git a/gcc/testsuite/gcc.dg/torture/pr71881.c b/gcc/testsuite/gcc.dg/torture/pr71881.c
new file mode 100644
index 0000000..b17db1b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr71881.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-g" } */
+
+int a, b, c, d, *e, f, g;
+
+int fn1 ()
+{
+ char h[2];
+ int i = 0;
+ for (; i < 2; i++)
+ {
+ if (c)
+ for (*e = 0; *e;)
+ {
+ int j[f];
+ i = *e;
+ }
+ h[i] = 0;
+ }
+ for (; a;)
+ return h[0];
+ for (b = 0; b;)
+ i = g = (1 & i) < d;
+ return 0;
+}
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 9bca56a..181e4e9 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -888,13 +888,15 @@ destroy_loop (struct loop *loop)
cancel_loop_tree (loop);
rescan_loop_exit (exit, false, true);
- for (i = 0; i < nbbs; i++)
+ i = nbbs;
+ do
{
/* We have made sure to not leave any dangling uses of SSA
names defined in the loop. With the exception of virtuals.
Make sure we replace all uses of virtual defs that will remain
outside of the loop with the bare symbol as delete_basic_block
will release them. */
+ --i;
for (gphi_iterator gsi = gsi_start_phis (bbs[i]); !gsi_end_p (gsi);
gsi_next (&gsi))
{
@@ -912,6 +914,8 @@ destroy_loop (struct loop *loop)
}
delete_basic_block (bbs[i]);
}
+ while (i != 0);
+
free (bbs);
set_immediate_dominator (CDI_DOMINATORS, dest,