Files
BFM-decomp/cookbook/C0415.md
T

1.1 KiB

§374 — A register … __asm__("$30") RESERVATION IS NOT HONOURED BY move_movables (P31 S68; main/func_80015608, 86 ins)

Under ~9-way register pressure at -O2, gcc-2.7.2 free-registers something into $30/$fp AFTER the pin's own assignment, silently corrupting whichever variable loses that fight (observed as y / flags / size / tag / mode2 across configurations). Reproducible. move_movables' invariant-hoist register SELECTION does not consult local register-asm reservations.

THE CORRUPTION IS SILENT — the build succeeds. Audit the raw objdump register uses by hand before trusting a pinned build that "compiles fine".

This is the fourth bound on the pin lever, and together they are a usable rule:

  • §368 — a pin FIGHTS local-alloc when you want a different ALLOCATION (measured worse than none)
  • §373 — a pin WORKS to break a false sched2 ANTI-DEPENDENCE
  • §374 — a pin on $30/$fp is NOT HONOURED at all against move_movables under pressure
  • §375 — a pin on $a0-$a3 has NON-LOCAL effects, backwards, through earlier calls