From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2FA583882664; Tue, 18 Jun 2024 11:12:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2FA583882664 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718709126; bh=W9LEIiwheUg5KnNs3aHh9cvwM3qU/2JQkMDpQvOLLR0=; h=From:To:Subject:Date:From; b=s6f8YAGnHWyO+opiCIMV+K5q3OfDhqddNOTnpRYveUkWYLOphAh8RElRc6JuFydaA N36Mk92Ivkxw+YpW2rwil3P8k0ZLkxksC9LHHTp6V9PllDj+LME/3Jcyzc2Nc9oZGg WHw5xyAjuuwKvG9QcVq5xGM19HIdsnVC1pIdw7Pc= From: "tnfchris at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/115537] New: [15 Regression] vectorizable_reduction ICEs after g:d66b820f392aa9a7c34d3cddaf3d7c73bf23f82d Date: Tue, 18 Jun 2024 11:12:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: tnfchris at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115537 Bug ID: 115537 Summary: [15 Regression] vectorizable_reduction ICEs after g:d66b820f392aa9a7c34d3cddaf3d7c73bf23f82d Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: tnfchris at gcc dot gnu.org CC: rguenth at gcc dot gnu.org Target Milestone: --- testcase: --- char *a; int b; void c() { int d =3D 0, e =3D 0, f; for (; f; ++f) if (a[f] =3D=3D 5) ; else if (a[f]) e =3D 1; else d =3D 1; if (d) if (e) b =3D 0; } --- compiled with -mcpu=3Dneoverse-v1 -O3 produces the following ICE: during GIMPLE pass: vect pngrtran.i: In function 'c': pngrtran.i:3:6: internal compiler error: in vectorizable_reduction, at tree-vect-loop.cc:8335 3 | void c() { | ^ 0xff74ff vectorizable_reduction(_loop_vec_info*, _stmt_vec_info*, _slp_tree= *, _slp_instance*, vec*) /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-loop.cc:8335 0x1b598f7 vect_analyze_stmt(vec_info*, _stmt_vec_info*, bool*, _slp_tree*, _slp_instance*, vec*) /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-stmts.cc:13353 0x10225df vect_slp_analyze_node_operations_1 /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-slp.cc:6457 0x10225df vect_slp_analyze_node_operations /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-slp.cc:6656 0x102253f vect_slp_analyze_node_operations /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-slp.cc:6635 0x1023ec3 vect_slp_analyze_operations(vec_info*) /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-slp.cc:7053 0xff816f vect_analyze_loop_2 /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-loop.cc:2953 0xff9fb7 vect_analyze_loop_1 /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-loop.cc:3484 0xffa6f7 vect_analyze_loop(loop*, vec_info_shared*) /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-loop.cc:3642 0x1035547 try_vectorize_loop_1 /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vectorizer.cc:1067 0x1035547 try_vectorize_loop /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vectorizer.cc:1183 0x1035a5b execute /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vectorizer.cc:1299 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. after: commit d66b820f392aa9a7c34d3cddaf3d7c73bf23f82d Author: Richard Biener Date: Thu Jun 13 14:42:25 2024 +0200 Support single def-use cycle optimization for SLP reduction vectorizati= on We can at least mimic single def-use cycle optimization when doing single-lane SLP reductions and that's required to avoid regressing compared to non-SLP. * tree-vect-loop.cc (vectorizable_reduction): Allow single-def-use cycles with SLP. (vect_transform_reduction): Handle SLP single def-use cycles. (vect_transform_cycle_phi): Likewise. * gcc.dg/vect/slp-reduc-12.c: New testcase. gcc/testsuite/gcc.dg/vect/slp-reduc-12.c | 18 +++++++++++++ gcc/tree-vect-loop.cc | 45 +++++++++++++++++++---------= ---- 2 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/vect/slp-reduc-12.c bisect run success looks like it's hitting the assert: gcc_assert (op.code !=3D COND_EXPR);=