cvs commit: src/sys/sparc64/include in_cksum.h

Bruce Evans brde at optusnet.com.au
Sun Jun 29 04:07:25 UTC 2008


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


More information about the cvs-src mailing list