On Fri, Oct 17, 2008 at 2:06 PM, Joern Nettingsmeier
wrote:
They are not equivalent. The first version modifies rb->readptr
twice; the second version modifies once. I can't say with any
certainty that that fixes the problem, but it makes me feel better
(and happens to pass this test).
There's no chance that a compiler optimization is hiding the bug,
because we haven't turned on optimization. HOWEVER, if you go back
to the original version and REMOVE the volatile qualifiers, then
re-compile with -O2, NOW a compiler optimization is hiding the bug
(and the test passes)! The rb->read_ptr is presumably cached in a
register and hence only modified once (giving the same affect as the
patch).
Now THAT's interesting...
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user
LINUX® is a registered trademark of Linus Torvalds in the USA and other countries.
Linuxaudio.org logo copyright Thorsten Wilms © 2006.
Hosting provided by the Virginia Tech Department of Music and DISIS.