From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21368 invoked by alias); 28 Nov 2002 16:50:31 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 21338 invoked from network); 28 Nov 2002 16:50:27 -0000 Received: from unknown (HELO fw-cam.cambridge.arm.com) (193.131.176.3) by sources.redhat.com with SMTP; 28 Nov 2002 16:50:27 -0000 Received: by fw-cam.cambridge.arm.com; id QAA24472; Thu, 28 Nov 2002 16:50:25 GMT Received: from unknown(172.16.1.2) by fw-cam.cambridge.arm.com via smap (V5.5) id xma023374; Thu, 28 Nov 02 16:49:43 GMT Received: from pc960.cambridge.arm.com (pc960.cambridge.arm.com [10.1.205.4]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id QAA08984; Thu, 28 Nov 2002 16:49:42 GMT Received: from pc960.cambridge.arm.com (rearnsha@localhost) by pc960.cambridge.arm.com (8.11.6/8.9.3) with ESMTP id gASGngu29883; Thu, 28 Nov 2002 16:49:42 GMT Message-Id: <200211281649.gASGngu29883@pc960.cambridge.arm.com> X-Authentication-Warning: pc960.cambridge.arm.com: rearnsha owned process doing -bs To: Andrew Cagney cc: Richard.Earnshaw@arm.com, Kris Warkentin , gdb-patches@sources.redhat.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. Subject: Re: [rfa?] Add frame_align(); Was: ARM stack alignment on hand called functions In-reply-to: Your message of "Thu, 28 Nov 2002 11:45:17 EST." <3DE6481D.9060308@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 28 Nov 2002 08:50:00 -0000 From: Richard Earnshaw X-SW-Source: 2002-11/txt/msg00718.txt.bz2 > >> >> +/* Ensure that the ARM's stack pointer has the correct alignment for a > >> >> + new frame. */ > >> >> +static CORE_ADDR > >> >> +arm_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) > >> >> +{ > >> >> + return (addr & -16); > >> >> +} > > > >> > > >> > > >> > Yuck, two's complement assumption. I much prefer ~0xf in this case. > >> > > >> > But why so much. The maximum stack alignment you'll see on an ARM is 8 > >> > bytes. > > > >> > >> The function was lifted from the PPC code. And, hey, what's a few extra > >> bytes between friends? :-) > >> > >> Does (addr & 0x7) look better? > >> > >> Andrew > >> > >> > > > > > > As discussed elsewhere, the best solution (IMO) is > > > > ~(CORE_ADDR)0x7 > > You mean ~(ULONGEST)0x7? > > I mean ~(typeof(addr)) 0x7. R.