From owner-freebsd-alpha Wed Mar 7 13:43:37 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id 08D1B37B71A for ; Wed, 7 Mar 2001 13:43:33 -0800 (PST) (envelope-from jeremyp@gsmx07.alcatel.com.au) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id IAA24440; Thu, 8 Mar 2001 08:43:17 +1100 (EDT) Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au (PMDF V5.2-32 #37640) with ESMTP id <01K0Y51YBDUOOZ2UCJ@cim.alcatel.com.au>; Thu, 8 Mar 2001 08:43:14 +1100 Received: (from jeremyp@localhost) by gsmx07.alcatel.com.au (8.11.1/8.11.1) id f27LhC925338; Thu, 08 Mar 2001 08:43:12 +1100 (EST envelope-from jeremyp) Content-return: prohibited Date: Thu, 08 Mar 2001 08:43:11 +1100 From: Peter Jeremy Subject: Re: Strange results from compiled alpha code In-reply-to: <200103061011.UAA24786@gw.one.com.au>; from raymond@one.com.au on Tue, Mar 06, 2001 at 08:11:00PM +1000 To: User Raymond Cc: freebsd-alpha@FreeBSD.ORG Mail-Followup-To: User Raymond , freebsd-alpha@FreeBSD.ORG Message-id: <20010308084311.A17181@gsmx07.alcatel.com.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.5i References: <200103061011.UAA24786@gw.one.com.au> Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 2001-Mar-06 20:11:00 +1000, User Raymond wrote: >Tony Griffiths wrote: >> In the case you give below, the 'short len' is misaligned on an odd byte >> boundary. This might be the cause of the problem... I suspect that gcc is ignoring the low bit of the address when loading the short. The Compaq CC masks the address so as to create an alignment fault in this case. >> I know that with DEC/Compaq cc there is a #pragma and also a >> compiler switch to assume_unaligned pointers for cases like this. ... >> I don't know that the [g]cc equivalent switch is but presume that >> there is one! Actually, there doesn't appear to be one. >> Alternatively, change the code slightly to ensure that the 'mumpspc' pointer >> is always incremented by an even number of bytes. eg. >> >> mumpspc += ( ((cstring*)mumpspc)->len + sizeof(short) + 2 ) & ~1; /* bump pc If you can't guarantee alignment, then your other option is to totally avoid the use of CSTRING and use code like (assuming little-endian data): short len = mumpspc[0] | (mumpspc[1] << 8); mumpspc = mumpspc + len + sizeof(short) + 1; > I have a few spare alphas and my customers have more of them. Does this mean they're now surplus and about to be disposed of? :-) Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message