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

Marius Strobl marius at
Sat Jun 28 11:24:03 UTC 2008

On Sat, Jun 28, 2008 at 12:09:13PM +1000, Bruce Evans wrote:
> On Sat, 28 Jun 2008, Marius Strobl wrote:
> >On Fri, Jun 27, 2008 at 09:58:31PM +0200, Christoph Mallon wrote:
> >>
> >>This approach seems wrong to me and I think it works only by chance. The
> >
> >I wasn't aware that the clobber list allows to explicitly specify
> >the condition codes, thanks for the hint. Though it unfortunately
> >took me longer than two days to verify it's effect on the generated
> >code; sparc64 could still have been one of the archs where "cc" has
> >no effect.
> I think it still only works by chance.
> >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.


More information about the cvs-src mailing list