mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 10:23:46 +00:00
Estimated hours taken: 3
Fix a bug that broke Tom's implementation of a random number generator at -O6.
The bug appeared only if value numbering is run for a second time after most
other low-level optimizations have been repeated several times. The problem
was that the first invocation of value numbering introduces a temp variable,
and the second one deletes the assignment to the temp variable because an
if_val with a liveness annotation comes between this assignment and the
first use of the temp variable.
compiler/livemap.m:
When an if_val is preceded by a livevals annotation,
do not replace the current liveness with the contents
of the annotation. Instead, just include the contents
of the annotation in the current set of live lvals.
tests/hard_coded/rnd.{m,exp}:
Tom's test case.
tests/hard_coded/Mmakefile:
Always run Tom's test case at -O6.
11 lines
29 B
Plaintext
11 lines
29 B
Plaintext
7
|
|
90
|
|
14
|
|
83
|
|
68
|
|
41
|
|
16
|
|
58
|
|
66
|
|
97
|