diff options
author | Bob Breuer <breuerr@mc.net> | 2007-02-01 23:24:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-02-01 23:24:35 -0500 |
commit | 51bcf092917bfaa88d762879d0bbfe7619e8c16c (patch) | |
tree | 637ebcb8992b5358d142b8400fce25f5f82f0bcc | |
parent | e34efe3b100d0fbdf053128956c3dd0bc68754d6 (diff) |
[SPARC32]: Fix over-optimization by GCC near ip_fast_csum.
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>
-rw-r--r-- | include/asm-sparc/checksum.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asm-sparc/checksum.h b/include/asm-sparc/checksum.h index 267e631e9bbc..34518ea7bf1b 100644 --- a/include/asm-sparc/checksum.h +++ b/include/asm-sparc/checksum.h | |||
@@ -151,7 +151,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) | |||
151 | "xnor\t%%g0, %0, %0" | 151 | "xnor\t%%g0, %0, %0" |
152 | : "=r" (sum), "=&r" (iph) | 152 | : "=r" (sum), "=&r" (iph) |
153 | : "r" (ihl), "1" (iph) | 153 | : "r" (ihl), "1" (iph) |
154 | : "g2", "g3", "g4", "cc"); | 154 | : "g2", "g3", "g4", "cc", "memory"); |
155 | return sum; | 155 | return sum; |
156 | } | 156 | } |
157 | 157 | ||