Emulator Issues #9751
Rust's MIR Backend produces code that Dolphin's JIT can't handle
The Legend of Zelda: The Wind Waker
Game ID? (right click the game in the game list, properties, info tab)
MD5 Hash? (right click the game in the game list, properties, info tab, MD5 Hash: Compute)
What's the problem? Describe what went wrong.
I'm writing Rom Hacks for Wind Waker in Rust and recently updated my compiler to a new Nightly Compiler. The newer versions of Rust use a new intermediate representation called MIR. It turns out that Dolphin's JIT compiler often can't handle the code produced by MIR. I thought it might be because of bugs in MIR, but it turns out that Interpreter Mode works totally fine. So it seems like there are some bugs in Dolphin's JIT compiler.
What steps will reproduce the problem?
You need a fairly recent Nightly Rust compiler to build the project. The project is available here: https://github.com/CryZe/WindWakerBetaQuest/tree/bug-stuff
Make sure to build the branch "bug-stuff". The remaining instructions should be in the repository. Just build the DOL file with make and start the game.
Use Dolphin's Debugger and activate logging OSReport messages and look at the logs. With JIT it should get stuck in an infinite loop of "Recalculate Warp Table", while with Interpreter Mode it doesn't.
Which versions of Dolphin did you test on? Does using an older version of Dolphin solve your issue? If yes, which versions of Dolphin used to work?
What are your PC specifications? (CPU, GPU, Operating System, more)
Is there any other relevant information? (e.g. logs, screenshots,
"Recalculate Warp Table" Spam with JIT active:
Function that causes the bugs:
Here's the Function that crashes. For some reason the second memcmp is executed with the JIT compiler, while it jumps over it with