From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 737D7383E829; Mon, 22 Jun 2020 07:45:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 737D7383E829 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592811953; bh=vC6INOyZmvQW2HxAEEl4om2EhvuPZwvRq49jsh5l1ro=; h=From:To:Subject:Date:In-Reply-To:References:From; b=izkkJVIyiGGsOW+qdBvD+4vo181hm7+zDXnVRnOOOXdZ5Z2ucVRzyXihYO+kq4HKw DWcQfaT5pm/GYwt/n2DrVt7lu/SEmP1DNVE77VOI1CH4rhx2glcs31esPU75rO0ni5 ax33hGH4sViqCFdOgFjArio8TikYy4ZZwiYShZ/k= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/95769] Constant expression in inline function not optimized Date: Mon, 22 Jun 2020 07:45:53 +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: 10.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: 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: Mon, 22 Jun 2020 07:45:53 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95769 --- Comment #5 from Jakub Jelinek --- If we are going to optimize this at IPA time, I'll note we'd need a separate middle-end IL evaluation code, because the FE one isn't usable for this (not even through a langhook), because it relies on the IL being unfolded FE tre= es and has all the language imposed restrictions etc. I think I've mentioned IL evaluation as something useful for loops to be ab= le to evaluate all their side-effects and judge if they are small enough (not = too much overwritten memory, etc.) to replace the original loop, and if we have= it, using it for functions to whose arguments we propagate constants, perhaps u= sing the constexpr as a hint to try somewhat longer, could work.=