edA-qa mort-ora-y
2012-Dec-31 18:58 UTC
[LLVMdev] alignment issue, getting corrupt double values
On 31/12/12 19:47, Joe Groff wrote:> 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.I do pass the return as the first parameter pointer now. I didn't know about sret, I guess I should mark it is as such (does it help optimization then?) I also think it is kind of dangerous that LLVM silently accepts returns of larger structures and then produces invalid code. Note that it does actually pass by pointer if the backend can't return it directly, just in certain cases it fails to produce correct code. -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 261 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121231/6c238789/attachment.sig>
On Monday, December 31, 2012, edA-qa mort-ora-y wrote:> I also think it is kind of dangerous that LLVM silently accepts returns > of larger structures and then produces invalid code. Note that it does > actually pass by pointer if the backend can't return it directly, just > in certain cases it fails to produce correct code.You should definitely file a bug. Did you build LLVM with assertions enabled? If not, try rebuilding with assertions, and you might get an indication of what's breaking instead of silent bad behavior. -Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121231/9d51ea8a/attachment.html>
edA-qa mort-ora-y
2013-Jan-01 06:23 UTC
[LLVMdev] alignment issue, getting corrupt double values
On 01/01/13 00:52, Joe Groff wrote:> You should definitely file a bug. Did you build LLVM with assertions > enabled? If not, try rebuilding with assertions, and you might get an > indication of what's breaking instead of silent bad behavior.Yes, assertions are enabled: I get them all the time, just not here. ;) I'll file a defect. -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 261 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130101/83e26cb6/attachment.sig>
Maybe Matching Threads
- [LLVMdev] alignment issue, getting corrupt double values
- [LLVMdev] alignment issue, getting corrupt double values
- [LLVMdev] alignment issue, getting corrupt double values
- [LLVMdev] alignment issue, getting corrupt double values
- [LLVMdev] alignment issue, getting corrupt double values