We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stack_check = false
0.14.0-dev.367+a57479afc
main.zig
const std = @import("std"); pub fn main() void { const a: [4096]u8 = undefined; std.mem.doNotOptimizeAway(a); }
build.zig
const std = @import("std"); pub fn build(b: *std.Build) void { const exe = b.addExecutable(.{ .name = "stackCheck", .root_source_file = b.path("src/main.zig"), .target = b.host, .optimize = .ReleaseFast, }); exe.root_module.stack_check = false; b.installArtifact(exe); const emitAsm = b.addInstallFile(exe.getEmittedAsm(), "bin/asm.s"); b.getInstallStep().dependOn(&emitAsm.step); }
Emitted assembly:
wWinMainCRTStartup: .Lfunc_begin0: .cv_func_id 0 .cv_file 1 "C:\\Program Files\\Zig\\lib\\std\\start.zig" .cv_loc 0 1 365 0 .seh_proc wWinMainCRTStartup push rbp mov eax, 4144 .seh_pushreg rbp call ___chkstk_ms sub rsp, rax .seh_stackalloc 4144 .seh_setframe rbp, 128 lea rbp, [rsp + 128] .seh_endprologue and rsp, -16 lea rax, [rsp + 48]
I'm on Windows 10. This happens at all optimization levels.
When exe.root_module.stack_check = false;, the emitted assembly should not contain call ___chkstk_ms.
exe.root_module.stack_check = false;
call ___chkstk_ms
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Zig Version
0.14.0-dev.367+a57479afc
Steps to Reproduce and Observed Behavior
main.zig
build.zig
Emitted assembly:
I'm on Windows 10. This happens at all optimization levels.
Expected Behavior
When
exe.root_module.stack_check = false;
, the emitted assembly should not containcall ___chkstk_ms
.The text was updated successfully, but these errors were encountered: