https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95285
--- Comment #6 from Bu Le <bule1 at huawei dot com> --- (In reply to Wilco from comment #4) > (In reply to Bu Le from comment #3) > > (In reply to Wilco from comment #2) > Well the question is whether we're talking about more than 4GB of code or > more than 4GB of data. With >4GB code you're indeed stuck with the large > model. With data it is feasible to automatically use malloc for arrays when > larger than a certain size, so there is no need to change the application at > all. Something like that could be the default in the small model so that you > don't have any extra overhead unless you have huge arrays. Making the > threshold configurable means you can tune it for a specific application. Is this automatic malloc already avaiable on some target? I haven't found an example that works in that way. Would you mind provide an example?