提交 51bcf092 编写于 作者: B Bob Breuer 提交者: David S. Miller

[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: NBob Breuer <breuerr@mc.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e34efe3b
......@@ -151,7 +151,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
"xnor\t%%g0, %0, %0"
: "=r" (sum), "=&r" (iph)
: "r" (ihl), "1" (iph)
: "g2", "g3", "g4", "cc");
: "g2", "g3", "g4", "cc", "memory");
return sum;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册