On 2007-02-14, Grant Edwards <[email protected]> wrote:
> I've noticed that msp430-gcc 3.2.3 often generates
> unnecessarily large frame sizes?
>
> For example for a function containing a large switch statement,
> the frame size will be the _sum_ of the frame sizes required
> for each of the cases.

> Similar things happen for code like this:
>
> void foo(void)
> {
>    float x,y;
>
>    if (whatever)
>       {
>       float xx,yy;
>       <whatever>;
>       }
>    else
>       {
>       float vv,zz;
>       <whatever>;      
>       }
>
>    <whatever>      
> }

It's not as bad as it initially looked for this case.  There's
still some unexplained frame size overhead though.  I can take
a function like this which has a frame size of 32:

void foo()
 {
 line1;
 line2;
 line3;
 line4;
 line5;
 line6;
 line7;
 line8;
 }

And split it up into two functions each of which will have a
frame size of 28:

void foo1()
 {
 line1;
 line2;
 line3;
 line4;
 }

void foo2()
 {
 line5;
 line6;
 line7;
 line8;
 }

I don't suppose there's an "optimize for frame size" option?
 
-- 
Grant Edwards                   grante             Yow!  Here I am in the
                                  at               POSTERIOR OLFACTORY LOBULE
                               visi.com            but I don't see CARL SAGAN
                                                   anywhere!!


Reply via email to