From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30086 invoked by alias); 27 Apr 2002 08:08:13 -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 30051 invoked from network); 27 Apr 2002 08:08:12 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 27 Apr 2002 08:08:12 -0000 Received: from romulus.sfbay.redhat.com (romulus.sfbay.redhat.com [172.16.27.251]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id BAA15184; Sat, 27 Apr 2002 01:08:11 -0700 (PDT) Received: (from kev@localhost) by romulus.sfbay.redhat.com (8.11.6/8.11.6) id g3R889Q32702; Sat, 27 Apr 2002 01:08:09 -0700 Date: Sat, 27 Apr 2002 01:08:00 -0000 From: Kevin Buettner Message-Id: <1020427080809.ZM32701@localhost.localdomain> In-Reply-To: Elena Zannoni "Re: [RFA] Altivec ABI patches" (Apr 26, 9:44pm) References: <15561.48188.141526.557982@localhost.redhat.com> <1020426230236.ZM31350@localhost.localdomain> <15562.646.506619.140778@localhost.redhat.com> To: Elena Zannoni , Kevin Buettner Subject: Re: [RFA] Altivec ABI patches Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-04/txt/msg01101.txt.bz2 On Apr 26, 9:44pm, Elena Zannoni wrote: > > Note that the subsequent memcpy() ends up overwriting the memory > > zero'd by the assignment. If the assignment does serve some useful > > purpose, I'd prefer to see memset() used instead. > > > > It does seem odd, I actually just cut and pasted the code from a few > lines above. I thought there was some reason for it, after all. > > { > *(int *) ®isters[REGISTER_BYTE (greg)] = 0; > memcpy (®isters[REGISTER_BYTE (greg)], val_buf, 4); > greg++; > } > > Should this go as well, then? Yes, definitely. As written, this code could yield some very unexpected results on certain hosts. Thanks for pointing this out. This is very likely a mistake that I made a while back. > Unless it always writes 4 bytes, but the > size of the general register can be bigger? Well, the code in question doesn't work for 64-bit ABIs, but then, as I understand it, the 64-bit PowerPC SVR4 ABI resembles the old PowerOpen ABI than it does the 32-bit SVR4 ABI. (Actually, I don't know that much about it. If someone could give me a pointer to an ABI spec for the 64-bit ABI, I would appreciate it very much.) Kevin