From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A77B73858C62; Fri, 2 Dec 2022 13:24:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A77B73858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669987451; bh=Ah5/EobHzje87T0WrLMlohJgI7ytNko5kjMiCuliPjw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ty6XNomzvN8Z7AbrXi1eqgRKaTczm6MyY86yjFrHZptMWpuklwfR3ESCjJy9k4N1H ugDcyLQ9KRA+noUghnEeX3T0MIj4ZbUL4bvPNalOXIy3GG2wPzEqNDcpROmt28SORg WhsHL7t8D7m2DWPL+UKr2l2juf7UbbkmbLq37vbs= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107833] [12/13 Regression] wrong code at -Os and above on x86_64-linux-gnu since r12-5138-ge82c382971664d6f Date: Fri, 02 Dec 2022 13:24:10 +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.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 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=3D107833 --- Comment #13 from rguenther at suse dot de --- On Fri, 2 Dec 2022, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107833 >=20 > --- Comment #12 from Jakub Jelinek --- > So, do we whack-a-mole in this case some more and try harder in > mark_ssa_maybe_undefs > by basically repeating the CCP4 UNDEFINED propagation, or invent some new= stmt > or marking that IVOPTS could use before the loop to turn possibly undefin= ed > into undefined but always the same random pattern within the same invocat= ion > (kind of like asm ("" : "+g" (undef));), or something else (like after IV= OPTS > stop the UNDEFINED propagation on loop header PHIs or something similar)? Given the implementation of mark_ssa_maybe_undefs we can either blame (and fix) invariant motion (-fno-tree-loop-im fixes the testcase as well) or remove the ssa_name_any_use_dominates_bb_p check in this function, marking more SSA names as possibly undefined. We can also choose to ignore the issue until we run into this in the real world or try to design something better here (I keep being pointed at LLVM here but I don't see them solving the issue either). I will see whether I can make invariant motion not hoist undefined names.=