From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E2B2E3858C1F; Fri, 14 Apr 2023 12:45:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2B2E3858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681476305; bh=qeHUBbM+qJnqh3aNLACmDLLcsHwgOaWBfX8vjfWHdTI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LEx3h8iueby91VIM7bYixfDBye/ZO8K4a3NAeOHcQYmKWbkiA8730w/FdXjrM5bFW RijRSWn+EA2q6KWPDhiYOUWE1QtLePJhmjh5J4oblBM/vato5zE80ln34zUVIpYncC m0+XYxu7Ugt+fPOhWs/2wiNPWwjzNt7ZR2VHg+3g= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109491] [11/12 Regression] Segfault in tree-ssa-sccvn.cc:expressions_equal_p() Date: Fri, 14 Apr 2023 12:45:05 +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: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 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=3D109491 --- Comment #15 from rguenther at suse dot de --- On Fri, 14 Apr 2023, chip.kerchner at ibm dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109491 >=20 > --- Comment #14 from Chip Kerchner --- > Just one more question and then I'll switch to the new bug. >=20 > Would it help any if the functions that are "always_inline" be changed fr= om > non-static to static? >=20 > Eigen's approach (where this code originally came from - yes, it could be > definite be better) is to use non-static inlined function. I don't think so, you'd have to try. The compile-time issues usually show up when you have a multi-level call chain all being always-inline as we then repeatedly early-optimize the same code over and over. Usually we do that so functions become smaller for the inline heuristics but for always-inlines that wouldn't matter (but of course making the body smaller if there's more than one caller can still pay off). It really depends on the actual callgraph and code which is also why it is hard to improve. Another probably more common with C++ code issue would be that we inline into not optimized callers which means calls that are almost trivially unreachable have not been eliminated yet but get inlined. Usual heuristics would only inline small functions at this level and defer inlining of larger functions to IPA time at which point the calls might be eliminated already. Likewise calls attributed const or pure might be subject to CSE but always-inline forces them to be inlined before CSE. So what you could try is instead of always_inline use __attribute__((flatten)) on the functions containing the loop kernels for example and then disable early inlining (otherwise flatten is applied there as well) with -fno-early-inlining.=