From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 54ED63858C55; Thu, 13 Oct 2022 12:23:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54ED63858C55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665663808; bh=pCeF8Lj9oFPeJpplzD5P167T0Bp9m0wGdMpPeDn8Z7E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FVsWf7JwB9Wcd86Tb0S3+zhniDF5JJIVXh9WwC6xsv3XM3HYvcZ+AZSTgJGAqzKES 1dAHTo9rYeiecFMpRX6WxGBPWTMl5AD2lRnktbrfRAnrtUwmFp7I/WQj98f58LvQhg gcABDmwEvxmjlmYpMjYDNzr1ubIP0pQeALaQx8ds= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107160] [13 regression] r13-2641-g0ee1548d96884d causes verification failure in spec2006 Date: Thu, 13 Oct 2022 12:23:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to bug_status Message-ID: In-Reply-To: References: 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=3D107160 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|linkw at gcc dot gnu.org |rguenth at gcc dot = gnu.org Status|NEW |ASSIGNED --- Comment #15 from Richard Biener --- I think that either vect_find_reusable_accumulator should punt on this or vect_create_epilog_for_reduction shouldn't register this accumulator. The caller of vect_find_reusable_accumulator checks for vec_num =3D=3D 1 (in the epilog) but we register for vec_num =3D=3D 2. For SLP reductions we "fail" to reduce to a single accumulator. int vec_num =3D vec_oprnds0.length (); gcc_assert (vec_num =3D=3D 1 || slp_node); The following fixes this: diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 1996ecfee7a..b1442a93581 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -6232,7 +6232,8 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo, } /* Record this operation if it could be reused by the epilogue loop. */ - if (STMT_VINFO_REDUC_TYPE (reduc_info) =3D=3D TREE_CODE_REDUCTION) + if (STMT_VINFO_REDUC_TYPE (reduc_info) =3D=3D TREE_CODE_REDUCTION + && vec_num =3D=3D 1) loop_vinfo->reusable_accumulators.put (scalar_results[0], { orig_reduc_input, reduc_info }= );=