Skip to content

Commit

Permalink
[SPARC32]: Fix over-optimization by GCC near ip_fast_csum.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bob Breuer authored and David S. Miller committed Feb 2, 2007
1 parent e34efe3 commit 51bcf09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/asm-sparc/checksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 51bcf09

Please sign in to comment.