[PATCH][MIPS] mwarn-framesize= option

Eric Botcazou ebotcazou@adacore.com
Fri Jun 13 21:19:00 GMT 2008


> One way to do it, is the adding a new target hook, something like,
> target_get_frame_size() which will return the actual frame size of a
> function (the hook will work only after prologue and epilogue are generated
> of course). This means targets will have to independently remember the
> frame size somehow, or be able to calculate it.
> If the target doesn't implement one, we can fall back to
> get_frame_size() in function.c.
>
> One alternative is to add a new field in struct function
> that contains the actual frame size, and have the backend write to it
> during prologue/epilogue generation.
>
> Any preference for either way ?

A few years of experience[*] have shown that the first approach is somewhat 
error-prone: for example, on the IA-64, the validity window during which you 
can calculate it is very small (just before prologue/epilogue generation).
On the SPARC, you must be careful with the leaf function business.  And so on.

So the second approach is clearly the way to go in my opinion.

[*] http://gcc.gnu.org/ml/gcc-patches/2006-06/msg01008.html

-- 
Eric Botcazou



More information about the Gcc-patches mailing list