Do not use time(NULL) as a seed, use a deterministic one
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sun, 10 Sep 2006 16:56:45 +0000 (16:56 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sun, 10 Sep 2006 16:56:45 +0000 (16:56 +0000)
ir/be/beschedrand.c

index 8524abb..566f22a 100644 (file)
@@ -53,7 +53,10 @@ static ir_node *random_select(void *block_env, nodeset *ready_set, nodeset *live
 
 static void *random_init_graph(const list_sched_selector_t *vtab, const arch_env_t *arch_env, ir_graph *irg)
 {
-       srand(time(0));
+       /* Using time(NULL) as a seed here gives really random results,
+          but is NOT deterministic which makes debugging impossible.
+          Moreover no-one want non-deterministic compilers ... */
+       srand(0x4711);
        return (void *)arch_env;
 }