svn commit: r241373 - head/lib/libc/stdlib

Andrey Chernov ache at freebsd.org
Tue Oct 9 18:25:01 UTC 2012


On 09.10.2012 21:47, Eitan Adler wrote:
> On 9 October 2012 12:33, Andrey Chernov <ache at freebsd.org> wrote:
>> Do you check assembler output for _both_ cases?
> 
> Yes.
...
> http://blog.eitanadler.com/2012/10/reduced-entropy-in-rand-and-random.html

At this URL I see only already known buggy assembler without 'volatile'
keyword (which is fixed by adding 'volatile' in srandomdev()). As I
already mention, adding 'volatile' helps any gcc and clang finally
generated assembler code (checked by cc -S ...).

What happens with LLVM intermediate code, I mean mentioned by David
call void @srand(i32 undef)
is a big question and perhaps clang bug. Please note that we use
'volatile' a lot in the kernel, just 'grep -r volatile /sys'. Some of
that potentially can hit the same (probably) bug. And, in case it is the
bug, it should be fixed in clang.

> volatile is still undefined: see 5.1.2.2.3 and 6.7.2.4 of ISO9899

I don't have ISO9899 nearby, could you directly quote mentioned
sections, please? Do you against 'volatile' usage at all? It seems whole
kernel (see above) contradicts with such point of view.



More information about the svn-src-head mailing list