From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29515 invoked by alias); 30 Jan 2006 16:26:59 -0000 Received: (qmail 29507 invoked by uid 22791); 30 Jan 2006 16:26:58 -0000 X-Spam-Check-By: sourceware.org Received: from mxout5.netvision.net.il (HELO mxout5.netvision.net.il) (194.90.9.29) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 30 Jan 2006 16:26:56 +0000 Received: from [192.168.0.202] ([217.132.241.245]) by mxout5.netvision.net.il (Sun Java System Messaging Server 6.1 HotFix 0.11 (built Jan 28 2005)) with ESMTPA id <0ITW005APZ0SY120@mxout5.netvision.net.il> for gcc-help@gcc.gnu.org; Mon, 30 Jan 2006 18:26:53 +0200 (IST) Date: Mon, 30 Jan 2006 16:26:00 -0000 From: Yaro Pollak Subject: Re: Unaligned access to packed structs on ppc405 In-reply-to: <20060130161852.1qy3zcccg040ss84@webmail.vw1600e.org.uk> To: Matthew Jones Cc: gcc-help@gcc.gnu.org Message-id: <43DE3E4C.5040803@altair-semi.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <20060130161852.1qy3zcccg040ss84@webmail.vw1600e.org.uk> User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-01/txt/msg00247.txt.bz2 Matthew Jones wrote: >>From: Yaro Pollak >> >>Greetings, >>I am cross-compiling on GCC 3.4.1 for the PowerPC 405, >>which can handle unaligned accesses in hardware. >>Whenever I am accessing members of a packed bit-struct by >>pointer, the compiler produces byte accesses, instead of >>4-byte acceses. I've tried to use |-mstrict-align but to >>no avail. Am I doing something wrong? >> >> > >Are you sure it is the compiler? Are you looking at the generated >assembler, or inferring this from a logic analyser? If its the >second case, it could be the uP rather than gcc. > > > I'm sorry I failed to mention that as well, but I am in fact looking at the generated assembler, vs. the assembler generated when I am accessing the members of the struct directly (not through a pointer). Yaro