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/tree-ssa/pr81832.c22
-rw-r--r--gcc/tree-ssa-loop-ch.c5
4 files changed, 37 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6cd2ea6..eb32772 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-16 Bin Cheng <bin.cheng@arm.com>
+
+ PR tree-optimization/81832
+ * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Don't
+ copy loop header which has IFN_LOOP_DIST_ALIAS call.
+
2017-08-16 Marek Polacek <polacek@redhat.com>
PR middle/81695
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fe2ea02..717e951 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-16 Bin Cheng <bin.cheng@arm.com>
+
+ PR tree-optimization/81832
+ * gcc.dg/tree-ssa/pr81832.c: New test.
+
2017-08-16 Richard Sandiford <richard.sandiford@linaro.org>
PR tree-optimization/81835
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr81832.c b/gcc/testsuite/gcc.dg/tree-ssa/pr81832.c
new file mode 100644
index 0000000..893124e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr81832.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+int a, b, *c;
+void d(void)
+{
+ int **e;
+ for(;;)
+ for(int f = 1; f <= 6; f++)
+ {
+ b = 0;
+ if(a)
+g:
+ while(a++);
+ if (**e);
+ else
+ {
+ *c = a;
+ goto g;
+ }
+ }
+}
diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c
index 14cc6d8d..6bb0220 100644
--- a/gcc/tree-ssa-loop-ch.c
+++ b/gcc/tree-ssa-loop-ch.c
@@ -119,7 +119,10 @@ should_duplicate_loop_header_p (basic_block header, struct loop *loop,
continue;
if (gimple_code (last) == GIMPLE_CALL
- && !gimple_inexpensive_call_p (as_a <gcall *> (last)))
+ && (!gimple_inexpensive_call_p (as_a <gcall *> (last))
+ /* IFN_LOOP_DIST_ALIAS means that inner loop is distributed
+ at current loop's header. Don't copy in this case. */
+ || gimple_call_internal_p (last, IFN_LOOP_DIST_ALIAS)))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,