From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30394 invoked by alias); 3 Aug 2005 18:19:12 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 30383 invoked by uid 22791); 3 Aug 2005 18:19:08 -0000 Received: from host217-40-213-68.in-addr.btopenworld.com (HELO SERRANO.CAM.ARTIMI.COM) (217.40.213.68) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 03 Aug 2005 18:19:08 +0000 Received: from mace ([192.168.1.25]) by SERRANO.CAM.ARTIMI.COM with Microsoft SMTPSVC(6.0.3790.1830); Wed, 3 Aug 2005 19:19:17 +0100 From: "Dave Korn" To: "'Shaun Jackman'" , "'Richard Henderson'" Cc: "'Ian Lance Taylor'" , "'Andrew Pinski'" , "'Mike Stump'" , "'Paul Koning'" , Subject: RE: memcpy to an unaligned address Date: Wed, 03 Aug 2005 18:19:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In-Reply-To: <7f45d93905080311152d530172@mail.gmail.com> Message-ID: X-SW-Source: 2005-08/txt/msg00125.txt.bz2 ----Original Message---- >From: Shaun Jackman >Sent: 03 August 2005 19:15 > On 8/3/05, Richard Henderson wrote: >> It is nevertheless correct. Examine all of the parts of the expression. >> >> In particular, "&s->b". What type does it have? In an ideal world, it >> would be "pointer to unaligned integer". But we have no such type in >> our type system, so it is "pointer to integer". This expression is ONLY >> THEN passed to memcpy. At which point we query the argument for its >> alignment, and get the non-intuitive result. >> >> If you instead pass "s" to memcpy, you should get the correct unaligned >> copy. If that isn't happening, that's a bug. > > I'm not sure I understood the last line. s is a structure, Not if "&s->b" makes any sense it isn't! cheers, DaveK -- Can't think of a witty .sigline today....