From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28757 invoked by alias); 30 Jan 2006 12:03:01 -0000 Received: (qmail 28749 invoked by uid 22791); 30 Jan 2006 12:03:01 -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 12:02:58 +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 <0ITW0046JMSV7N10@mxout5.netvision.net.il> for gcc-help@gcc.gnu.org; Mon, 30 Jan 2006 14:02:55 +0200 (IST) Date: Mon, 30 Jan 2006 12:03:00 -0000 From: Yaro Pollak Subject: Re: Unaligned access to packed structs on ppc405 In-reply-to: <200601291716.k0THGPD31684@makai.watson.ibm.com> To: David Edelsohn Cc: gcc-help@gcc.gnu.org Message-id: <43DE006E.2040803@altair-semi.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <200601291716.k0THGPD31684@makai.watson.ibm.com> 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/msg00235.txt.bz2 David Edelsohn wrote: >>>>>>Yaro Pollak writes: >>>>>> >>>>>> > > > >>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. >> >> > > What does "|-mstrict-align" mean? -mstrict-align means "do not >assume that unaligned accesses are handled by the system." You are >requesting that the compiler assume the target requires strict alignment >and then questioning why it is accessing a packed bit-struct assuming the >least alignment. > >David > > > Yes, I actually couldn't tell whether I should use -mno-strict-align or -mstrict-align from the explanation in GCC documentation (thank you for your explanation) so I tried both, but it didn't matter at all. I guess I should have mentioned that before. Perhaps any other ideas? I feel it is something fundamental that I keep missing. Yaro