authorgravatar for emericchevalier.pro@gmail.comcheme <emericchevalier.pro@gmail.com> 2024-07-21 07:28:22+00:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-07-21 00:28:22-07:00
log01dc0d5a7222470939d3eb96b1d14c27b70161ad
tree45dfbd583e95e4a293856a1c4088713471f8de87
parent397be0c9cc8156d38d1487a4c80210007033cbd0
signaturebadge-check Signed by PGP key B5690EEEBB952194

Riscv32e align stack to 4 bytes (#20673)


2 files changed, 4 insertions(+), 2 deletions(-)

lib/std/Target.zig+2-1
......@@ -1967,7 +1967,6 @@ pub fn stackAlignment(target: Target) u16 {
19671967 .bpfel,
19681968 .mips64,
19691969 .mips64el,
1970 .riscv32,
19711970 .riscv64,
19721971 .sparc64,
19731972 .x86_64,
......@@ -1976,6 +1975,8 @@ pub fn stackAlignment(target: Target) u16 {
19761975 .wasm64,
19771976 .loongarch64,
19781977 => 16,
1978 .riscv32,
1979 => if (Target.riscv.featureSetHas(target.cpu.features, .e)) 4 else 16,
19791980 .powerpc64,
19801981 .powerpc64le,
19811982 => switch (target.os.tag) {
src/codegen/llvm.zig+2-1
......@@ -542,7 +542,8 @@ const DataLayoutBuilder = struct {
542542 try self.typeAlignment(.float, 64, 64, 64, true, writer);
543543 }
544544 if (stack_abi != ptr_bit_width or self.target.cpu.arch == .msp430 or
545 self.target.os.tag == .uefi or self.target.os.tag == .windows)
545 self.target.os.tag == .uefi or self.target.os.tag == .windows or
546 self.target.cpu.arch == .riscv32)
546547 try writer.print("-S{d}", .{stack_abi});
547548 switch (self.target.cpu.arch) {
548549 .hexagon, .ve => {