This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc 3.4.2 stack variable lifetime analysis


Can anyone tell me if there is a patch for this problem?

Consider:

void bar(char*);

    void foo(int x)
    {
        if (x) { char y[4096]; bar(y); }
        else   { char z[4096]; bar(z); }
    }

Cygwin gcc 3.4.2 -O2 yields:

        pushl   %ebp
        movl    $8216, %eax   /* Should be about 4k */
        movl    %esp, %ebp
        call    __alloca

PPC cross compiler 3.4.2 -O2 yields:

        cmpwi 7,3,0
        mflr 0
        stwu 1,-8208(1)      /* Should be about 4k */

Earl



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]