On Mon, Mar 1, 2010 at 6:00 PM, Dale Johannesen <dalej at apple.com> wrote:> No, C only requires support for objects up to 65535 bytes in size. C99 5.2.4.1.65535 bytes would be reasonably sufficient; what's the largest supported by the LLVM code generator?
On Mar 1, 2010, at 2:49 PMPST, Russell Wallace wrote:> On Mon, Mar 1, 2010 at 6:00 PM, Dale Johannesen <dalej at apple.com> wrote: >> No, C only requires support for objects up to 65535 bytes in size. C99 5.2.4.1. > > 65535 bytes would be reasonably sufficient; what's the largest > supported by the LLVM code generator?The common code shouldn't have problems with it AFAIK. How well it works on a particular target/ABI combination depends on whether anybody has been interested enough to implement it; free software is like that, I'm afraid. But you are not likely to run into a limitation based on size; if it works for an object of size 50 or so it should work for a bigger one. On any target/ABI combination you may run into runtime stack overflows if you try to do too much, particularly if recursion is involved (as Anton mentioned). This is not a compiler issue, but a limitation of the target environment.
On Mar 1, 2010, at 2:49 PM, Russell Wallace wrote:> On Mon, Mar 1, 2010 at 6:00 PM, Dale Johannesen <dalej at apple.com> wrote: >> No, C only requires support for objects up to 65535 bytes in size. C99 5.2.4.1. > > 65535 bytes would be reasonably sufficient; what's the largest > supported by the LLVM code generator?If you're wondering what this limit is, you're probably heading down the wrong path, unless you're ultimate interest here is to work on optimizer techniques for transforming this kind of code into something usable. Dan
On Tue, Mar 2, 2010 at 2:34 AM, Dan Gohman <gohman at apple.com> wrote:> If you're wondering what this limit is, you're probably heading down > the wrong path, unless you're ultimate interest here is to work on > optimizer techniques for transforming this kind of code into > something usable.No, I'm just trying for correctness -- most of the time, only small objects will be passed by value, for obvious efficiency reasons. If it turns out the limit is the same as for integers, for example, i.e. the size of two pointers, then I can say, OK, that's the threshold, and anything bigger than that gets explicitly implemented as sret.