From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4796F3858C27; Tue, 20 Apr 2021 08:14:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4796F3858C27 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/100112] missed optimization for dead code elimination at -O3, -Os (vs. -O1, -O2) Date: Tue, 20 Apr 2021 08:14:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 11.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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component keywords everconfirmed cc bug_status version cf_reconfirmed_on 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: Tue, 20 Apr 2021 08:14:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100112 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Component|tree-optimization |ipa Keywords| |missed-optimization Ever confirmed|0 |1 CC| |marxin at gcc dot gnu.org Status|UNCONFIRMED |NEW Version|unknown |11.0 Last reconfirmed| |2021-04-20 --- Comment #1 from Richard Biener --- It's very late eliminated at -O1 (DCE7) while with -O3 we still have [local count: 1073741824]: _2 =3D e; _3 =3D _2 + 1; e =3D _3;=20 c.1_4 =3D c; if (c.1_4 =3D=3D 0B) goto ; [48.88%] else goto ; [51.12%] [local count: 524845000]: foo (); there. In the end it's some IPA issue, failing to make 'c' readonly at -O3 vs. -O1.=