From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14258 invoked by alias); 11 Apr 2008 07:48:41 -0000 Received: (qmail 14218 invoked by uid 22791); 11 Apr 2008 07:48:40 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 11 Apr 2008 07:48:23 +0000 Received: (qmail 30979 invoked from network); 11 Apr 2008 07:48:21 -0000 Received: from unknown (HELO ?192.168.0.2?) (mitchell@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 Apr 2008 07:48:21 -0000 Message-ID: <47FF17C0.401@codesourcery.com> Date: Fri, 11 Apr 2008 08:16:00 -0000 From: Mark Mitchell User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Michael Matz CC: Jan Hubicka , Richard Guenther , gcc-patches@gcc.gnu.org Subject: Re: Patch ping... References: <20080405162606.GA22594@atrey.karlin.mff.cuni.cz> <84fc9c000804050953o429fde26jb3938827ff9dc5a@mail.gmail.com> <20080405195910.GF28471@atrey.karlin.mff.cuni.cz> <47FBCEF5.50001@codesourcery.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg00927.txt.bz2 Michael Matz wrote: >>> and decide on hotness. With -Os defaulting to conservative behaviour >>> (ie function is hot only if attribute or profile feedback suggest so) >>> and -O2 defaulting to aggressive behaviour (function is hot if not >>> declared cold, function local profile is within bounds). >> This seems like a good idea, except that I'm not sure it's what people really >> want from -Os. With -Os, I think some users want small code, all the time, >> period. > > Then they should not use attribute(hot) or profile feedback, period. The issue I am raising is that __attribute((hot))__ is a property of the application, not of the system. So, the developer building the application might well mark something as "hot" because that's the inner loop of that application -- but the application as a whole might be very rarely used on the target system. There's no way for the developer of the application to know that, and there's no way for the system integration to know that __attribute__((hot))__ is in use, effectively wasting precious flash. Clearly, if this makes a 100MB application 100 bytes bigger, nobody cares. I am not sure if there is any issue here in practice. If the reality is that the total fraction of hot functions is very small, then it may be so small that we don't care. I certainly understand the idea of the attribute, and I think it's a good idea. I also think a mode where -Os honors that attribute (even at the expense of size) is a good idea. What I don't know is whether that's the right default behavior for -Os. I'd be interested in what others think. -- Mark Mitchell CodeSourcery mark@codesourcery.com (650) 331-3385 x713