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/g++.dg/opt/pr87967.C50
-rw-r--r--gcc/tree-vect-loop.c2
4 files changed, 62 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 369ef54..19ccd9c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-11-13 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/87967
+ * tree-vect-loop.c (vect_transform_loop): Also copy PHIs
+ for constants for the scalar loop.
+
2018-11-13 Alan Modra <amodra@gmail.com>
* config/rs6000/linux64.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Exclude
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 43f542d..41ffd8b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-11-13 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/87967
+ * g++.dg/opt/pr87967.C: New testcase.
+
2018-11-13 Claudiu Zissulescu <claziss@synopsys.com>
* gcc.target/arc/builtin_eh.c: New test.
diff --git a/gcc/testsuite/g++.dg/opt/pr87967.C b/gcc/testsuite/g++.dg/opt/pr87967.C
new file mode 100644
index 0000000..aa28dfc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr87967.C
@@ -0,0 +1,50 @@
+// { dg-do compile { target c++11 } }
+// { dg-options "-O3" }
+
+void h();
+template <typename b> struct k { using d = b; };
+template <typename b, template <typename> class> using e = k<b>;
+template <typename b, template <typename> class f>
+using g = typename e<b, f>::d;
+struct l {
+ template <typename i> using ab = typename i::j;
+};
+struct n : l {
+ using j = g<char *, ab>;
+};
+class o {
+public:
+ long r();
+};
+char m;
+char s() {
+ if (m)
+ return '0';
+ return 'A';
+}
+class t {
+public:
+ typedef char *ad;
+ ad m_fn2();
+};
+void fn3() {
+ char *a;
+ t b;
+ bool p = false;
+ while (*a) {
+ h();
+ o c;
+ if (*a)
+ a++;
+ if (c.r()) {
+ n::j q;
+ for (t::ad d = b.m_fn2(), e; d != e; d++) {
+ char f = *q;
+ *d = f + s();
+ }
+ p = true;
+ }
+ }
+ if (p)
+ throw;
+}
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 0dc84f1..c4886ec 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -8264,7 +8264,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
e = single_exit (LOOP_VINFO_SCALAR_LOOP (loop_vinfo));
if (! single_pred_p (e->dest))
{
- split_loop_exit_edge (e);
+ split_loop_exit_edge (e, true);
if (dump_enabled_p ())
dump_printf (MSG_NOTE, "split exit edge of scalar loop\n");
}