Created attachment 47267 [details] gzipped C++ source code The attached C++ code, when compiled by recent gcc trunk and compiler flags -O3 -std=c++1z, does this: internal compiler error: in vect_schedule_slp_instance, at tree-vect-slp.c:4095 1447 | void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, | ^~~~~~~~~ 0x80978a vect_schedule_slp_instance ../../trunk/gcc/tree-vect-slp.c:4095 0x13c0013 vect_schedule_slp_instance ../../trunk/gcc/tree-vect-slp.c:4077 0x13c0013 vect_schedule_slp_instance ../../trunk/gcc/tree-vect-slp.c:4077 0x13c0013 vect_schedule_slp_instance ../../trunk/gcc/tree-vect-slp.c:4077
Problem first seems to occur sometime between revision 278200 and 278250. Code reduction now in progress, but since the size of the partially reduced code is currently 5.4 Megs, this is expected to take quite some time.
vect_* -> not a C++ FE issue.
Agreed. Since code is fine with -O2, but not with -O3, then it looks like an optimiser problem to me. About 2 hours of reduction has already been done. More is in progress. Current size is about 2.2 Megs.
Hmm, the ICE on the unreduced testcase doesn't reproduce for me, but I can't remember a fix in this area. Which rev. were you testing?
Please see my comment above. Ok at 278200, broken at 278250. Or have I misunderstood something ?
On Fri, 15 Nov 2019, dcb314 at hotmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92516 > > --- Comment #5 from David Binderman <dcb314 at hotmail dot com> --- > Please see my comment above. Ok at 278200, broken at 278250. > > Or have I misunderstood something ? Ah sorry - missed that.
I can confirm that, started with r278246.
Reduced C++ code: class a { public: typedef int b; operator b(); }; class c { public: constexpr int m_fn1() const; constexpr int d() const; int e; int f; }; constexpr int c::m_fn1() const { return e; } constexpr int c::d() const { return f; } class g { public: g(); constexpr void i(const c &) noexcept; int j; int k; int l; int m; }; constexpr void g::i(const c &n) noexcept { int v = l - j, h = m - k; j = n.m_fn1() - v / 2; k = n.d() - h / 2; l = j + v; m = k + h; } class o { void m_fn4() const; a p; } r; void o::m_fn4() const { g q; c t; q.i(t); r.p || 0; }
Author: rguenth Date: Mon Nov 18 14:07:11 2019 New Revision: 278406 URL: https://gcc.gnu.org/viewcvs?rev=278406&root=gcc&view=rev Log: 2019-11-18 Richard Biener <rguenther@suse.de> PR tree-optimization/92516 * tree-vect-slp.c (vect_analyze_slp_instance): Add bst_map argument, hoist bst_map creation/destruction to ... (vect_analyze_slp): ... here, forming a true graph with SLP instances being the entries. (vect_detect_hybrid_slp_stmts): Remove wrapper. (vect_detect_hybrid_slp): Use one visited set for all graph entries. (vect_slp_analyze_node_operations): Simplify visited/lvisited to hash-sets of slp_tree. (vect_slp_analyze_operations): Likewise. (vect_bb_slp_scalar_cost): Remove wrapper. (vect_bb_vectorization_profitable_p): Use one visited set for all graph entries. (vect_schedule_slp_instance): Elide bst_map use. (vect_schedule_slp): Likewise. * g++.dg/vect/slp-pr92516.cc: New testcase. 2019-11-18 Richard Biener <rguenther@suse.de> * tree-vect-slp.c (vect_analyze_slp_instance): When a CTOR was vectorized with just external refs fail. * gcc.dg/vect/vect-ctor-1.c: New testcase. Added: trunk/gcc/testsuite/g++.dg/vect/slp-pr92516.cc trunk/gcc/testsuite/gcc.dg/vect/vect-ctor-1.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-slp.c
Fixed.