Skip to content

Commit

Permalink
byval parameter should have align 8 on aix
Browse files Browse the repository at this point in the history
  • Loading branch information
mustartt committed Dec 17, 2024
1 parent 83ab648 commit 7bfcddf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_target/src/callconv/powerpc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ where

// The AIX ABI expect byval for aggregates
// See https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/Targets/PPC.cpp.
// The incoming parameter is represented as a pointer in the IR,
// the alignment is associated with the size of the register. (align 8 for 64bit)
if !is_ret && abi == AIX {
arg.pass_by_stack_offset(None);
arg.pass_by_stack_offset(Some(Align::from_bytes(8).unwrap()));
return;
}

Expand Down

0 comments on commit 7bfcddf

Please sign in to comment.