From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29242 invoked by alias); 28 Nov 2002 10:20:23 -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 29233 invoked from network); 28 Nov 2002 10:20:22 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by sources.redhat.com with SMTP; 28 Nov 2002 10:20:22 -0000 Received: from Hermes.suse.de (Charybdis.suse.de [213.95.15.201]) by Cantor.suse.de (Postfix) with ESMTP id CA42914374; Thu, 28 Nov 2002 11:20:21 +0100 (MET) X-Authentication-Warning: sykes.suse.de: schwab set sender to schwab@suse.de using -f To: Richard.Earnshaw@arm.com Cc: gdb-patches@sources.redhat.com Subject: Re: [rfa?] Add frame_align(); Was: ARM stack alignment on hand called functions References: <200211280926.gAS9QJE06150@pc960.cambridge.arm.com> X-Yow: Could I have a drug overdose? From: Andreas Schwab Date: Thu, 28 Nov 2002 02:20:00 -0000 In-Reply-To: <200211280926.gAS9QJE06150@pc960.cambridge.arm.com> (Richard Earnshaw's message of "Thu, 28 Nov 2002 09:26:19 +0000") Message-ID: User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.3.50 (ia64-suse-linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2002-11/txt/msg00708.txt.bz2 Richard Earnshaw writes: |> > +/* 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. No, -16 is implicitly cast to bfd_vma, which is unsigned, and this operation is completely defined independent of the representation of signed integers. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."