[LLVMdev] alignment issue, getting corrupt double values

Joe Groff arcata at gmail.com
Mon Dec 31 10:47:11 PST 2012


On Sunday, December 30, 2012, edA-qa mort-ora-y wrote:

> I can confirm that if I generate the value directly (not via a return)
> then the expected values are extracted from the structure. So it is
> perhaps a return value issue.
>

 I think most backends treat struct return by value as returning multiple
values in registers; for instance, {i32, i64} returns into {EAX, RDX} on
x86-64. Since most architectures don't specify any more than two return
registers and you can't really "spill" a return value, weird
poorly-tested things
probably happen if you try to return a struct with more elements than the
backend has return registers for. You could try returning larger structs
indirectly using an sret pointer like Clang does.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121231/8c00a07a/attachment.html>


More information about the llvm-dev mailing list