------- Comment #21 from mikulas at artax dot karlin dot mff dot cuni dot cz  
2009-08-08 10:41 -------
Hmm, it still generates the stack frame (and the alignment itself) when there
are structures containing long long and with -malign-double.

Example, compile with -O2 -fomit-frame-pointer -mpreferred-stack-boundary=2
-malign-double:

struct s {
        long long a;
        int b;
};

void f(struct s *x);

void g(void)
{
        struct s x;
        f(&x);
}

--- the stack is aligned although it doesn't have to be. Output:

g:
        pushl   %ebp
        movl    %esp, %ebp
        andl    $-8, %esp
        subl    $20, %esp
        leal    4(%esp), %eax
        movl    %eax, (%esp)
        call    f
        leave
        ret

I compile the whole project with -malign-double (so I must use it on all
modules, even integer ones, as it's ABI thing) and I compile integer-only parts
with -mpreferred-stack-boundary=2.

I don't know if you can extend that hack for "structures containing long long"
... but the whole stack alignment thing really needs to be redesigned for
gcc-4.5.


-- 

mikulas at artax dot karlin dot mff dot cuni dot cz changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40667

Reply via email to