Suppose you have something like 'struct foo { char data[10000000]; }', and you want to pass such objects as function parameters, and return them as function results, by value, does this currently work correctly on all supported target platforms?
Hi Russell,> Suppose you have something like 'struct foo { char data[10000000]; }', > and you want to pass such objects as function parameters, and return > them as function results, by value, does this currently work correctly > on all supported target platforms?as far as I know this only works on x86, and only with LLVM from svn. Ciao, Duncan.
Oh... :( Are there any plans to change this? It's needed for a correct implementation of C, after all. On Mon, Mar 1, 2010 at 3:14 PM, Duncan Sands <baldrick at free.fr> wrote:> Hi Russell, > >> Suppose you have something like 'struct foo { char data[10000000]; }', >> and you want to pass such objects as function parameters, and return >> them as function results, by value, does this currently work correctly >> on all supported target platforms? > > as far as I know this only works on x86, and only with LLVM from svn. > > Ciao, > > Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
> Suppose you have something like 'struct foo { char data[10000000]; }', > and you want to pass such objects as function parameters, and return > them as function results, by value, does this currently work correctly > on all supported target platforms?Yes, it should. But on many (almost all platforms) this will surely overflow the stack. Also, these objects are not supported on 16-bit targets :) -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
On Mon, Mar 1, 2010 at 3:20 PM, Anton Korobeynikov <anton at korobeynikov.info> wrote:> Yes, it should.Hmm, Duncan Sands says otherwise?> But on many (almost all platforms) this will surely > overflow the stack.Well, the stack size can usually be tweaked at runtime. But suppose we have the default stack size, and replace the 10 MB object with 100 kB, the question stands.> Also, these objects are not supported on 16-bit targets :)True :-) well, on a 16-bit system, can you pass and return a 1 kB object?
Reasonably Related Threads
- [LLVMdev] Pass and return of large objects
- [LLVMdev] Pass and return of large objects
- [LLVMdev] [cfe-dev] 3.2 Release has branched :T+2 hours
- [LLVMdev] Passing return values on the stack & storing arbitrary sized integers
- [LLVMdev] 3.2 Release has branched :T+2 hours