From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2110F385841D; Wed, 19 Jan 2022 15:15:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2110F385841D From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102650] [12 Regression] Dead Code Elimination Regression at -O3 (trunk vs 11.2.0) Date: Wed, 19 Jan 2022 15:15:47 +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: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com 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.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 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: Wed, 19 Jan 2022 15:15:47 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102650 --- Comment #6 from Andrew Macleod --- (In reply to Richard Biener from comment #4) > If it is undefined it should be unreachable, not switch to a random static > branch ;) (defeating uninit diagnostics, of course) Well, its not unreachable.. we reach that code always and have to take one = of the branches. It just uses an automatic variable which hasn't been initiali= zed, making it undefined. We could choose whatever value we want for it. If we chose non-zero, the c= all would be eliminated. It would take analysis of some sort to decide which branch is more profitable to remove in the presence of undefined...=20=20 THis seems like something that maybe uninit could do :-) Hey, this is uninitialized, tell the user and then see what the most profitable value to assume for it going forward would be and set it to that value :-)=