From a28dfaafc5afd06419408048b664a843b2739086 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 13 Nov 2018 13:50:18 +0000 Subject: [PATCH] re PR tree-optimization/87967 (ICE in slpeel_duplicate_current_defs_from_edges) 2018-11-13 Richard Biener PR tree-optimization/87967 * tree-vect-loop.c (vect_transform_loop): Also copy PHIs for constants for the scalar loop. * g++.dg/opt/pr87967.C: New testcase. From-SVN: r266070 --- gcc/ChangeLog | 6 ++++ gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/g++.dg/opt/pr87967.C | 50 ++++++++++++++++++++++++++++++ gcc/tree-vect-loop.c | 2 +- 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/opt/pr87967.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 369ef54fb0d..19ccd9cbf1d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-13 Richard Biener + + 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 * config/rs6000/linux64.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Exclude diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 43f542d47c7..41ffd8b3100 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-13 Richard Biener + + PR tree-optimization/87967 + * g++.dg/opt/pr87967.C: New testcase. + 2018-11-13 Claudiu Zissulescu * 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 00000000000..aa28dfc8a4f --- /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 struct k { using d = b; }; +template class> using e = k; +template class f> +using g = typename e::d; +struct l { + template using ab = typename i::j; +}; +struct n : l { + using j = g; +}; +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 0dc84f1f9e5..c4886ec76e6 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"); } -- 2.30.2