|
|
|
|
|
by tom_mellior
2210 days ago
|
|
> Sometimes the compiler needs to generate a random value and base part of the compilation on that value. As a compiler engineer with experience (among others) in LLVM and GCC this is the first time I'm hearing of this. Could you provide more details or a source? I can't imagine where such behavior would be useful, let alone required. The only slightly plausible scenario I can think of would be representing some internal data structures as hash tables with random seeds to avoid denial-of-service attacks. But then the compiled code would still have to rely on, at some point, picking an arbitrary element out of such a hash table. I can't think of contexts inside a compiler where this would be a useful thing to do. |
|
-frandom-seed=string
though my example/guess on branch prediction is probably wrong