]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
SPARC32: Fix over-optimization by GCC near ip_fast_csum.
authorBob Breuer <breuerr@mc.net>
Wed, 14 Feb 2007 08:22:53 +0000 (09:22 +0100)
committerAdrian Bunk <bunk@stusta.de>
Wed, 14 Feb 2007 08:22:53 +0000 (09:22 +0100)
In some cases such as:
        iph->check = 0;
        iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
GCC may optimize out the previous store.

Observed as a failure of NFS over udp (bad checksums on ip fragments)
when compiled with GCC 3.4.2.

Signed-off-by: Bob Breuer <breuerr@mc.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
include/asm-sparc/checksum.h

index 286158108974b78689eeceb9a2ab8d4eff622618..acde719e00174c7050d4a0c624c58154d6b5be26 100644 (file)
@@ -159,7 +159,7 @@ static inline unsigned short ip_fast_csum(const unsigned char *iph,
                             "xnor\t%%g0, %0, %0"
                             : "=r" (sum), "=&r" (iph)
                             : "r" (ihl), "1" (iph)
-                            : "g2", "g3", "g4", "cc");
+                            : "g2", "g3", "g4", "cc", "memory");
        return sum;
 }