From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2002 invoked by alias); 5 Aug 2005 16:09:46 -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 1955 invoked by uid 22791); 5 Aug 2005 16:09:40 -0000 Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.198) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 05 Aug 2005 16:09:40 +0000 Received: by rproxy.gmail.com with SMTP id a36so718253rnf for ; Fri, 05 Aug 2005 09:09:39 -0700 (PDT) Received: by 10.11.99.74 with SMTP id w74mr27129cwb; Fri, 05 Aug 2005 09:09:38 -0700 (PDT) Received: by 10.11.99.47 with HTTP; Fri, 5 Aug 2005 09:09:38 -0700 (PDT) Message-ID: <7f45d939050805090960ce261@mail.gmail.com> Date: Fri, 05 Aug 2005 16:09:00 -0000 From: Shaun Jackman Reply-To: Shaun Jackman To: Carl Whitwell Subject: Re: memcpy to an unaligned address Cc: gcc@gcc.gnu.org In-Reply-To: <345be69105080501405eb8663e@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <345be691050804025955c0b4ab@mail.gmail.com> <7f45d93905080408053411888b@mail.gmail.com> <345be69105080501405eb8663e@mail.gmail.com> X-SW-Source: 2005-08/txt/msg00174.txt.bz2 On 8/5/05, Carl Whitwell wrote: > On 8/4/05, Shaun Jackman wrote: > > Are you using an x86 host and an arm target? >=20 > Actually no, my major concern at the time was the large quantity of > legacy code with packed structures that we have on an embedded linux > x86 system. I was just testing that we didn't have an issue there with > the structure access. The x86 includes hardware to fetch a word from an unaligned address by fetching from two aligned address and shifting and combining to produce the correct result. So, unaligned accesses on the x86 might effect a slight performance hit, but they will still act correctly. The ARM on the other hand does not include such hardware, so a load instruction fetching from an unaligned address will behave incorrectly. My primary concern is really just code correctness. Cheers, Shaun