Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Jun 2008 14:07:17 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Marius Strobl <marius@alchemy.franken.de>
Cc:        cvs-src@freebsd.org, Christoph Mallon <christoph.mallon@gmx.de>, src-committers@freebsd.org, cvs-all@freebsd.org, Bruce Evans <brde@optusnet.com.au>
Subject:   Re: cvs commit: src/sys/sparc64/include in_cksum.h
Message-ID:  <20080629140037.H92490@delplex.bde.org>
In-Reply-To: <20080628112358.GK1215@alchemy.franken.de>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080629140037.H92490>