The whole "Nintendo forgot to set the O2 optimization flag" thing has been somewhat debunked, or at best it's misleading. ModernVintageGamer did a video discussing the topic that's pretty well-researched ▶ this video To summarize what he says: since the game was a launch title, it was likely being compiled with an early, less-stable compiler/SDKs, with known bugs that wouldn't be fixed until later (he even cited some official developer documentation that mentions this). So setting that flag could have caused known issues/instability at the time so they just left the optimization out. And the other thing is the game is using a lot of libraries that were indeed compiled with the O2 flag, and the performance drop by removing those is far more significant than the tiny gain by adding it to the top-level of the makefile where the rumor suggested it should have been added.
in “Overhauling Mario 64's code to reach 30 FPS and render 6x faster on N64 [video]” · View on HN