From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 36BA23858023; Sun, 1 Oct 2023 01:13:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36BA23858023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696122826; bh=RNYaCUwzC8RPy274giphBtn34hA/kL8iXsKH5zSZLtk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ra7JblZzFnoXQ4X54F7aW1tiSnKSed+py7Bew3vRC0CrzVAfStSZXqKT4NpTMQ8sY G2DF+QI0RWCH/yUEp5YxI9NsmN4ffRlJzWgECD6KAUu+48BWVvIUut7OaXCbe4362i HZuwgJSB6U4YdDC/cVyA58/VTP2F7NH+qkQEDdhE= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/111643] __attribute__((flatten)) with -O1 runs out of memory (killed cc1) Date: Sun, 01 Oct 2023 01:13:43 +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: 13.2.0 X-Bugzilla-Keywords: documentation X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: keywords 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=3D111643 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |documentation --- Comment #5 from Andrew Pinski --- >It says: "For a function marked with this attribute, every call inside thi= s function is inlined, if possible." The call to foo() is not directly insi= de the function bar(). The definition of "every call" is definitely ambious in the documentation. = It could mean every mentioned call or it could mean recusively every call. In = this case, it means flatten all calls including ones called from other functions ("indirectly"). It was originally added to workaround some (not so good) inlining heurstics at the time for some C++ code (early 2000s). inlining heurstics has changed since then and has gotten better over the years so fo= lks don't use it as much. Also if you have any code where GCC's inlining heurstics does not do what y= ou think it should please file that so we can improve them instead of workarou= nds like always_inline and flatten don't need to be used ...=