From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3AA273858C2A; Fri, 3 Nov 2023 10:35:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3AA273858C2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699007738; bh=tkUSlmz3wxtTuv5WDtfuTArOsRU0+N1mbzhkZKUJCDM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aUtB8LERvpkpvs/A0zTlEm7Rw9FqIR9lQpV63V052wWgmywR1k19L9Smrv+KdA0yV /bMeQuQMsmrmdtRDI4rahuMpvkg5TSAvJWxl1W7AR+cMCYFvFLZ3DPMTTnHUjpuljT eAAVfb5nSjiy0ne3zaHpizqtEghldx6woMTUp1Rc= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112310] [14 Regression] Wrong code at -O2/3 on x86_64-linux-gnu since r14-1161-g5476de2618f Date: Fri, 03 Nov 2023 10:35:37 +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: 14.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: P1 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112310 --- Comment #4 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:2266f7cbc78dfcf7c0739466644e0a6b9966553c commit r14-5095-g2266f7cbc78dfcf7c0739466644e0a6b9966553c Author: Richard Biener Date: Fri Nov 3 10:45:18 2023 +0100 tree-optimization/112310 - code hoisting undefined behavior The following avoids hoisting expressions that may invoke undefined behavior and are not computed on all paths. This is realized by noting that we have to avoid materializing expressions as part of hoisting that are not part of the set of expressions we have found eligible for hoisting. Instead of picking the expression corresponding to the hoistable values from the first successor we now keep a union of the expressions so that hoisting can pick the expression that has its dependences fully hoistable. PR tree-optimization/112310 * tree-ssa-pre.cc (do_hoist_insertion): Keep the union of expressions, validate dependences are contained within the hoistable set before hoisting. * gcc.dg/torture/pr112310.c: New testcase.=