From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27512 invoked by alias); 5 Feb 2006 21:02:25 -0000 Received: (qmail 27503 invoked by uid 22791); 5 Feb 2006 21:02:25 -0000 X-Spam-Check-By: sourceware.org Received: from igw2.watson.ibm.com (HELO igw2.watson.ibm.com) (129.34.20.6) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 05 Feb 2006 21:02:23 +0000 Received: from sp1n294en1.watson.ibm.com (sp1n294en1.watson.ibm.com [129.34.20.40]) by igw2.watson.ibm.com (8.12.11/8.13.1/8.13.1-2005-04-25 igw) with ESMTP id k15L2KLF012180; Sun, 5 Feb 2006 16:02:24 -0500 Received: from sp1n294en1.watson.ibm.com (localhost [127.0.0.1]) by sp1n294en1.watson.ibm.com (8.11.7-20030924/8.11.7/01-14-2004_2) with ESMTP id k15L2F5373182; Sun, 5 Feb 2006 16:02:15 -0500 Received: from mgsmtp00.watson.ibm.com (mgsmtp00.watson.ibm.com [9.2.40.58]) by sp1n294en1.watson.ibm.com (8.11.7-20030924/8.11.7/01-14-2004_1) with ESMTP id k15L2EG160526; Sun, 5 Feb 2006 16:02:14 -0500 Received: from makai.watson.ibm.com (makai.watson.ibm.com [9.2.216.144]) by mgsmtp00.watson.ibm.com (8.12.11/8.12.11/2005/09/01) with ESMTP id k15M192G006970; Sun, 5 Feb 2006 17:01:09 -0500 Received: from watson.ibm.com (localhost [127.0.0.1]) by makai.watson.ibm.com (AIX5.1/8.11.6p2/8.11.0/03-06-2002) with ESMTP id k15L2BD28758; Sun, 5 Feb 2006 16:02:12 -0500 Message-Id: <200602052102.k15L2BD28758@makai.watson.ibm.com> To: "John Yates" cc: "Yaro Pollak" , gcc-help@gcc.gnu.org Subject: Re: Unaligned access to packed structs on ppc405 In-Reply-To: Message from "John Yates" of "Sun, 05 Feb 2006 13:35:51 EST." <4D87F853B8020F4888896B1507DC0F09026798@mail2.netezza.com> References: <4D87F853B8020F4888896B1507DC0F09026798@mail2.netezza.com> Date: Sun, 05 Feb 2006 21:02:00 -0000 From: David Edelsohn 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-02/txt/msg00045.txt.bz2 >>>>> John Yates writes: John> Do I read this correctly? Are you truly saying that two structs John> with identical layout will trigger different code sequences just John> because one was declared packed? Yes. Why is that strange? attribute packed assigns the smallest possible alignment so that the compiler composes the layout of the structure or bitfield in the more compact form possible. Even if the layout produced is the same, the smaller alignment is carried around with the fields and causes the compiler to use more conservative access operations. David