From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 48EB93858414; Sun, 1 Oct 2023 00:53:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 48EB93858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696121595; bh=TnGdaUk45rvxCRISnj9FpJNugwCPUd6nNgXHKCoxPew=; h=From:To:Subject:Date:In-Reply-To:References:From; b=l70nPZLlNMUIKVJwpSnWwbdNaYj4NLA2yA3uPaH9O13qalJsynX1k/VnpwNQBBWyX nk4l2PzkbRRDzrc94irfVfgYrPTzxO43h7NZiZ06C9cW1eDd50ulV3TptjVfH8peF4 Och29YBaGTcxoOSJOvCNrauyw4AlvVtyV95Usoco= From: "lukas.graetz@tu-darmstadt.de" 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 00:53:15 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: lukas.graetz@tu-darmstadt.de 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111643 --- Comment #4 from Lukas Gr=C3=A4tz --- Sorry, just to clarify, whether I understood your two comments correctly. Should foo() be inlined in the following example because flatten works recursively? void foo (void) { // CODE } int bar_original (void) { // CODE foo(); // CODE } __attribute__((flatten)) int bar (void) { // INSTRUMENTATION CAN GO HERE return bar_original(); } I thought that according to the documentation of flatten, foo() would not be affected by the flatten attribute of bar(). It says: "For a function marked with this attribute, every call inside this function is inlined, if possibl= e." The call to foo() is not directly inside the function bar(). Only if bar_original() had also the __attribute__((flatten)), I would expect foo() = to be made inline in bar() because of recursive flatten. Of course, it could s= till be inlined because some heuristics...=