[flang-commits] [flang] [flang] Inherit target specific code for BIND(C) types on Windows (PR #129579)

Eli Friedman via flang-commits flang-commits at lists.llvm.org
Sun Mar 9 20:55:26 PDT 2025


efriedma-quic wrote:

> does that mean normal alignment rules apply for the hidden argument for the result, while it is always 16 for struct value argument passed in memory?

The spec also sometimes has holes, so probably we'd want to investigate MSVC code generation a bit.  But that's my reading.

> Also, looking at LLVM IR emitted by clang for x86_64-windows-msvc, I see that memory allocated for struct value argument is not always 16 byte aligned (see the %2 = alloca %struct.S, align 4 in the [godbolt LLVM IR for your example](https://godbolt.org/z/jK1znT6dE)). Is this a bug on clang side

That's probably a bug?  At least, that's my reading of the spec; not sure what happens in practice.

https://github.com/llvm/llvm-project/pull/129579


More information about the flang-commits mailing list