From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15217 invoked by alias); 9 Aug 2008 15:33:30 -0000 Received: (qmail 15205 invoked by uid 22791); 9 Aug 2008 15:33:30 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 09 Aug 2008 15:32:15 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id m79FW2IC019096; Sat, 9 Aug 2008 17:32:02 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id m79FW1gl026254; Sat, 9 Aug 2008 17:32:01 +0200 (CEST) Date: Sat, 09 Aug 2008 15:33:00 -0000 Message-Id: <200808091532.m79FW1gl026254@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: hjl.tools@gmail.com CC: gdb-patches@sourceware.org, xuepeng.guo@intel.com, joey.ye@intel.com In-reply-to: <20080809145147.GA19462@lucon.org> (hjl.tools@gmail.com) Subject: Re: PATCH: Update x86 stack align analyzer References: <20080730211152.GA9645@lucon.org> <200808062105.m76L51xN016378@brahms.sibelius.xs4all.nl> <6dc9ffc80808061436y7ba7c35fl4844b5d9bce52a1@mail.gmail.com> <200808091202.m79C2dbV001412@brahms.sibelius.xs4all.nl> <20080809145147.GA19462@lucon.org> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00243.txt.bz2 > Date: Sat, 9 Aug 2008 07:51:47 -0700 > From: "H.J. Lu" > > On Sat, Aug 09, 2008 at 02:02:39PM +0200, Mark Kettenis wrote: > > I feel, rather strongly, that the stack align stuff stuff should only > > deal with stack alignment done *before* a frame gets setup. I think > > setting saved_sp_reg to -1, and proceeding as usual if it is still set > > at that value after the stack alignment analysis, works just fine. I > > also noticed a problem with your diff in that it doesn't use the > > proper saved sp value if you do have a frame (not sure GCC actually > > generates such code). > > > > How about the attached diff? Does it work with GCC 4.4? > > > > > > Yes, it works. OK to install? Sure, but can you change the ChangeLog to use kettenis@gnu.org as my mail-address? > 2008-08-09 Xuepeng Guo > H.J. Lu > Mark Kettenis > > * amd64-tdep.c (amd64_frame_cache): Add saved_sp_reg. > (amd64_init_frame_cache): Initialize saved_sp_reg. > (amd64_analyze_stack_align): New. > (amd64_analyze_prologue): Call it. > (amd64_frame_cache): Use saved_sp_reg if it is invalid. Don't set > %rip to 8 when halfway aligning the stack. > > * amd64-tdep.h (amd64_regnum): Add AMD64_R9_REGNUM to > AMD64_R14_REGNUM. > > * i386-tdep.c (i386_frame_cache): Remove stack_align. Add > saved_sp_reg. > (i386_alloc_frame_cache): Remove stack_align. Initialize > saved_sp_reg to -1. > (i386_analyze_stack_align): Rewrite. > (i386_frame_cache): Use saved_sp_reg if it is valid.