1
Fork 0

i686-windows: make requested alignment > 4 special case apply transitively

This commit is contained in:
Erik Desjardins 2023-07-14 17:48:13 -04:00
parent f297f3200f
commit 2daacf5af9
12 changed files with 113 additions and 115 deletions

View file

@ -63,8 +63,8 @@ where
if t.is_like_msvc
&& arg.layout.is_adt()
&& let Some(repr_align) = arg.layout.repr_align
&& repr_align > align_4
&& let Some(max_repr_align) = arg.layout.max_repr_align
&& max_repr_align > align_4
{
// MSVC has special rules for overaligned arguments: https://reviews.llvm.org/D72114.
// Summarized here:
@ -72,8 +72,8 @@ where
// - For backwards compatibility, arguments with natural alignment > 4 are still passed
// on stack (via `byval`). For example, this includes `double`, `int64_t`,
// and structs containing them, provided they lack an explicit alignment attribute.
assert!(arg.layout.align.abi >= repr_align,
"abi alignment {:?} less than requested alignment {repr_align:?}",
assert!(arg.layout.align.abi >= max_repr_align,
"abi alignment {:?} less than requested alignment {max_repr_align:?}",
arg.layout.align.abi,
);
arg.make_indirect();