Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753321AbZKSRlq (ORCPT ); Thu, 19 Nov 2009 12:41:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751901AbZKSRlq (ORCPT ); Thu, 19 Nov 2009 12:41:46 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:34375 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751893AbZKSRlp (ORCPT ); Thu, 19 Nov 2009 12:41:45 -0500 Date: Thu, 19 Nov 2009 09:39:21 -0800 (PST) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Thomas Gleixner cc: Ingo Molnar , "H. Peter Anvin" , LKML , Andrew Morton , Heiko Carstens , feng.tang@intel.com, Fr??d??ric Weisbecker , Steven Rostedt , Peter Zijlstra , jakub@redhat.com, gcc@gcc.gnu.org Subject: Re: BUG: GCC-4.4.x changes the function frame on some functions In-Reply-To: Message-ID: References: <20091119072040.GA23579@elte.hu> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1627 Lines: 60 On Thu, 19 Nov 2009, Thomas Gleixner wrote: > > standard function start: > > push %ebp > mov %esp, %ebp > .... > call mcount > > modified function start on a handful of functions only seen with gcc > 4.4.x on x86 32 bit: > > push %edi > lea 0x8(%esp),%edi > and $0xfffffff0,%esp > pushl -0x4(%edi) > push %ebp > mov %esp,%ebp > ... > call mcount That's some crazy sh*t anyway, since we don't _want_ the stack to be 16-byte aligned in the kernel. We do KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) why is that not working? So this looks like a gcc bug, plain and simple. > This modification leads to a hard to solve problem in the kernel > function graph tracer which assumes that the stack looks like: > > return address > saved ebp Umm. But it still does, doesn't it? That pushl -0x4(%edi) push %ebp should do it - the "-0x4(%edi)" thing seems to be trying to reload the return address. No? Maybe I misread the code - but regardless, it does look like a gcc code generation bug if only because we really don't want a 16-byte aligned stack anyway, and have asked for it to not be done. So I agree that gcc shouldn't do that crazy prologue (and certainly _not_ before calling mcount anyway), but I'm not sure I agree with that detail of your analysis or explanation. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/