From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1C7513858410; Mon, 27 Mar 2023 11:56:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C7513858410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679918193; bh=oVPAZCm57CAN44KAEhEFT5HS7lmHhfUkZXTGP5X+qQw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dd0Sc1GekDwKUcI51Rt/unZBZh0If1ecCpIUchNEpXdswj7Lna8SJoPeFlpdkk08/ J2X8TiUnznMZU7K5kEK7KBHQP/5W7ziqrx8DXEbatgr021tBuz2AY8YCylSfZ9mzHU n3jj2rVF+VmLh6r5CTzIWTJ2MoXqbm2qylQdZ8jc= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108358] [13 Regression] Dead Code Elimination Regression at -Os since r13-3378-gf6c168f8c06047 Date: Mon, 27 Mar 2023 11:56:32 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org 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: 13.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=3D108358 --- Comment #2 from Richard Biener --- Both -O2 and -O1 can optimize away the call to foo. For -Os we end up with [local count: 118111600]: l =3D *.LC0; goto ; [100.00%] [local count: 955630225]: bar31_ (); i.0_1 =3D i; _2 =3D i.0_1 + 1; i =3D _2; [local count: 1073741824]: i.1_3 =3D i; if (i.1_3 !=3D 0) goto ; [89.00%] else goto ; [11.00%] [local count: 118111600]: j =3D l; m$h$b_18 =3D j.h.b; if (m$h$b_18 !=3D 0) goto ; [67.00%] else goto ; [33.00%] [local count: 38976828]: foo (); but FREs looking through the j =3D l copy causes us to fail disambiguating against the cycle because of 'abort_on_visited' which I think is a bit overeager here.=