From owner-cvs-src@FreeBSD.ORG Sat Jun 28 13:35:36 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3301106568C for ; Sat, 28 Jun 2008 13:35:36 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 293838FC1D for ; Sat, 28 Jun 2008 13:35:35 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 28 Jun 2008 13:35:34 -0000 Received: from p54A3DE64.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.222.100] by mail.gmx.net (mp009) with SMTP; 28 Jun 2008 15:35:34 +0200 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1+A6cwdvQCARXAYK6USQAnSoz2jSgyQbtTqQ5Jpig cxsk8dNbSvxJzp Message-ID: <48663E25.9080703@gmx.de> Date: Sat, 28 Jun 2008 15:35:33 +0200 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.9 (X11/20071230) MIME-Version: 1.0 To: Marius Strobl References: <200806272217.m5RMHTd7006079@repoman.freebsd.org> <48657008.4010504@gmx.de> <20080628125241.GN1215@alchemy.franken.de> In-Reply-To: <20080628125241.GN1215@alchemy.franken.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sparc64/include in_cksum.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jun 2008 13:35:36 -0000 Marius Strobl wrote: > On Sat, Jun 28, 2008 at 12:56:08AM +0200, Christoph Mallon wrote: >> Marius Strobl wrote: >>> marius 2008-06-27 22:17:14 UTC >>> >>> FreeBSD src repository >>> >>> Modified files: >>> sys/sparc64/include in_cksum.h >>> Log: >>> SVN rev 180073 on 2008-06-27 22:17:14Z by marius >>> >>> Improve r180011 by explicitly adding the condition codes to the >>> clobber list. >> You should remove the volatile specifier. For example volatile prevents >> common subexpression elimination and other types of optimisations. >> > > I had to adjust the constraint strings in this source file > twice now in order to keep GCC from generating broken code, > thus I prefer to be conservative by using a slightly bigger > hammer and leave the "__volatile" in in order to keep these > kind of problems from coming back to haunt us over and over > again. Especially when it comes to something as vaguely > ("important side-effects", "access memory in an unpredictable > fashion", etc) documented as the GCC assembler constraints > and thus hard to get right without studying the GCC source > and maybe requiring "__volatile" in the future anyway. volatile is for stuff, which cannot be expressed as data dependencies in the constraints, like writing to a machine status register of the CPU, accessing memory mapped hardware registers, which triggers something, stuff like that. The code in question only does some adds and shifts on registers, which is harmless and covered by the data dependecies of the input/output/clobber constraints. volatile is simply the wrong hammer. Regards Christoph