HomeFreeBSD

Use "__asm __volatile" rather than "__asm" for instruction sequences
rS180011Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

Use "asm volatile" rather than "asm" for instruction sequences
that modify condition codes (the carry bit, in this case). Without
"
volatile", the compiler might add the inline assembler instructions
between unrelated code which also uses condition codes, modifying the
latter.
This prevents the TCP pseudo header checksum calculation done in
tcp_output() from having effects on other conditions when compiled
with GCC 4.2.1 at "-O2" and "options INET6" left out. [1]

Reported & tested by: Boris Kochergin [1]
MFC after: 3 days

Details

Provenance
mariusAuthored on
Parents
rS180010: Given that sun4u uses sparc64/sparc64/in_cksum.c, use the sparc64
Branches
Unknown
Tags
Unknown

Event Timeline