From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 14261 invoked from network); 22 Jun 1999 13:27:08 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 22 Jun 1999 13:27:08 -0000 Received: from stud3.tuwien.ac.at (stud3.tuwien.ac.at [193.170.75.13]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id IAA15430 for ; Tue, 22 Jun 1999 08:32:41 -0400 Received: from stud3.tuwien.ac.at (stud3.tuwien.ac.at [193.170.75.13]) by stud3.tuwien.ac.at (8.8.6/8.8.6) with ESMTP id OAA15170 for ; Tue, 22 Jun 1999 14:32:39 +0200 (METDST) Date: Tue, 22 Jun 1999 14:32:39 +0200 (METDST) From: Stefan Katzenbeisser To: axp-list@redhat.com Subject: Re: problem with unaligned access on Alpha In-Reply-To: <41256798.003CACD0.00@saturn.aladdin.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 22 Jun 1999, Christian Groessler wrote: > I think it's a compiler bug. It is, see below. > I would expect the "val=READ_WORD()" line to generate an unaligned access > exception, > but this doesn't happen. Instead, only one _byte_ at address xadr is read, > resulting > in val=0xcc. Val is 0xcccc on intel machines. I encountered a similar problem some weeks ago; it's the way egcs generates load-instructions for bytes and shorts: your code results in ldq_u $1,0($2) extwl $1,$2,$1 This can't work if the adress is not aligned (ldq_u loads the quadword statring at $2 with the low three bits cleared...). That's definitively a compiler bug. I solved the problem by upgrading to egcs 1.1.2 Best, Stefan. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- | Stefan Katzenbeisser | e-mail: skatzenbeisser@acm.org | http://stud3.tuwien.ac.at/~e9625414 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Public PGP key available on my homepage or upon request.