From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B12B93858D1E; Wed, 15 Feb 2023 09:09:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B12B93858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676452177; bh=jHba3Pc6dUx4ds9BsQdn0UYkgSaQexCzzYSR6T5GgCQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=U2MAEFP+cA96Tu+ZIEMO9GlCeMPjokgwUzq7VdCVTHwQim655hVtdJFHWiUjeTP+n 3/yM+rruiolNhUzG6byQCnKtvn2xcaNwCvPmSh7wmo1faOyvzGboFCDXD79USdoAVc nnnO6msT9Y2RC9iZJWrhRCKXpNJtrTnlANRmnE5w= From: "yinyuefengyi at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108351] [13 Regression] Dead Code Elimination Regression at -O3 since r13-4240-gfeeb0d68f1c708 Date: Wed, 15 Feb 2023 09:09:37 +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: yinyuefengyi at gmail 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: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108351 Xionghu Luo (luoxhu at gcc dot gnu.org) cha= nged: What |Removed |Added ---------------------------------------------------------------------------- CC| |yinyuefengyi at gmail dot = com --- Comment #3 from Xionghu Luo (luoxhu at gcc dot gnu.org) --- (In reply to Andrew Pinski from comment #2) > I noticed that with the C++ front-end early inline inlines f into main but > with the C front-end it does not ... C++ generates different call instructions with C front-end: < D.3747 =3D f (7, 7); < D.3748 =3D f (9, 7); --- > f (7, 7); > f (9, 7); then an extra return_cost cost is added to C++ front-end: < D.3747 =3D f (7, 7); < freq:1.00 size: 4 time: 13 < D.3748 =3D f (9, 7); < freq:1.00 size: 4 time: 13 --- > f (7, 7); > freq:1.00 size: 3 time: 12 > f (9, 7); > freq:1.00 size: 3 time: 12 early inline pass inlines the two calls with C front-end but fails to inline them with C++ front-end due to "growth 8 exceeds --param early-inlining-ins= ns=20 divided by number of calls".=20 gcc/ipa-inline.cc:747 growth * (n + 1) > early_inlining_insns gcc/opts.cc:687 { OPT_LEVELS_3_PLUS, OPT__param_early_inlining_insns_, N= ULL, 14 }, Tried revert the commit r13-4240-gfeeb0d68f1c708, the two calls still exits, need also revert the commit r13-4686-g095a13eda2caf6. (r13-4686 mentioned IPA-SRA detects whether parameters could be removed, obviously it doesn't work well now if constants are not propagated before IPA-SRA, it seems that the IPA-SRA only remove locally_unused parameters but 'm' is not locally used and the constants from caller are not visible in IPA-SRA?)=