From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2841 invoked by alias); 16 Jul 2002 20:21:13 -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 2833 invoked from network); 16 Jul 2002 20:21:13 -0000 Received: from unknown (HELO potter.sfbay.redhat.com) (205.180.83.107) by sources.redhat.com with SMTP; 16 Jul 2002 20:21:13 -0000 Received: from dot.sfbay.redhat.com (dot.sfbay.redhat.com [172.16.24.7]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g6GKLnQ21644; Tue, 16 Jul 2002 13:21:49 -0700 Received: (from rth@localhost) by dot.sfbay.redhat.com (8.11.6/8.11.6) id g6GKL8F05976; Tue, 16 Jul 2002 13:21:08 -0700 X-Authentication-Warning: dot.sfbay.redhat.com: rth set sender to rth@redhat.com using -f Date: Tue, 16 Jul 2002 14:26:00 -0000 From: Richard Henderson To: Randolph Chung Cc: John David Anglin , parisc-linux@parisc-linux.org, gcc@gcc.gnu.org Subject: Re: [parisc-linux] gcc-3.[02] alignment problem Message-ID: <20020716132108.B5966@redhat.com> Mail-Followup-To: Richard Henderson , Randolph Chung , John David Anglin , parisc-linux@parisc-linux.org, gcc@gcc.gnu.org References: <200207161701.g6GH1D03023385@hiauly1.hia.nrc.ca> <20020716172255.GM8724@tausq.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020716172255.GM8724@tausq.org>; from randolph@tausq.org on Tue, Jul 16, 2002 at 10:22:55AM -0700 X-SW-Source: 2002-07/txt/msg00708.txt.bz2 On Tue, Jul 16, 2002 at 10:22:55AM -0700, Randolph Chung wrote: > __u32 tcpdiag_cookie[2]; > #define TCPDIAG_NOCOOKIE (~0U) > }; > > the code goes on to do: > *((struct sock **)&r->id.tcpdiag_cookie) = sk; > and > sk != *((struct sock **)&req->id.tcpdiag_cookie[0])) This is absolutely awful. > the "vomit grade hack" alan mentioned in another post is that in our > tree, we have: > > struct tcpdiag_sockid > { > __u16 tcpdiag_sport; > __u16 tcpdiag_dport; > __u32 tcpdiag_src[4]; > __u32 tcpdiag_dst[4]; > __u32 tcpdiag_if; > #if defined (__hppa__) && defined (__LP64__) > char * parisc_hack_to_align_tcpdiag_cookie; > #endif > __u32 tcpdiag_cookie[2]; An only marginally better fix is __u32 tcpdiag_cookie[2] __attribute__((aligned(sizeof(void*)))); Note that this should be unconditional so that the other 64-bit ports don't take an alignment trap here too. A much nicer fix would be to, gasp, use a union. r~