From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22859 invoked by alias); 29 Nov 2010 19:06:08 -0000 Received: (qmail 22849 invoked by uid 22791); 29 Nov 2010 19:06:07 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Nov 2010 19:06:01 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oATJ60IB008768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 29 Nov 2010 14:06:00 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oATJ5tYL015360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 29 Nov 2010 14:05:59 -0500 Received: from host0.dyn.jankratochvil.net (localhost.localdomain [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id oATJ5qRm014562; Mon, 29 Nov 2010 20:05:54 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id oATJ5kfM014553; Mon, 29 Nov 2010 20:05:46 +0100 Date: Mon, 29 Nov 2010 19:06:00 -0000 From: Jan Kratochvil To: Hui Zhu Cc: linux-kernel@vger.kernel.org, gdb@sourceware.org, hellogcc@freelists.org Subject: Re: [PATCH] Built kernel without -O2 option Message-ID: <20101129190546.GA14255@host0.dyn.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00125.txt.bz2 On Mon, 29 Nov 2010 04:56:15 +0100, Hui Zhu wrote: > So I make a patch that add a option in "Kernel hacking" called "Close > GCC optimization". It will make kernel be built without -O2. This seems to me as a workaround. The real fix would be to use __attribute__((always_inline)) for functions requiring to be inlined and just compile everything with -O0 -g. info '(gcc)Function Attributes' `always_inline' Generally, functions are not inlined unless optimization is specified. For functions declared inline, this attribute inlines the function even if no optimization level was specified. But `always_inline' has been discussed on linux-kernel million times. I have not googled out a resolution why it is not applicable to this problem, do you know why? Thanks, Jan