50% of packets lost only on local interfaces

Peter Jeremy PeterJeremy at optushome.com.au
Tue Feb 8 01:23:10 PST 2005


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


More information about the freebsd-stable mailing list