From owner-cvs-src@FreeBSD.ORG Sun Jun 29 04:07:24 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 EFFF5106564A; Sun, 29 Jun 2008 04:07:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 74A4E8FC1D; Sun, 29 Jun 2008 04:07:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c220-239-252-11.carlnfd3.nsw.optusnet.com.au (c220-239-252-11.carlnfd3.nsw.optusnet.com.au [220.239.252.11]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m5T47HUw022546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 29 Jun 2008 14:07:18 +1000 Date: Sun, 29 Jun 2008 14:07:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Marius Strobl In-Reply-To: <20080628112358.GK1215@alchemy.franken.de> Message-ID: <20080629140037.H92490@delplex.bde.org> References: <200806252105.m5PL5AUp064418@repoman.freebsd.org> <48654667.1040401@gmx.de> <20080627222404.GJ1215@alchemy.franken.de> <20080628120700.S89039@delplex.bde.org> <20080628112358.GK1215@alchemy.franken.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@freebsd.org, Christoph Mallon , src-committers@freebsd.org, cvs-all@freebsd.org, Bruce Evans 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: Sun, 29 Jun 2008 04:07:25 -0000 On Sat, 28 Jun 2008, Marius Strobl wrote: > On Sat, Jun 28, 2008 at 12:09:13PM +1000, Bruce Evans wrote: >> On Sat, 28 Jun 2008, Marius Strobl wrote: >> I think it still only works by chance. [volatile] >> >>> Besides I don't think using "__volatile" for this is >>> that wrong, given that the sparc64 code generated by using "cc" >>> and "__volatile" is nearly identical and given that at least i386 >>> relies on "__volatile" telling GCC that the inline assembler uses >>> the condition codes since quite some time. So the condition codes >>> are probably part of what GCC treats as "important side-effects". >> >> No, the comments in the i386 version are rotted bits left over from >> old failing attempts to fix this problem. > > So by now you are saying that using "__volatile" in this case > is the wrong solution and that using "cc" is a style bug. How > am I supposed to tell the compiler that the inline assembler > alters the condition codes then, which it apparently needs to > know as it at shown to otherwise generate broken code even > when using a single __asm() for the istructions. Using volatile is wrong in this and most cases. Use "cc" when it isn't a style bug :-). I guess this is on some CPUs including sparc64 now, and in all new asms on i386. Bruce