From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0CA1B3857411; Thu, 17 Feb 2022 11:57:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0CA1B3857411 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103181] [9 Regression] wrong code at -O1 due to conditional division by 0 being executed Date: Thu, 17 Feb 2022 11:57:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Feb 2022 11:57:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103181 --- Comment #9 from CVS Commits --- The releases/gcc-9 branch has been updated by Richard Biener : https://gcc.gnu.org/g:1ac5fbea476e4ebd6a0086ccfbf92e648768be7b commit r9-9955-g1ac5fbea476e4ebd6a0086ccfbf92e648768be7b Author: Richard Biener Date: Thu Nov 11 09:40:36 2021 +0100 middle-end/103181 - fix operation_could_trap_p for vector division For integer vector division we only checked for all zero vector constants rather than checking whether any element in the constant vector is zero. It also fixes the adjustment to operation_could_trap_helper_p where I failed to realize that RDIV_EXPR is also used for fixed-point types. It also fixes that handling by properly checking for a fixed_zerop divisor. 2021-11-11 Richard Biener PR middle-end/103181 PR middle-end/103248 * tree-eh.c (operation_could_trap_helper_p): Properly check vector constants for a zero element for integer division. Separate floating point and integer division code. Properly handle fixed-point RDIV_EXPR. * gcc.dg/torture/pr103181.c: New testcase. * gcc.dg/pr103248.c: Likewise. (cherry picked from commit 2f0c8f74daef93c0c7b33294213e7db6df58c4d1)=