-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
backend-llvmThe LLVM backend outputs an LLVM IR Module.The LLVM backend outputs an LLVM IR Module.bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioroptimizationupstreamAn issue with a third party project that Zig uses.An issue with a third party project that Zig uses.
Milestone
Description
Zig Version
0.15.0-dev.558+9279ff888
Steps to Reproduce and Observed Behavior
Compile a function with a return type of noreturn. The generated code saves various registers.
Tested on compiler for rp2350 arm and riscv.
Expected Behavior
noreturn functions should not save registers.
Since the function cannot return, there is no reason to save existing registers, so doing so just wastes stack space. This is especially a problem when writing code for small embedded processors or other situation where stack space is at a premium.
RetroDev256, jgonet, rohlem, pierrelgol and 190n
Metadata
Metadata
Assignees
Labels
backend-llvmThe LLVM backend outputs an LLVM IR Module.The LLVM backend outputs an LLVM IR Module.bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioroptimizationupstreamAn issue with a third party project that Zig uses.An issue with a third party project that Zig uses.