On Jan 16, 2012, at 8:07 AM, "Joel C. Salomon" <[email protected]> wrote:
> This would make it difficult to implement C99's variable-length
> (actually, run-time-determined--length) arrays.  The best compiler-only
> change I can think of would be to define a hidden variable `size_t
> __size_of_all_vlas`, and add code to adjust SP by that amount before &
> after each function call.

Length can be derived from user input, or diff. arrays can be allocated in 
diff. branches of switch or if stmt. so your trick won't always work.

> Google turns up <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39337>,
> indicating that GCC had issues combining VLAs and -fomit-frame-pointer;
> I don't know how they managed the combination.

Must use a frame pointer in any function that has VLAs and must save it before 
calling another function from it. 

Reply via email to