will gcc support better stack space reuse?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Was wondering whether a new version of GCC for x86 (linux) can now
reallocate unused stack space from locals defined in different scopes.
E.g., functions suck1 and suck2 suffer from increased stack pressure because
gcc (in my case 3.3.3 on linux/x86) cannot smartly reuse the stack space.
Anyone out there with insight on why this is the case and when gcc might
handle stack packing (if not already).

int garray[64];
static inline numberone(int a, int b){
        int array[64];
        array[1]=a*b;
        garray[0]=array[1];
}

static inline numbertwo(int a, int b){
        int array[64];
        array[1]=a*b;
        garray[1]=array[1];
}

void suck1(int a, int b){
        numberone(a,b);
        numbertwo(a,b);
}

void suck2(int a, int b){
        {
        int array[64];
        array[1]=a*b;
        garray[0]=array[1];
        }
        {
        int array[64];
        array[1]=a*b;
        garray[1]=array[1];
        }
}

Marc


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux