From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19836 invoked by alias); 28 Nov 2002 16:45:26 -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 19823 invoked from network); 28 Nov 2002 16:45:22 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 28 Nov 2002 16:45:22 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id DECE73F30; Thu, 28 Nov 2002 11:45:17 -0500 (EST) Message-ID: <3DE6481D.9060308@redhat.com> Date: Thu, 28 Nov 2002 08:45:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Richard.Earnshaw@arm.com Cc: Kris Warkentin , gdb-patches@sources.redhat.com Subject: Re: [rfa?] Add frame_align(); Was: ARM stack alignment on hand called functions References: <200211281632.gASGWtT29673@pc960.cambridge.arm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-11/txt/msg00716.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?