From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8664 invoked by alias); 9 Mar 2012 22:53:34 -0000 Received: (qmail 8650 invoked by uid 22791); 9 Mar 2012 22:53:33 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Mar 2012 22:53:20 +0000 From: "marek.vasut at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/52546] -fstack-usage not working with __attribute__((naked)) Date: Fri, 09 Mar 2012 22:53:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: marek.vasut at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-03/txt/msg00770.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52546 --- Comment #2 from Marek Vasut 2012-03-09 22:53:04 UTC --- (In reply to comment #1) > > Is there any way to tell the compiler how much stack does a naked function > > consume (or that it consumes zero stack)? Is this a GCC bug? > > It's a limitation. We could indeed do better, but if you know how much stack > space the function uses, what's the point in asking the compiler? :-) Ok, that's understandable and it's a really good function. It'd be certainly favorable to avoid using such feature (specify how much the function uses), but exactly for cases like this, it'd be very helpful to have. I'm no GC hacker myself so I have no idea how much work it'd be to write such a thing and if it'd be acceptable at all. Thanks for your quick reply!