From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2401 invoked by alias); 2 Aug 2005 21:30:00 -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 2324 invoked by uid 22791); 2 Aug 2005 21:29:50 -0000 Received: from mail-out4.apple.com (HELO mail-out4.apple.com) (17.254.13.23) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 02 Aug 2005 21:29:50 +0000 Received: from mailgate2.apple.com (a17-128-100-204.apple.com [17.128.100.204]) by mail-out4.apple.com (8.12.11/8.12.11) with ESMTP id j72LTmFk007523 for ; Tue, 2 Aug 2005 14:29:48 -0700 (PDT) Received: from relay4.apple.com (relay4.apple.com) by mailgate2.apple.com (Content Technologies SMTPRS 4.3.17) with ESMTP id ; Tue, 2 Aug 2005 14:29:48 -0700 Received: from [17.201.24.155] (mrs.apple.com [17.201.24.155]) by relay4.apple.com (8.12.11/8.12.11) with ESMTP id j72LTj7E021354; Tue, 2 Aug 2005 14:29:46 -0700 (PDT) In-Reply-To: References: <200508022037.j72Kbr4T012558@earth.phy.uc.edu> Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <4AE0FF52-B95D-40D7-B49E-831534AD3CC8@apple.com> Cc: Andrew Pinski , dave.korn@artimi.com (Dave Korn), pkoning@equallogic.com (Paul Koning), gcc@sources.redhat.com, sjackman@gmail.com (Shaun Jackman) Content-Transfer-Encoding: 7bit From: Mike Stump Subject: Re: memcpy to an unaligned address Date: Tue, 02 Aug 2005 21:30:00 -0000 To: Ian Lance Taylor X-SW-Source: 2005-08/txt/msg00090.txt.bz2 On Aug 2, 2005, at 1:45 PM, Ian Lance Taylor wrote: > That argument doesn't make sense to me. memcpy takes a void* > argument, which has no presumed alignment. The memcpy builtin uses the static type of the actual argument (before conversion to void*), to gain hints about the alignments of the data coming in. This is so that we can producing nice fast code for 1-16 bytes objects. This is actually good. The real problem is formation of the address of the member doesn't produce a pointer to unaligned type, but rather a pointer to aligned type, this is the part that is wrong. We'd have to add pointers to unaligned data to our type system to fix it. That should be done, but is a hard/big job, and no one has stepped forward to do it.