From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32368 invoked by alias); 3 May 2012 21:50:21 -0000 Received: (qmail 32359 invoked by uid 22791); 3 May 2012 21:50:20 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 May 2012 21:50:08 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id q43Lo5LQ016955; Thu, 3 May 2012 23:50:05 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id q43Lo33g014219; Thu, 3 May 2012 23:50:03 +0200 (CEST) Date: Thu, 03 May 2012 21:50:00 -0000 Message-Id: <201205032150.q43Lo33g014219@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: hjl.tools@gmail.com CC: gdb-patches@sourceware.org In-reply-to: (hjl.tools@gmail.com) Subject: Re: PATCH: Also check for `movl %esp, %ebp' for x32 References: <20120410202953.GA23862@intel.com> <201204171143.q3HBh9LV021759@glazunov.sibelius.xs4all.nl> <201205022143.q42Lhd3G018067@glazunov.sibelius.xs4all.nl> 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: 2012-05/txt/msg00107.txt.bz2 > >> I did have a look at it, but still have some questions. > >> > >>> Hi, > >>> > >>> X32 may use `movl %esp, %ebp' in prologue.  This patch checks it for > >>> x32.  Tested on Linux/x86-64.  OK for trunk? > >> > >> But the prologues generated by various compilers are expected to be > >> otherwise the same for both the x32 ABI and the normal 64-bit ABI?  I > >> guess x32 has to use "pushq %rbp" as "pushl %ebp" isn't available. > >> And I guess you want to keep the stack 16-byte aligned anyway.  I > >> suppose that "movq %rsp, %rbp" is still ok for x32, but "movl %esp, > >> %ebp" can be encoded in less bytes, so it might be a bit more > >> efficient for x32. > > > > That is correct. > > Is my patch OK to install? Sorry, no. I'm really unhappy with that multi-line if clause. It really is hard to parse. I'm trying to come up with a suggestion to make this better, but so far haven't succeeded. Does GCC ever generate the `mov %rsp,%rsp' instruction for x32?