From owner-freebsd-arch@FreeBSD.ORG Tue Sep 18 23:30:09 2012 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 312F1106566C for ; Tue, 18 Sep 2012 23:30:04 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE208FC0A for ; Tue, 18 Sep 2012 23:30:04 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id q8INU2cB026080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 Sep 2012 16:30:02 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id q8INU21Q026079; Tue, 18 Sep 2012 16:30:02 -0700 (PDT) (envelope-from jmg) Date: Tue, 18 Sep 2012 16:30:02 -0700 From: John-Mark Gurney To: Poul-Henning Kamp Message-ID: <20120918233002.GE19036@funkthat.com> Mail-Followup-To: Poul-Henning Kamp , arch@freebsd.org References: <95608.1347973160@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95608.1347973160@critter.freebsd.dk> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 18 Sep 2012 16:30:03 -0700 (PDT) Cc: arch@freebsd.org Subject: Re: Aliasing issue with TAILQ on ppc64 ? 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: Tue, 18 Sep 2012 23:30:09 -0000 Poul-Henning Kamp wrote this message on Tue, Sep 18, 2012 at 12:59 +0000: > It may be a good idea to find some way to make sure the compiler > spots the potential aliasing, but I am not sufficiently up to > date on compiler optimizations to know a safe and reliable way > to do that. (Would explicitly casting throuh a void do it ?) Try casting the access through a char pointer. The C99 spec states that you can only access an object through a pointer that is type compatible, or through a char type, though, it isn't clear that from the C99 spec that casting through a char type is enough to break the aliasing... I'm waiting for an answer from a friend who knows this much better than myself... The relevant part of the C99 standard is section 6.5, paragraphs 6 & 7... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."