mirror of
https://github.com/ziglang/zig.git
synced 2026-02-16 14:28:57 +00:00
x86_64,riscv64: fix incorrect incoming_stack_alignment handling
The whole motivation behind this proposal in the first place was that the LLVM backend disagrees with the self-hosted backends on what `@setAlignStack` meant, so we can't just translate the old logic to the new system! These backends can introduce support for overriding `incoming_stack_alignment` later on.
This commit is contained in:
parent
cf39652500
commit
387965a696
@ -3607,7 +3607,8 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enu
|
||||
else => false,
|
||||
},
|
||||
.stage2_x86_64 => switch (cc) {
|
||||
.x86_64_sysv, .x86_64_win, .naked => true, // stack alignment supported
|
||||
.x86_64_sysv, .x86_64_win => |opts| opts.incoming_stack_alignment == null,
|
||||
.naked => true,
|
||||
else => false,
|
||||
},
|
||||
.stage2_aarch64 => switch (cc) {
|
||||
|
||||
@ -820,10 +820,7 @@ pub fn generate(
|
||||
try function.frame_allocs.resize(gpa, FrameIndex.named_count);
|
||||
function.frame_allocs.set(
|
||||
@intFromEnum(FrameIndex.stack_frame),
|
||||
FrameAlloc.init(.{
|
||||
.size = 0,
|
||||
.alignment = .fromByteUnits(target_util.stackAlignment(function.target.*, fn_type.fnCallingConvention(zcu))),
|
||||
}),
|
||||
FrameAlloc.init(.{ .size = 0, .alignment = .@"1" }),
|
||||
);
|
||||
function.frame_allocs.set(
|
||||
@intFromEnum(FrameIndex.call_frame),
|
||||
|
||||
@ -871,10 +871,7 @@ pub fn generate(
|
||||
try function.frame_allocs.resize(gpa, FrameIndex.named_count);
|
||||
function.frame_allocs.set(
|
||||
@intFromEnum(FrameIndex.stack_frame),
|
||||
FrameAlloc.init(.{
|
||||
.size = 0,
|
||||
.alignment = .fromByteUnits(target_util.stackAlignment(function.target.*, fn_type.fnCallingConvention(zcu))),
|
||||
}),
|
||||
FrameAlloc.init(.{ .size = 0, .alignment = .@"1" }),
|
||||
);
|
||||
function.frame_allocs.set(
|
||||
@intFromEnum(FrameIndex.call_frame),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user