IUCompilerCourse / Essentials-of-Compilation

A book about compiling Racket and Python to x86-64 assembly
1.27k stars 137 forks source link

GlobalValue treated as complex in Figure 7.15 (Python Version) #160

Open waynee95 opened 1 year ago

waynee95 commented 1 year ago

Related to #146.

In Figure 7.15 the output of explicate_control is outdated:

start:
init.514 = 42
tmp.517 = free_ptr
tmp.518 = (tmp.517 + 16)
tmp.519 = fromspace_end
if tmp.518 < tmp.519:
  goto block.529
else:
  goto block.530

Here, GlobalValue is not treated as atomic.

The example should look like this instead:

start:
init.514 = 42
tmp.517 = (free_ptr + 16)
if tmp.517 < fromspace_end:
  goto block.529
else:
  goto block.530