Zig Version
all versions after 0.13.0
Steps to Reproduce and Observed Behavior
Can simply be observed on https://godbolt.org/z/PW7faeY6M
When in ReleaseFast compilation mode, zig thinks that ra and s0 should be saved for no apparent reason. ReleaseSmall is able to generate the expected assembly with just a mul and a ret. This appears to be a regression introduced in 0.13.0, since 0.13.0 is able to generate the expected assembly with both ReleaseFast and ReleaseSmall.
Expected Behavior
ReleaseFast mode should match the assembly in ReleaseSmall mode.
Zig Version
all versions after 0.13.0
Steps to Reproduce and Observed Behavior
Can simply be observed on https://godbolt.org/z/PW7faeY6M
When in
ReleaseFastcompilation mode, zig thinks thatraands0should be saved for no apparent reason.ReleaseSmallis able to generate the expected assembly with just amuland aret. This appears to be a regression introduced in 0.13.0, since 0.13.0 is able to generate the expected assembly with bothReleaseFastandReleaseSmall.Expected Behavior
ReleaseFastmode should match the assembly inReleaseSmallmode.