From owner-freebsd-arch@FreeBSD.ORG Sat Feb 4 23:00:10 2006 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D47B316A420 for ; Sat, 4 Feb 2006 23:00:10 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 414C743D45 for ; Sat, 4 Feb 2006 23:00:10 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id k14MwrGe017491; Sat, 4 Feb 2006 15:58:53 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 04 Feb 2006 15:58:56 -0700 (MST) Message-Id: <20060204.155856.39766510.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <86fymyn5il.fsf@xps.des.no> References: <20060204211357.GD7604@ip.net.ua> <20060204.143353.109955782.imp@bsdimp.com> <86fymyn5il.fsf@xps.des.no> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sat, 04 Feb 2006 15:58:54 -0700 (MST) Cc: arch@FreeBSD.org Subject: Re: [releng_6 tinderbox] failure on sparc64/sparc64 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2006 23:00:10 -0000 In message: <86fymyn5il.fsf@xps.des.no> des@des.no (Dag-Erling Sm=F8rgrav) writes: : "M. Warner Losh" writes: : > Ruslan Ermilov writes: : > > I mean, I don't see a reason not to remove -fno-strict-aliasing : > > from the kernel builds now. Perhaps it's still needed for some : > > platforms that aren't covered by tinderbox, not sure... Can be : > > easily checked with "make universe". : = : First of all, the kernel Makefiles contain a hack which force : -fno-strict-aliasing whether you want it or not. : = : Second, the kernel will *not* build without -fno-strict-aliasing, : partly because of preexisting aliasing violations and partly because : of aliasing violations which were introduced after the hack (and coul= d : have been avoided if that hack had not been in place). : = : > There's a dozen or two files that will fail to compile -O2 w/o it : > spread through the tree. : = : not throughout the tree - only in the kernel. That's what I ment. I've made some changes. Some of which I'm pretty sure of, the other I'm less sure of. I've made the following changes: imp 2006-02-04 22:51:03 UTC FreeBSD src repository Modified files: sys/dev/an if_an.c = Log: Silence the strict-alias warnings. Make a trip through (void *) when= casting a structure to a uint32_t *. Many drivers in the tree do thi= s, but I'll not update them until these changes can be reviewed by the pedan= tic standards folks. = Revision Changes Path 1.78 +16 -16 src/sys/dev/an/if_an.c http://cvsweb.FreeBSD.ORG/src/sys/dev/an/if_an.c This driver wants to access these structures as arrays of uint32_t. It used to cast directly, but that isn't allowed. So, I've passed the cast through a (void *). Is that allowed? Eg: struct foo foo; ((uint32_t *)(void *)&foo)[3] =3D 12; is that OK? Warner