<div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Dec 17, 2018 at 6:14 AM Mendell, Mark P <<a href="mailto:mark.p.mendell@intel.com">mark.p.mendell@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-CA">
<div class="gmail-m_4286518422298407163WordSection1">
<p class="MsoNormal"><span>For a machine like an FPGA with no stack, you have to ensure that you have an optimization that rewrites the alloca into either registers (such as PromoteMem2Reg) or that you rewrite the alloca by
declaring a static local, and rewriting the code to use that instead of the alloca result.</span></p></div></div></blockquote><div><br></div><div>You'll then have to make sure programs never have recursion.</div><div><br></div><div>When it comes down to it, nothing we run programs on actually has a true unbounded stack. We just have a region of memory that we calculate or hope will be big enough. But over a million people (mostly amateurs) happily and regularly run C++ programs (with virtual functions and all) compiled by gcc on machines with only 2 KB of RAM: theĀ ATmega328 in most Arduinos.</div></div></div></div>