Date: Tue, 8 Feb 2005 20:22:38 +1100 From: Peter Jeremy <PeterJeremy@optushome.com.au> To: Jon Noack <noackjr@alumni.rice.edu> Cc: freebsd-stable@freebsd.org Subject: Re: 50% of packets lost only on local interfaces Message-ID: <20050208092238.GC57256@cirb503493.alcatel.com.au> In-Reply-To: <4207F443.8020400@alumni.rice.edu> References: <42073FD8.5CCA7EC5@fadesa.es> <20050207102140.GA56842@xor.obsecurity.org> <42074353.9E3EECBE@fadesa.es> <4207C5C7.80707@alumni.rice.edu> <4207DEEA.E7278E38@fadesa.es> <4207F443.8020400@alumni.rice.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2005-Feb-07 17:05:39 -0600, Jon Noack wrote: >José M. Fandiño wrote: >>Jon Noack wrote: >>>>>> Finally, I found the culprit: >>>>>> >>>>>>CFLAGS="" \ 100% of the transmited traffic is received >>>>>>COPTFLAGS="" / >>>>>> >>>>>>CFLAGS= -pipe \ 50% of the transmited traffic is received >>>>>>COPTFLAGS= -pipe / It would be quite interesting to compare the actual commands that are generated: Capture the buildworld/kernel output and compare the same command in both cases. If the only difference is really just "-pipe", then we need to do some more investigating. >The explanation I've heard (I have no actual knowledge here, I'm just >good at repeating others) is that gcc doesn't compile any ASM with -O0 >(which is what you get with CFLAGS="-pipe"). This Breaks Things(tm): There used to be inconsistencies in the way gcc handle asm() statements so that it could be difficult to write asm() statement constraints that worked correctly with both -O0, -O1 and -O2 but it never ignored asm() statements. (I haven't looked since about 2.95 so I'm not sure if the 3.x series fixed this problem) >http://docs.freebsd.org/cgi/mid.cgi?20020623214947.J84322 The error message quoted in this article refers to the constraint problem above. The problem was not asm() was being ignored (or that incorrect code was generated) but that the compiler incorrectly reported errors (and failed to compile the code). (I recognize that function name - I spent weeks trying to come up with a constraint set that worked with both -O0 and -O1 and eventually gave up). Since you have managed to compile a kernel, I very much doubt you are running into the same problem. >kern/52764 is another example: >http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/52764 Again, this is a "fails to compile" report, not a "generates incorrect code" report. The code in question was written on the assumption that the compiler would do dead code removal and "gcc -O0" doesn't. >More generically it makes sense that gcc treat code differently with -O0 >than with -O. By definition, it has to - otherwise the generated code would be the same. -- Peter Jeremy
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050208092238.GC57256>