From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B6B02389F4D7; Tue, 11 Jan 2022 09:53:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6B02389F4D7 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/100314] missed optimization for dead code elimination at -O3 (vs. -O1) (inlining differences) Date: Tue, 11 Jan 2022 09:53:36 +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: 12.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: version cf_reconfirmed_on cc 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, 11 Jan 2022 09:53:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100314 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unknown |12.0 Last reconfirmed|2021-09-25 00:00:00 |2022-1-11 CC| |hubicka at gcc dot gnu.org, | |jamborm at gcc dot gnu.org --- Comment #2 from Richard Biener --- the key is to notice that 'a' is not modified and thus zero and propagate t= hat to 'd'. With -O3 IPA figures out 'a' is not modified but that isn't taken = into account by IPA CP which sees a.0_1 =3D a; d (a.0_1); with -O1 we happen to inline everything during IPA and nothing early while with -O3 'e' is early inlined into 'd' (but not d into main) and IPA refuses to inline d into main: t.c:18:3: missed: not inlinable: main/7 -> d/6, --param large-stack-frame-growth limit reached sth is off with the stack limit I guess, maybe it's not cummulated correctly at -O1.=